Joined: 09 May 2003 Posts: 25807 Location: The netherlands
Posted: Wed Oct 14, 2020 1:52 am Post subject:
btn=createComponentClass("TCEButton", form)
createClass similar but it has no owner control
RegisterComponents() no, but you can add buttons to the toolbar and set their name and hint property accordingly
registerClass also not, but that won't work in lua anyhow as it needs a pointer to a class object and not a string and you can not get a pointer to a class without it being registered
and inheritsFromComponent() just calls x=x.Parent repeatedly and checks if x.ClassName is TComponent _________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping
Yes DB, I know using 'createComponentClass(comp, owner), example:
Code:
f = createForm()
sb = createScrollBox(f)
f.Show()
This will rise an error, but if I use:
Code:
function createScrollBox(Parent)
local box = createComponentClass('TScrollBox', Parent)
box.Parent = Parent
return box
end
createForm()
sb = createScrollBox(f)
f.Show()
This will work properly since TScrollBox already register at 'ceguicomponents.pas' on CE source code.
So, I just thinking about how to add new component class which not exist yet on CE gui components..
For example TFontDialogs, and other dialog components inherit from class TCommonDialog (except : save, open, find and find directory which already registered in CE).
But it seem not work if the object components not register on 'ceguicomponents.pas' for example numericUpDown button, etc.
Example:
Code:
function createFontDialog(hwnd)
local fd = createComponentClass('TFontDialog', hwnd)
fd.Parent = hwnd
return fd
end
-- or
function createFontDialog(hwnd)
MyClass = createClass('TCommonDialog')
TFontDialog = inheritsFromObject(MyClass)
local fd = createComponentClass('TFontDialog', hwnd)
fd.Parent = hwnd
return fd
end
The last two function return error 'Access Violation'.
Or I just don't know how to these in correct way and need learn about it more.
Anyhow, thank you for your answer and supports. _________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum