Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Sat Aug 14, 2021 9:01 pm Post subject: |
|
|
Honest, I am not read the post completely. Anyhow this a sample script I made for my custom CE 7.2.
Code: | function createSpeedButton(parent)
local sp = createComponentClass('TSpeedButton', parent)
sp.parent = parent
return sp
end
function createBitButton(parent)
local bb = createComponentClass('TBitBtn', parent)
bb.parent = parent
return bb
end
function createFontDialog(parent)
local fd = createComponentClass('TFontDialog', parent)
fd.parent = parent
return fd
end
function createStaticText(parent)
local st = createComponentClass('TStaticText', parent)
st.parent = parent
return st
end
function createColorListBox(parent)
local clb = createComponentClass('TColorListBox', parent)
clb.parent = parent
return clb
end
function createColorBox(parent)
local clbx = createComponentClass('TColorBox', parent)
clbx.parent = parent
return clbx
end
function createNoteBook(parent) -- better use PageControl
local nb = createComponentClass('TNotebook', parent)
nb.parent = parent
return nb
end
function createShape(parent)
local sh = createComponentClass('TShape', parent)
sh.parent = parent
return sh
end
function createBevel(parent)
local bv = createComponentClass('TBevel', parent)
bv.parent = parent
return bv
end
function createControlBar(parent)
local cbar = createComponentClass('TControlBar', parent)
cbar.parent = parent
return cbar
end
function createFlowPanel(parent)
local fpnl = createComponentClass('TFlowPanel', parent)
fpnl.parent = parent
return fpnl
end
function createApplicationProperties(parent)
local aprop = createComponentClass('TApplicationProperties', parent)
aprop.parent = parent
return aprop
end
--- Test
if f then f.Destroy() end
f = createForm()
f.Width = 600
f.Height = 500
f.Position = 'poScreenCenter'
f.Caption = 'Additional CE 7.2 Components+'
-- // Speed Button //-- J
sbn = createSpeedButton(f)
sbn.setSize(130,40)
sbn.setPosition(10,10)
sbn.Caption = 'Speed Button'
pic = createPicture()
pic.loadFromFile('D:\\save.png')
sbn.Glyph = pic.Bitmap
pic.Destroy()
sbn.OnClick = function()
showMessage('You have been clicked SPEED BUTTON')
return
end
-- // Panel //--
pnl = createPanel(f)
pnl.setSize(150,40)
pnl.setPosition(300, 10)
pnl.Caption = 'Panel'
-- pnl.Color = 'clRed' -- Not recognize
-- // Color Box //--
clbox = createColorBox(f)
clbox.setPosition(470, 10)
clbox.OnChange = function()
pnl.Color = clbox.Selected
end
-- // Color List Box //--
clsb = createColorListBox(f)
clsb.setSize(130,170)
clsb.setPosition(10,60)
clsb.Items.Clear()
clsb.Items.Add(clRed, 255)
clsb.Items.Add(clYellow, 65535)
clsb.Items.Add(clGreen, 32768)
clsb.Items.Add(clBlue, 16711680)
clsb.OnSelectionChange = function()
x = clsb.ItemIndex
local col = clsb.Items[x] -- can not recognize color name
pnl.Color = col
end
-- // Speed Button 2//--
sbn1 = createSpeedButton(f)
sbn1.setSize(130,40)
sbn1.setPosition(150,10)
sbn1.Caption = 'Font Dialog'
pic = createPicture()
pic.loadFromFile('D:\\bold.png')
sbn1.Glyph = pic.Bitmap
pic.Destroy()
sbn1.OnClick = function()
if fdl.Execute() then
lbl.Font = fdl.Font
end
end
-- // Font Dialog //--
fdl = createFontDialog(f)
-- // Static Text //--
lbl = createStaticText(f)
lbl.setPosition(150,60)
lbl.AutoSize = true
lbl.Caption = 'Cheat Engine 7.2 Static Text'
-- // Page Control to substitude TNoteBook //--
nbk = createPageControl(f) -- Better than TNoteBook
nbk.setSize(200, 140)
nbk.setPosition(150, 90)
local tab = {}
for i = 1, 4 do
tab[i] = nbk.addTab()
tab[i].Caption = 'Page '..i
end
-- // Shape //--
shp = createShape(f)
shp.setSize(100,140)
shp.setPosition(360,90)
shp.Shape = 'stStarDown'
shp.Brush.Color = 65355
shp.Brush.Style = 0
-- // Bevel //--
bvl = createBevel(f)
bvl.setSize(100,140)
bvl.setPosition(470,90)
bvl.BorderStyle = 'bsNone'
bvl.Style = 'bsRaised'
bvl.Shape = 'bsFrame'
bvl.OnPaint = function()
bvl.Canvas.Pen.Color = 0xffffff
bvl.Canvas.Font.Size = 14
bvl.Canvas.Brush.Style = 1
bvl.Canvas.gradientFill(0,0,bvl.width,bvl.height,1212,552582,1)
bvl.Canvas.textOut(20,50,'Bevel')
end
-- // Control Bar //--
ctbar = createControlBar(f) --- not effective without TMenuBar, TToolBar
ctbar.setSize(f.width,60)
ctbar.setPosition(0,250)
ctbar.AutoSize = true
-- Add speed button to control bar
sbn2 = createSpeedButton(ctbar)
sbn2.setSize(130,40)
sbn2.setPosition(10,10)
sbn2.Caption = 'Font Dialog'
pic = createPicture()
pic.loadFromFile('D:\\bold.png')
sbn2.Glyph = pic.Bitmap
pic.Destroy()
sbn2.OnClick = function()
if fdl.Execute() then
lbl.Font = fdl.Font
end
end
-- // Flow Panel //--
fpan = createFlowPanel(f)
fpan.setSize(300,170)
fpan.setPosition(10,320)
fpan.FlowStyle = 'fsLeftRightTopBottom'
fpan.FlowLayout = 'tlCenter'
fpan.Autowrap = true
local i,LButton,LEdit
for i = 0, 10 do
LButton = createButton(fpan)
LButton.Parent = fpan
LButton.Height = 30
LButton.Caption = string.format('Status%d', i)
LButton.AlignWithMargins = true
end
for i = 0, 6 do
LEdit = createEdit(fpan)
LEdit.Parent = fpan
LEdit.Height = 30
LEdit.Text = string.format('MyEdit%d', i)
LEdit.AlignWithMargins = true
end
-- // Application Properties //-- need example to use this
app = createApplicationProperties(f)
new72 = [[
registerclass(TFontDialog);
registerclass(TBitBtn);
registerclass(TSpeedButton);
registerclass(TStaticText);
registerclass(TShape);
registerclass(TBevel);
registerclass(TNotebook); -- better use TPageControl
registerclass(TLabeledEdit);
registerclass(TControlBar);
registerclass(TFlowPanel);
registerclass(TApplicationProperties);
registerclass(TColorListBox);
---- THIS PART BELOW CAN'T ADD AS CUSTOM COMPONENT
---- NEED CREATE NEW CLASS
registerclass(TColorButton);
registerclass(TSpinEdit);
registerclass(TEditButton);
registerclass(THTMLBrowserHelpViewer); -- need this
]]
NoteAfterTest = [[
1. ColorListBox -> can't handle ColorListBox.Selected method
to assign color to components.
Can not set 'color rect, color name' on the
color listbox.
2. NoteBook -> Better use TPageControl.
3. BitButton -> Can not add glyph.
4. Other, ListView -> imagelist, still show one image event there are
more than one image on the image list.
5. ControlBar -> need TMenuBar, TToolBar ?
6. ApplicationProperties -> need study this one
7. -- // Speed Button //-- Just work fine
8. -- // Color Box //-- Just work fine
9. -- // Font Dialog //-- Just work fine
10.-- // Static Text //-- Just work fine
11.-- // Shape //-- Just work fine
12.-- // Bevel //-- Just work fine
13.-- // Flow Panel //-- Just work fine
14.Need THTMLBrowserHelpViewer
]]
|
I remember to edit a .pas file in CE 7.2 source code and recompile with Lazarus.
OR
Use some WINAPI functions to create windows and module handles
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|