Latest wxTreeMultiCtrl Code

If you have a cool piece of software to share, but you are not hosting it officially yet, please dump it in here. If you have code snippets that are useful, please donate!
Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Latest wxTreeMultiCtrl Code

Post by Jorg » Sun Jun 19, 2005 10:22 am

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: http://wastebucket.solidsteel.nl

Here is a latest preview pic:
Image

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.

Regards,
- Jorgen
Last edited by Jorg on Tue Jan 03, 2006 10:54 pm, edited 2 times in total.
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb

User avatar
Ryan Norton
Moderator
Moderator
Posts: 1319
Joined: Mon Aug 30, 2004 6:01 pm

Re: Latest wxTreeMultiCtrl Code

Post by Ryan Norton » Sun Jun 26, 2005 6:34 am

Jorg wrote: Image
Wow.... that's pretty neat. Admittedly I'm not sure in what instance you'd use it though.
[Mostly retired moderator, still check in to clean up some stuff]

Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg » Sun Jun 26, 2005 7:38 am

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
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb

Tyler
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 246
Joined: Fri Sep 03, 2004 12:37 am
Contact:

Post by Tyler » Sun Jun 26, 2005 12:46 pm

This is one of the coolest controls ever Jorgen. Thanks for your hard work.

-Tyler

lowjoel
Moderator
Moderator
Posts: 1511
Joined: Sun Jun 19, 2005 11:37 am
Location: Singapore
Contact:

Post by lowjoel » Sun Jun 26, 2005 12:57 pm

aye now i can have firefox style config options ;)

Vaulter
Earned a small fee
Earned a small fee
Posts: 19
Joined: Thu Jun 30, 2005 7:49 am
Location: Russia
Contact:

Post by Vaulter » Wed Jul 20, 2005 9:06 am

it's really useful control but! it dont work in wxWidgets 2.6.1
are there some alternative for it?

Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg » Wed Jul 20, 2005 9:50 am

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?

Regards,
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb

Vaulter
Earned a small fee
Earned a small fee
Posts: 19
Joined: Thu Jun 30, 2005 7:49 am
Location: Russia
Contact:

Post by Vaulter » Wed Jul 20, 2005 10:36 am

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 );
mainsizer->Add(bsizer);
OD->SetSizer(mainsizer);
OD->ShowModal();
}
it's compiled and linked fine.
after program started, i press "options" button (invoke ShowOptions ) and get this:
Image
and
Image

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

i try to investigate...[/code]

Vaulter
Earned a small fee
Earned a small fee
Posts: 19
Joined: Thu Jun 30, 2005 7:49 am
Location: Russia
Contact:

Post by Vaulter » Wed Jul 20, 2005 10:43 am

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:
xpmdecod.cpp

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

Vaulter
Earned a small fee
Earned a small fee
Posts: 19
Joined: Thu Jun 30, 2005 7:49 am
Location: Russia
Contact:

Post by Vaulter » Wed Jul 20, 2005 10:49 am

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
F:\wxWidgets-2.6.1\lib\vc_lib\treemultictrl.lib
?

Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg » Wed Jul 20, 2005 11:22 am

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.

Regards,
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb

Vaulter
Earned a small fee
Earned a small fee
Posts: 19
Joined: Thu Jun 30, 2005 7:49 am
Location: Russia
Contact:

Post by Vaulter » Wed Jul 20, 2005 11:37 am

so, i compiled multictrltest.exe
in Debug mode
and just after start of it get:
Image
Image

Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg » Wed Jul 20, 2005 12:10 pm

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?

Thanks!
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb

Vaulter
Earned a small fee
Earned a small fee
Posts: 19
Joined: Thu Jun 30, 2005 7:49 am
Location: Russia
Contact:

Post by Vaulter » Fri Jul 22, 2005 6:40 am

its now works fine, but under compiling through Bakefile (not CMake!), so
Jorg wrote:So it must have been a mistake by CMake then ;-)

daddydave
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 214
Joined: Wed Jun 15, 2005 3:31 am
Location: United States
Contact:

Post by daddydave » Tue Aug 02, 2005 11:43 pm

As for what to use it for, it looks like it could be used to make an Windows XP/Office XP style task pane:

http://www.gcflearnfree.org/Tutorials/M ... 603&page=2

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

Post Reply