Author Topic: [wxSmith] How to add Tree Control items?  (Read 5607 times)

Offline Cinolt

  • Multiple posting newcomer
  • *
  • Posts: 22
[wxSmith] How to add Tree Control items?
« on: August 02, 2010, 02:30:30 am »
Hi, I'm using wxSmith and created a tree control, but is there any way I can add items to this such as text?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9508
Re: [wxSmith] How to add Tree Control items?
« Reply #1 on: August 02, 2010, 06:55:36 am »
Hi, I'm using wxSmith and created a tree control, but is there any way I can add items to this such as text?
I am not sure what exactly you mean by "adding text", but you can try to start here:
http://wiki.codeblocks.org/index.php?title=WxSmith_tutorials
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline Cinolt

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: [wxSmith] How to add Tree Control items?
« Reply #2 on: August 03, 2010, 12:14:42 am »
I am not sure what exactly you mean by "adding text"

Perhaps the only thing I could mean. Here's a picture to illustrate an example of what I want:
http://i27.tinypic.com/1054dag.jpg

It seems like such a trivial task to implement; can I at least get some rationale as to why wxSmith would support adding a tree control but not allow the user to add text to it?
« Last Edit: August 03, 2010, 12:17:38 am by Cinolt »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12085
    • Travis build status
Re: [wxSmith] How to add Tree Control items?
« Reply #3 on: August 03, 2010, 09:25:20 am »
Probably because no one needed it, also most of the time you'll want to associate some user data to the tree items, not just text.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Cinolt

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: [wxSmith] How to add Tree Control items?
« Reply #4 on: August 03, 2010, 02:35:53 pm »
The text is the prime component of the tree control, what do you mean no one needed it? Am I really the only one who finds it silly that the only support wxSmith has for the tree control is a blank tree control? I don't know, to me that just sounds odd. Just slightly.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12085
    • Travis build status
Re: [wxSmith] How to add Tree Control items?
« Reply #5 on: August 03, 2010, 03:39:18 pm »
If this missing feature is extremely annoying to you, you can implement it yourself and then you can provide the patch, so it can be applied to trunk.
C::B is open source project and thus depends on it users for new features.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Cinolt

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: [wxSmith] How to add Tree Control items?
« Reply #6 on: August 03, 2010, 11:16:08 pm »
Unfortunately that's beyond my capability, else I would have done it. I'd just like to know what was going in the mind of the person who decided to name an empty box "wxTreeCtrl". I just want to verify; the two are interchangeable in the current state am I right? What discrepancy exists between an empty white box and "wxTreeCtrl"?

As a hopefully final word, this is beyond inane. You can say I'm ignorant, but if the developers are competent enough to make a working dialog specifically for editing menu items, how hard is it to design a very similar one for wxTreeCtrl? Now I'm off to learn how to implement this GUI-specific attribute in code, which is totally counter-productive in relation to what could/should have been.
« Last Edit: August 03, 2010, 11:29:19 pm by Cinolt »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12085
    • Travis build status
Re: [wxSmith] How to add Tree Control items?
« Reply #7 on: August 04, 2010, 09:41:40 am »
Unfortunately that's beyond my capability, else I would have done it. I'd just like to know what was going in the mind of the person who decided to name an empty box "wxTreeCtrl". I just want to verify; the two are interchangeable in the current state am I right? What discrepancy exists between an empty white box and "wxTreeCtrl"?

The difference is that you probably have wxTreeCtrl styles and that you can write you initialization code after the wxSmith generated block of code.

Something like (look at the docks for wxTreeCtrl):

Code: [Select]
//(*
wxsmith block
//*)

tree->AddItem(...);
tree->AddItem(...);


As a hopefully final word, this is beyond inane. You can say I'm ignorant, but if the developers are competent enough to make a working dialog specifically for editing menu items, how hard is it to design a very similar one for wxTreeCtrl? Now I'm off to learn how to implement this GUI-specific attribute in code, which is totally counter-productive in relation to what could/should have been.
Read my explanation above.
About menus: most of the time the menuitems are just text + icon. So the editor for menus is useful in 99% of the cases.
For the tree the editor will be useful in only one case (static tree + text items only) and this case is very rare.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Cinolt

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: [wxSmith] How to add Tree Control items?
« Reply #8 on: August 05, 2010, 08:48:40 am »
Can I see an example of a case where the tree control is used for a purpose other than the only usage I've seen it ever?

Offline rcoll

  • Almost regular
  • **
  • Posts: 150
Re: [wxSmith] How to add Tree Control items?
« Reply #9 on: August 05, 2010, 09:18:36 am »
This may be helpful: I created a plug-in for wxSmith to do just this, only for the "wxTreeListCtrl", which is slightly different than the "wxTree".  If you can use the wxTreeListCtrl, thry these:


http://prdownload.berlios.de/ringowidgets/TreeListCtrl_Compiled_MSW.zip

http://prdownload.berlios.de/ringowidgets/TreeListCtrl_Source_Only.zip

You may have to re-compile the source for your specific installation, but all the instructions are included, and is pretty simple.

Cheers,
Ringo

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12085
    • Travis build status
Re: [wxSmith] How to add Tree Control items?
« Reply #10 on: August 05, 2010, 09:26:52 am »
Can I see an example of a case where the tree control is used for a purpose other than the only usage I've seen it ever?
The tree control in the project manager. The tree control in the symbols browser. The tree control in windows explorer.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Cinolt

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: [wxSmith] How to add Tree Control items?
« Reply #11 on: August 05, 2010, 09:32:16 am »
Can I see an example of a case where the tree control is used for a purpose other than the only usage I've seen it ever?
The tree control in the project manager. The tree control in the symbols browser. The tree control in windows explorer.

Yeah, those are examples of tree controls that I'm talking about (they have text, btw). I even gave a link to a picture of the project manager.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12085
    • Travis build status
Re: [wxSmith] How to add Tree Control items?
« Reply #12 on: August 05, 2010, 10:22:57 am »
Yeah, those are examples of tree controls that I'm talking about (they have text, btw). I even gave a link to a picture of the project manager.
All those tree controls are filled dynamically, using code, not a wizard or GUI editor.
How could they be examples of the case you want?

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]