Author Topic: wxSmith: Minor issue with TreeCtrl  (Read 11313 times)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9699
wxSmith: Minor issue with TreeCtrl
« on: December 03, 2005, 04:13:28 pm »
I've dicovered 2 minor issues with the plugin:
1.) I've added a TreeCtrl to my wxSmith based application and suddenly I couldn't compile anymore. After some search I figured out (very strange?!) that if I add a treecontrol with the name "trcComposition" wxSmith adds the following entry to the CPP-file:
Code
trcComwxDefaultPositionition = new wxTreeCtrl(this,ID_TRC_COMPOSITION,wxDefaultPosition,wxDefaultSize,0);
Where does the "wxDefaultPosition" come from in the control's name?
I just renamed it in the source code but it's written every time again when I change something on the GUI in wxSmith. :(
BTW: This happens only if I choose "trcComposition" as name. So if I rename it it works, but I don't know another word for "Composition"... :lol:

2.) I've added a wxNotebook with two wxPanels to te GUI. Then I added a wxTextCtrl to the first panel (which worked). Then I wanted to add a wxTextCtrl to the second wxPanel as well, but  wxSmith puts it on the same level as the wxNotebook is in the project. So it's not within the seconbd panel. Strange is that within the wxs file it seems to be at the correct postion...?!

Thanks for any help in advance.

Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Re: wxSmith: Minor issue with TreeCtrl
« Reply #1 on: December 03, 2005, 04:56:56 pm »
I've dicovered 2 minor issues with the plugin:
1.) I've added a TreeCtrl to my wxSmith based application and suddenly I couldn't compile anymore. After some search I figured out (very strange?!) that if I add a treecontrol with the name "trcComposition" wxSmith adds the following entry to the CPP-file:
Code
trcComwxDefaultPositionition = new wxTreeCtrl(this,ID_TRC_COMPOSITION,wxDefaultPosition,wxDefaultSize,0);
Where does the "wxDefaultPosition" come from in the control's name?
I just renamed it in the source code but it's written every time again when I change something on the GUI in wxSmith. :(
BTW: This happens only if I choose "trcComposition" as name. So if I rename it it works, but I don't know another word for "Composition"... :lol:

Looks like wxSmith does a blind replace of "pos" with "wxDefaultPosition". Does the same thing happen if you give it another name containing the string "pos"?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9699
Re: wxSmith: Minor issue with TreeCtrl
« Reply #2 on: December 03, 2005, 05:03:30 pm »
Does the same thing happen if you give it another name containing the string "pos"?
I tried "trcMyPos" instead - this is working. Then I tried "trcMypos" -> it's broken. It seems you are right, just it's case-sensitive in addition. However: The second line (where the widget is added to the parent) works:
Code
fgsUpper->Add(trcMypos,1,wxALL|wxALIGN_CENTER,5);
So it's really only the line where the widget is being constructed...?!

Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 836
Re: wxSmith: Minor issue with TreeCtrl
« Reply #3 on: December 03, 2005, 09:24:54 pm »
I've dicovered 2 minor issues with the plugin:
1.) I've added a TreeCtrl to my wxSmith based application and suddenly I couldn't compile anymore. After some search I figured out (very strange?!) that if I add a treecontrol with the name "trcComposition" wxSmith adds the following entry to the CPP-file:
Code
trcComwxDefaultPositionition = new wxTreeCtrl(this,ID_TRC_COMPOSITION,wxDefaultPosition,wxDefaultSize,0);
Where does the "wxDefaultPosition" come from in the control's name?
I just renamed it in the source code but it's written every time again when I change something on the GUI in wxSmith. :(
BTW: This happens only if I choose "trcComposition" as name. So if I rename it it works, but I don't know another word for "Composition"... :lol:

2.) I've added a wxNotebook with two wxPanels to te GUI. Then I added a wxTextCtrl to the first panel (which worked). Then I wanted to add a wxTextCtrl to the second wxPanel as well, but  wxSmith puts it on the same level as the wxNotebook is in the project. So it's not within the seconbd panel. Strange is that within the wxs file it seems to be at the correct postion...?!

Thanks for any help in advance.

Morten.


The first one: Jay, I've forgot to recode this dumb string replacing  :oops:

The second one: Try selecting panel from resource browser first and make sure that insertion type is into.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9699
Re: wxSmith: Minor issue with TreeCtrl
« Reply #4 on: December 04, 2005, 02:32:05 pm »
The first one: Jay, I've forgot to recode this dumb string replacing  :oops:
Well, if such things are the issues remaining... erm... great! :D

The second one: Try selecting panel from resource browser first and make sure that insertion type is into.
Well... sorry to say that: But it works now. I could swear that I did the same thing 2 days ago several times - also selecting the panel before. Well, I'm only a wxWidgtes beginner - so I guess it was my fault. Sorry... :oops:

I hope you don't mind if I add another question: I found that in several controls there is a size property (for example wxTextCtrl). But whenever I specify a value here I see no change in the underlying sourcecode that is being generated. I would have expected some kind of "SetSize()" or similar. How it this done?

With best regards...

Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline cyberkoa

  • Plugin developer
  • Almost regular
  • ****
  • Posts: 145
    • http://
Re: wxSmith: Minor issue with TreeCtrl
« Reply #5 on: December 04, 2005, 04:36:13 pm »
I hope you don't mind if I add another question: I found that in several controls there is a size property (for example wxTextCtrl). But whenever I specify a value here I see no change in the underlying sourcecode that is being generated. I would have expected some kind of "SetSize()" or similar. How it this done?

With best regards...

Morten.
Try to look at the construction/creation statement (new wxTextCtrl(...) bla bla bla ), the default size is changed there if I'm not mistaken.

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 836
Re: wxSmith: Minor issue with TreeCtrl
« Reply #6 on: December 05, 2005, 12:01:10 am »

I hope you don't mind if I add another question: I found that in several controls there is a size property (for example wxTextCtrl). But whenever I specify a value here I see no change in the underlying sourcecode that is being generated. I would have expected some kind of "SetSize()" or similar. How it this done?

With best regards...

Morten.


To use Your own size unselect "Default" property right under size - it blocks it :).
Or resize item with mouse and then adjust Your size manually :)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9699
Re: wxSmith: Minor issue with TreeCtrl
« Reply #7 on: December 05, 2005, 09:00:55 am »
To use Your own size unselect "Default" property right under size - it blocks it :).
Or resize item with mouse and then adjust Your size manually :)
That did the trick. Thanks a lot for all your help!

Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ