[wx 2.8, Windows XP, VC++.NET] wxScrolledWindow layout problem

Xavier Planes xavier.planes at upf.edu
Wed May 14 00:24:19 PDT 2008


Hi,

	I created a wxApp application and I have a resizing layout problem
when
	I insert controls using proportion > 0.

	In the code bellow, if I change the wxScrolledWindow to wxPanel, it 
	works. But if I use wxScrolledWindow, the controls with proportion >
0 
	are not fitted inside the parent window. Do you know what could be
the 
	layout problem?

	This is the code of the application:

int wxMitkScrolledWindow::OnRun(void)
{

      wxFrame* mainWindow = new wxFrame(NULL, wxID_ANY, wxT("wxMitk test"));
      wxPanel* panel = new wxScrolledWindow(mainWindow, wxID_ANY);

      wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
      wxBoxSizer* sizer_horiz = new wxBoxSizer(wxHORIZONTAL);
      wxStaticText* lbOutputImage = 
		  new wxStaticText(panel, wxID_ANY, wxT("Output file
name"));
      wxTextCtrl* leOutputImage = 
		  new wxTextCtrl(panel, wxID_ANY, wxT("Output file name"));
      sizer_horiz->Add(lbOutputImage, 1, wxEXPAND);
      sizer_horiz->Add(leOutputImage, 6, wxEXPAND);
      topsizer->Add(sizer_horiz, 0, wxEXPAND);

      panel->SetSizer(topsizer);
      topsizer->SetSizeHints( panel );   // set size hints to honour minimum
size

      mainWindow->Show(true);

      wxApp::OnRun();

      return 0;
}

Thanks!
Xavi



More information about the wx-users mailing list