Author Topic: Use derived class(eg. from wxListBox) from wxSmith  (Read 3746 times)

Offline samsam598

  • Multiple posting newcomer
  • *
  • Posts: 15
Use derived class(eg. from wxListBox) from wxSmith
« 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

Offline GeO

  • Multiple posting newcomer
  • *
  • Posts: 51
Re: Use derived class(eg. from wxListBox) from wxSmith
« Reply #1 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

Offline samsam598

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: Use derived class(eg. from wxListBox) from wxSmith
« Reply #2 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
 

Offline GeO

  • Multiple posting newcomer
  • *
  • Posts: 51
Re: Use derived class(eg. from wxListBox) from wxSmith
« Reply #3 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

Offline samsam598

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: Use derived class(eg. from wxListBox) from wxSmith
« Reply #4 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!!