Problem with wxTreeMultiCtrl and Sizer Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Sickboy
Experienced Solver
Experienced Solver
Posts: 91
Joined: Wed Mar 16, 2005 10:30 pm
Location: Germany

Problem with wxTreeMultiCtrl and Sizer

Post by Sickboy »

Following code works fine in a dialog:

Code: Select all

	wxDialog dlg(this,-1,wxT("dlgTest"),wxDefaultPosition,wxDefaultSize);
	wxStaticBox *pBox			= new wxStaticBox(&dlg,-1,wxT("StaticBox"),wxPoint(10,10),wxSize(200,300));
	wxStaticBoxSizer* pStatic	= new wxStaticBoxSizer	(pBox,wxHORIZONTAL);
	wxButton* nB = new wxButton(&dlg,-1,wxT("Button1"));
	wxButton* nB2 = new wxButton(&dlg,-1,wxT("Button2"));
	pStatic->Add(nB,1,  wxFIXED_MINSIZE, 5);
	pStatic->Add(nB2,1, wxALL|wxFIXED_MINSIZE, 5);
	dlg.SetSizer(pStatic);
	pStatic->SetSizeHints(&dlg);
	dlg.ShowModal();
if i put it in a window and put this window inside the wxTreeMultiCtrl the wxStaticBoxSizer doesn't work anymore :(

Window code:

Code: Select all

wxStaticBox *pBox			= new wxStaticBox(this,-1,wxT("StaticBox"),wxPoint(10,10),wxSize(200,300));
	wxStaticBoxSizer* pStatic	= new wxStaticBoxSizer	(pBox,wxHORIZONTAL);
	wxButton* nB				= new wxButton (this,-1,wxT("Button1"));
	wxButton* nB2				= new wxButton(this,-1,wxT("Button2"));
	pStatic->Add(nB,1,  wxFIXED_MINSIZE, 5);
	pStatic->Add(nB2,1, wxALL|wxFIXED_MINSIZE, 5);
	this->SetSizer(pStatic);
	pStatic->SetSizeHints(this);
Anyone see what i'm missing ??

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

Post by Jorg »

The current ( v1.08 ) wxTreeMultiCtrl does not size the window, so you have to size it yourself before adding.

In my new version I added a feature called "spanning" which will dynamically resize the appended window when the wxTreeMultiCtrl window is resized. I tested this with a horizontal sizer containing a button and a text ctrl, and it seems to work fine. There is no vertical sizing though, only horizontal.

send me a private email at jorgb [@] xs4all.nl and I will send you the latest source tonight (approx 4 hours from now) ..

I will have to check it in the wxCode also, for other people.. I am working on it heavily to write an XML wrapper that allow people to write a wizard like interface.

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