Page 1 of 3

Latest wxTreeMultiCtrl Code

Posted: Sun Jun 19, 2005 10:22 am
by Jorg
Hi guys, sorry for shamelessly putting my code here, I am in between sites right now, and my old wxWidgets page is going to be removed to make way for the content management system. I grew so tired of updating the HTML code on my old site that I always delayed new releases. The wxTreeMultiCtrl has reached v1.08 status a long time ago, and I didn't wanted to keep this from you guys. Here is the change log:

v1.08 changelog
- Solved a local redraw bug
- Removed extra param from GetItemState (was not needed)
- Added new Panther OSX icons thanks to David Wright
- Doxygen documentation automatically generated now. Set USE_DOXYGEN to YES in CMake to get documentation on the fly
- Used default font for DC (fix from Aron, the wxSYS_DEFAULT_GUI_FONT is now used for DC)
- Tried Bakefile for this project, but it was not very friendly yet towards user projects, so I had to use CMake again.
- I also altered the FindWxWin.CMAKE file so seperate libraries can be used instead of monolithic (should work with wx2.6.x now)
- Manifest is now properly used because of including wx.rc
- Added preliminary CheckBox view in wxTreeMultiCtrl. This means by toggling SetCheckboxView you can get checkboxes at the next items to be inserted. Set USE_CHECKBOXVIEW to YES in CMake for this or no to remove this code
- Optimized drawing and reduced the flickering of the underlying nodes drastically
- Resolved exception from bug #0000136
- Arranged the source so it matches the Contrib directory of wxWidgets

The code can be downloaded here:

Here is a latest preview pic:

As you can see it has CHECKBOX view as next feature, allowing you to enable and disable whole branches. Ofcourse this can be toggled before adding new items to only give branches that functionality.

- Jorgen

Re: Latest wxTreeMultiCtrl Code

Posted: Sun Jun 26, 2005 6:34 am
by Ryan Norton
Jorg wrote: Image
Wow.... that's pretty neat. Admittedly I'm not sure in what instance you'd use it though.

Posted: Sun Jun 26, 2005 7:38 am
by Jorg
Use for the checkboxes? Well you can imagine having a number of controls on the same level, which are disabled when you uncheck the checkboxes. For example;

[ ] Specify height [ ]
[ ] Specify width [ ]

When unckecking the checkbox, it will disable controls on that level e.g. width and height are no longer editable, this gives an extra feature by allowing "defaults" for example.

- Jorgen

Posted: Sun Jun 26, 2005 12:46 pm
by Tyler
This is one of the coolest controls ever Jorgen. Thanks for your hard work.


Posted: Sun Jun 26, 2005 12:57 pm
by lowjoel
aye now i can have firefox style config options ;)

Posted: Wed Jul 20, 2005 9:06 am
by Vaulter
it's really useful control but! it dont work in wxWidgets 2.6.1
are there some alternative for it?

Posted: Wed Jul 20, 2005 9:50 am
by Jorg
It would help if you tell me what doesn't work in wx2.6.1 before asking alternatives ;-)

I have compiled it a while ago in wx2.6.1 and I have no problems whatsoever. What problems are you encountering?

- Jorgen

Posted: Wed Jul 20, 2005 10:36 am
by Vaulter
Jorg: ok. i'll try
when i wrote this lines:

Code: Select all

void COptions :: ShowOptions(wxWindow* parent)
wxDialog* OD = new wxDialog(the_frame, -1, "Options",wxDefaultPosition,wxSize(600,400));
wxTreeMultiCtrl* opttree = new wxTreeMultiCtrl(OD,-1);
wxBoxSizer* mainsizer = new wxBoxSizer(wxVERTICAL);
wxStdDialogButtonSizer* bsizer = OD->CreateStdDialogButtonSizer(wxOK | wxCANCEL);
mainsizer->Add(opttree, 1, wxEXPAND );
it's compiled and linked fine.
after program started, i press "options" button (invoke ShowOptions ) and get this:

VC++ 7.0 show me call stack
> ntdll.dll!77f7f570()

i try to investigate...[/code]

Posted: Wed Jul 20, 2005 10:43 am
by Vaulter
i found that exception was throwed in Init() function of constructor of wxTreeMultiCtrl()
in this lines:

Code: Select all

83:	_expandBmp = new wxBitmap(expand_xpm);
exactly in xpm decoder:

Code: Select all

     *  Parse image data:

    unsigned char *img_data = img.GetData();
    wxXPMColourMap::iterator entry;
    wxXPMColourMap::iterator end = clr_tbl.end();

    for (j = 0; j < height; j++)
        for (i = 0; i < width; i++, img_data += 3)
            for (i_key = 0; i_key < chars_per_pixel; i_key++)
                key[i_key] = (wxChar)xpm_data[1 + colors_cnt + j]
                                             [chars_per_pixel * i + i_key];
            entry = clr_tbl.find(key); //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! right there or above i don't check out this exactly
wxTreeMultiCtrl i compiled under CMake...
please, Jorg, tell me what to do, to see, to tell and so on.
my ICQ 5748332 if needed.
i really need this component :)

Posted: Wed Jul 20, 2005 10:49 am
by Vaulter
i think its because not correct img_data allocation.
i use wxWidgets 2.6.1 (static. debug. nonunicode)
i see the default_expand.xpm - it ok.
one question: may it be if i compiled wxTreeMultiCtrl under:
F:\wxWidgets-2.6.1\treemultictrl\ - folder, not in wxWidgets folder itself?
after that move .h and .lib to
F:\wxWidgets-2.6.1\include\wx\treemultictrl\ and

Posted: Wed Jul 20, 2005 11:22 am
by Jorg
This is really odd. It seems that the XPM that I use is not parsed correctly? I have not encountered this problem myself. It does not matter where the control is compiled from.

Also, when you build the sample program that comes with it, does it give any problems?

You are the first to have encountered this problem with regard to the XPM bitmap, and since the wxWidgets routine seems to fail, I don't think it is a problem related to wxTreeMultiCtrl (the XPM has not changed since 2.5.0).

However at home I will evaluate this for you tonight (I am at work now) and see what can be wrong..

I do however recommend a full rebuild of wxWidgets (and clean all intermediate files) because it could be that some files are not properly compiled.

- Jorgen

Posted: Wed Jul 20, 2005 11:37 am
by Vaulter
so, i compiled multictrltest.exe
in Debug mode
and just after start of it get:

Posted: Wed Jul 20, 2005 12:10 pm
by Jorg
I have never seen so many problems related to my component. Really weird. I don't even know what the ESP thing means, I always compile my apps with zero warnings (because CMake forces VS7 to treat warnings as errors).

I will investigate this tonight, but it seems there is something wrong with the build on your machine (I still suspect a faulty wxWidgets) because I have tried the latest posted version on my machine with wx2.6.1 without any problems. Could you send me a stack trace of that last error you encountered with wxTreeMultiCtrlTest ?

Also, have you recently upgraded wx2.5.x -> wx2.6.x or wx2.6.0 to .1 ? Maybe there are old libs that are used in combination with new headers.

What do the samples do in the wxWidgets branch, do they run fine?

- Jorgen

Posted: Fri Jul 22, 2005 6:40 am
by Vaulter
its now works fine, but under compiling through Bakefile (not CMake!), so
Jorg wrote:So it must have been a mistake by CMake then ;-)

Posted: Tue Aug 02, 2005 11:43 pm
by daddydave
As for what to use it for, it looks like it could be used to make an Windows XP/Office XP style task pane: ... 603&page=2

Or think "search for files or folders" in Windows 2000 or later.