Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: samsam598 on May 04, 2010, 02:19:21 am

Title: Use derived class(eg. from wxListBox) from wxSmith
Post by: samsam598 on May 04, 2010, 02:19:21 am
Warm greetings!

Code like below:
Code

class MyListBox:public wxListBox
{
};
When I build GUI interface with wxSimth,is it possible that auto generated code uses MyListBox other than wxListBox,or where can I select to replace wxListBox in wxSmith control property toolbox?

Thanks so much for your help in advance.

Regards,
Sam
Title: Re: Use derived class(eg. from wxListBox) from wxSmith
Post by: GeO on May 04, 2010, 01:56:17 pm
Hi samsam598,

you can either make it with the customcontrol of wxSmith or you can make a wxListBox and then you rename the field "Class name" from wxListBox to MyListBox.

HTH GeO
Title: Re: Use derived class(eg. from wxListBox) from wxSmith
Post by: samsam598 on May 05, 2010, 11:13:20 am
Hi samsam598,

you can either make it with the customcontrol of wxSmith or you can make a wxListBox and then you rename the field "Class name" from wxListBox to MyListBox.

HTH GeO

Thank you so much GeO.I understood the method you mentioned --"rename the field "Class name" from wxListBox to MyListBox."
For the first method you've mentioned---
" make it with the customcontrol of wxSmith "
Do you mean the most right one off the standard?I will study it although I have no idea with it at this moment.

Thank you again.

Regards,
Sam
 
Title: Re: Use derived class(eg. from wxListBox) from wxSmith
Post by: GeO on May 05, 2010, 08:03:35 pm
For the first method you've mentioned---
" make it with the customcontrol of wxSmith "
Do you mean the most right one off the standard?I will study it although I have no idea with it at this moment.

yes thats what i meant. With this you can define your own control. The first line in the property window ("Creating code") defines how its created(basicly the constructor)
Code
$(THIS) = new $(CLASS)($(PARENT),$(ID),$(POS),$(SIZE));
$(CLASS) will be replaced by the "Class name" and so on....

HTH GeO

PS Sorry for my english
Title: Re: Use derived class(eg. from wxListBox) from wxSmith
Post by: samsam598 on May 06, 2010, 02:17:39 am
For the first method you've mentioned---
" make it with the customcontrol of wxSmith "
Do you mean the most right one off the standard?I will study it although I have no idea with it at this moment.

yes thats what i meant. With this you can define your own control. The first line in the property window ("Creating code") defines how its created(basicly the constructor)
Code
$(THIS) = new $(CLASS)($(PARENT),$(ID),$(POS),$(SIZE));
$(CLASS) will be replaced by the "Class name" and so on....

HTH GeO

PS Sorry for my english

Got it.Great thanks!!