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:

Post by Jorg »

Now this is very interesting that you bring it up.

I was thinking to merge wxFoldPanelBar and wxTreeMultiCtrl. Both do similar things, they have a collapse / expand mechanism. The wxTreeMultiCtrl is more mature, and I could swap the caption for a wxCaptionBar so that the caption is custom drawn like shown on the picture.

This will get rid of the problem the wxFoldPanelBar has with the captions falling off the screen, however I think I cannot emulate the captions being stuck to the bottom of the screen.

Funny how things hang around in your head and others kind of think of the same thing.

- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg »

Hi Guys!

I am working on a XML -> wxTreeMultiCtrl translation. This is the first step in making e.g. wxWidgets project creation wizards. You can create an XML file, it will be translated to questions and options. After checking for valid combinations, etc. The back end will generate the code. This will be a seperate project next to wxTreeMultiCtrl. However this XML generation back end will be useful for a lot of other purposes as well (not only generation).

For example this is an XML fragment:

Code: Select all

<wizard>
  <category caption="Please enter your personal experience" >
    <check id="LIKEITORNOT" caption="Do you like this?" />
  </category>
  <category caption="And now for some other fun">
    <category caption="Project settings">
      <check id="INCLUDE_SETTINGS" caption="Include a wxConfig code fragment" />
      <check id="INCLUDE_ABOUT" caption="Include an about dialog" default="1"/>
      <check id="USE_XRC" caption="Setup an XRC fragment for XRC dialogs" />
    </category>
    <check id="CB_ONLY" caption="Only checkboxes right now ;-)" />
  </category>
</wizard>
and the pic will look like this:
Image

As you can see this can become very handy for project generation, code generation, etc. I am still thinking about code readback and addition of code fragments AFTER code is generated..

Ok, small addition to this post. This is the discussion I was referring to:

http://forums.wxwidgets.org/viewtopic.php?p=15193#15193

The idea is that the XML syntax will provide a generic configuration front end which will be semi automatic, for example it will auto check if checked conditions do not conflict, or auto select other options.

Then I will start the generation tool that will utilize the given values, and generate code or project files from templates.

Regards,
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
ssigala
Earned some good credits
Earned some good credits
Posts: 109
Joined: Fri Sep 03, 2004 9:30 am
Location: Brescia, Italy

Post by ssigala »

Neat work Jorg! :)
Sandro Sigala - Kynosoft, Brescia
Sami Hamlaoui
In need of some credit
In need of some credit
Posts: 6
Joined: Mon Jul 11, 2005 1:35 pm

Post by Sami Hamlaoui »

:shock: :shock: :shock:

downloading now...

Any chance of getting this integrated into wxDesigner?
Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg »

Thanks ssigala!

I am going to do some more coding on it later. It is now set up to work with TinyXML (I have problems with LibXML2 and franchesco has not responded to my problem).

When this is finished I believe it can be a very good start for IDE's that want to generate a start project for the user.

To Sami Hamlaoui,

I think wxDesigner supports this by using a foreign control. Simply add a foreign control to your form, and fill in the creation code in the properties. That is how I managed to add a HTML window and the likes.

- 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 »

but how about retrieving XML back with user answers and choises?
ps: or its offtopic? sorry
Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg »

Hi!

You mean filling it in with a predefined answer file? That will be in the next version as well. This is my goal:

- Translate the XML contents to the wxTreeMultiCtrl, where I will show all common controls such as edit ctrl, list, radio, etc.
- The user will fill in the needed questions for e.g. project generation
- The XML code also contains dynamic constraints and features for example when the user selects it wants a predefined wxConfig fragment, two more options arise which ask him the vendor name of the app, and the base class for the config (for example). The constraints will also take care of setting other options dynamically or deny empty fields.
- When done, a hash map is generated with all ID's in it and the value associated with it.
- The hashmap can be written back to disk, in XML or INI format so that old answers or predefined answers can be loaded or used.

Is that what you mean? This all will be in the next version of wxTreeMultiCtrl it is now hosted at wxCode by the way, where I upload my changes in CVS.

My personal goal then will be creating such a code / project generator but the XML back end for the control is generic, to be used by others for in their applications.

- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
schmallaria
Earned a small fee
Earned a small fee
Posts: 24
Joined: Fri Aug 19, 2005 9:54 am

Post by schmallaria »

hello,

when i use the control i get the following assertion error

assert "GetChildren().GetCount() == 0" failed: children not destroyed

i get the error in the constructor of my frame

here is the code i use

Code: Select all

MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, HWND hWnd, const wxString& start)
: wxFrame((wxFrame *)NULL, wxID_ANY, title, pos, size, wxDEFAULT_FRAME_STYLE)
{
	_tmc = new wxTreeMultiCtrl(this, -1);

	_tmc->SetBackgroundColour(*wxWHITE);

#ifndef LINUX
	wxTreeMultiWindowInfo wndinfo(wxTMC_BG_ADJUST_CNT, 8, 0);
#else
	wxTreeMultiWindowInfo wndinfo(wxTMC_BG_ADJUST_ALL, 8, 0);
#endif

	wxTreeMultiItem item = _tmc->AddRoot(_T("Some fun collapse stuff"), _T("COLLAPSE"));
}
the frame is called out of a dll. and the lib was complied with bakefile. the sample works without any problems.

can anyone help me?
Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg »

Then I guess the destructor of your frame is not properly called. Have you tried calling destroy yourself ? I unfortunately have no experience with DLL exporting and it is interesting to see what happens when I put it in a DLL.

By the way the latest code is at wxCode now. You can checkout the latest code from CVS there.

Let me know how this problem develops, I doubt it is related to my code as it is a simple wxScrolledWindow with some child controls, I only layout them a bit.

- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
schmallaria
Earned a small fee
Earned a small fee
Posts: 24
Joined: Fri Aug 19, 2005 9:54 am

Post by schmallaria »

the error occurs in the creation process of the frame in line 291 of src/common/wincmn.cpp

the constructor of my frame try to create the multictrl and the comes the error message.
Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg »

A simple test to see what might wrong, is creating a wxScrolledWindow instead of wxTreeMultiCtrl and add a few controls to it, eg the parent parameter is the wxScrolledWindow. Then see if the destruction still fails. If it does it is a cleanup problem (most likely).

As temp solution I can only offer you to statically link the wxTreeMultiCtrl. I have a lot of work next to this so I cannot look into the DLL solution in short time it see if it is something I can fix or otherwise related to a destroy problem.

Regards,
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
Vexator
I live to help wx-kind
I live to help wx-kind
Posts: 187
Joined: Sun Jan 30, 2005 2:50 pm
Location: Heidelberg, Germany

Post by Vexator »

i just downloaded the source code, but the changelog says it is version 1.07, not 1.08. did i download the wrong zip?

btw what i don't like so far is that you can only have one control per line.. it'd be better if i could set the position of the controls myself.. :/
Windows 7 Pro
Visual Studio 2010
wxWidgets 2.9.3
Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg »

You are totally right. This version is the older one. I will soon release v1.09 which also has a SPAN feature that will allow you to add controls that are dynamically resized horizontally.

Thansk for noticing it!
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
Vexator
I live to help wx-kind
I live to help wx-kind
Posts: 187
Joined: Sun Jan 30, 2005 2:50 pm
Location: Heidelberg, Germany

Post by Vexator »

ah great
can't wait to get it :(
Windows 7 Pro
Visual Studio 2010
wxWidgets 2.9.3
Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg »

I will send you an unofficial version this evening if you are really waiting for it. Please email me at [email protected] as I am sure I do not have the time (or energy) to release it officially tonight, as I am feeling a bit ill.

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