Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


inheritsFromComponent()

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Wed Oct 14, 2020 12:48 am    Post subject: inheritsFromComponent() Reply with quote

Is there any example how to use 'createClass' and 'inheritsFromComponent()' ?.

And is CE have function 'RegisterComponents()' ?.

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25807
Location: The netherlands

PostPosted: Wed Oct 14, 2020 1:52 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message MSN Messenger
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Wed Oct 14, 2020 5:43 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites