News:

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

Main Menu

[wxSmith] How to add Tree Control items?

Started by Cinolt, August 02, 2010, 02:30:30 AM

Previous topic - Next topic

Cinolt

Hi, I'm using wxSmith and created a tree control, but is there any way I can add items to this such as text?

MortenMacFly

Quote from: Cinolt 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?
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: [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]

Cinolt

#2
Quote from: MortenMacFly on August 02, 2010, 06:55:36 AMI 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?

oBFusCATed

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!]

Cinolt

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.

oBFusCATed

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!]

Cinolt

#6
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.

oBFusCATed

Quote from: Cinolt 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"?

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


//(*
wxsmith block
//*)

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



Quote from: Cinolt on August 03, 2010, 11:16:08 PM
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!]

Cinolt

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?

rcoll

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

oBFusCATed

Quote from: Cinolt 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?
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!]

Cinolt

Quote from: oBFusCATed on August 05, 2010, 09:26:52 AM
Quote from: Cinolt 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?
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.

oBFusCATed

Quote from: Cinolt on August 05, 2010, 09:32:16 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!]