Archived

This topic is now archived and is closed to further replies.

New component in Delphi

This topic is 5588 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, guys! First of all, thanx to your replies to my post memory management, you really helped me a lot! But naturally, a programmer''s needs can never be satisfied , and therefor i have another question to you: How do i create a new component derived from TMainMenu which should hold some additional properties in a TMenuItem -entry? I know how to add properties to ... let''s say a button ..., but how does that work with this stuff ? Yours, Indeterminatus --si tacuisses, philosophus mansisses--

Share this post


Link to post
Share on other sites
Basically what you have to do is create a descendant of TMainMenu (Let''s call it TMyMenu) and a descendant of TMenuItem (TMyMenuItem).
Then alter TMyMenu so that it uses TMyMenuItem instead of TMenuItem.

I dunno which version of Delphi you have, but if yours comes with the source code to the VCL, take a look at TMainMenu and TMenuItem...especially TMenuItem.
TMenuItem actually can hold sub-items (and usually does)... so if you want to make a TMyMenuItem, you''ll have to change quite a bit.

Share this post


Link to post
Share on other sites