News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

wxSmith: Minor issue with TreeCtrl

Started by MortenMacFly, December 03, 2005, 04:13:28 PM

Previous topic - Next topic

MortenMacFly

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:

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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Urxae

Quote from: MortenMacFly 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:

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"?

MortenMacFly

Quote from: Urxae on December 03, 2005, 04:56:56 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:

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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

byo

Quote from: MortenMacFly 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:

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.

MortenMacFly

Quote from: byo on December 03, 2005, 09:24:54 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

Quote from: byo on December 03, 2005, 09:24:54 PM
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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

cyberkoa

Quote from: MortenMacFly on December 04, 2005, 02:32:05 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.

byo

Quote from: MortenMacFly on December 04, 2005, 02:32:05 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.


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 :)

MortenMacFly

Quote from: byo on December 05, 2005, 12:01:10 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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]