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 


[Delphi] Inheritance

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
rapion124
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Mar 2007
Posts: 1095

PostPosted: Mon Dec 17, 2007 7:52 pm    Post subject: [Delphi] Inheritance Reply with quote

Is there anyway to create and use more than 1 instance of an object and have the created objects be derived from the original? For example, I wanna use 20 separate labels in my program. Instead of creating 20 labels at design time, is there a way to create only 1 at degisn time and have all the other 19 be derived from that one? Like in C, you can create objects based on another objects. Is there a way to do that in Delph?
Back to top
View user's profile Send private message
Uzeil
Moderator
Reputation: 6

Joined: 21 Oct 2006
Posts: 2411

PostPosted: Tue Dec 18, 2007 1:46 pm    Post subject: Reply with quote

A good example of dynamic component creation in Delphi: CE's pointer form(add manual address).
_________________


Mini Engine v3.0
Mipla v1.0

Reposted old threads out of the MS section.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Tue Dec 18, 2007 2:15 pm    Post subject: Reply with quote

you can create a special tpanel class (inherit from the original tpanel) called Tmystuff and on there place the labels.
Then in your code you can create 20 of those
And then create multiple TMyStuff objects and place them on the form at runtime. (setting the parent)

e.g: inheriting from a previous class:
type TMyclass=class(classtoinheritfrom)
public
...
private
...
protected
...
etc
...
end;

for more specific stuff, look up inhertance in the helpfile, it's not difficult.
Just not sure if it supports inheriting from 2 or more classess like C can, but ising interfaces you can

_________________
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
Uzeil
Moderator
Reputation: 6

Joined: 21 Oct 2006
Posts: 2411

PostPosted: Tue Dec 18, 2007 6:07 pm    Post subject: Reply with quote

I thought he was talking about creating objects based on others for run-time? Although your interpretation would explain why he called it inheritence(Even though you can inherit traits from other objects during object creation).

For procedure overwriting, use the keyword override after the procedure(ctrl+shift+c while having the cursor in the procedure title will set up with with default settings for it's overridden procedure(like starting out with the keyword inherited; )

_________________


Mini Engine v3.0
Mipla v1.0

Reposted old threads out of the MS section.
Back to top
View user's profile Send private message
mOnSoOn
Expert Cheater
Reputation: 0

Joined: 05 Jul 2007
Posts: 203

PostPosted: Fri Dec 21, 2007 5:07 am    Post subject: Reply with quote

Inheritance Smile
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming 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