wx.NET different from original wxwindows

"Vincent RICHOMME" <[email protected]> Sun, 29 Aug 2004 20:18:58 +0200
Newsgroups gmane.comp.lib.wxwindows.wxnet
Message-ID <[email protected]>
Hi!,

I would like to create a frame with a ruler at the bottom and to do so here
is the C++ code I use:

MyFrame::MyFrame(wxWindow* parent, int id, const wxString& title, const
wxPoint& pos, const wxSize& size, long style):
    wxFrame(parent, id, title, pos, size, wxDEFAULT_FRAME_STYLE)
{
     // declare variables
     //... Create menus and toolbar
 
	spacerPanel = new wxPanel(this, -1);
    	spacerPanel->SetBackgroundColour(wxColour(128, 128, 128));

	rulerPanel = new wxPanel(this, -1);
	rulerPanel->SetSize(wxSize(100, 30));
    
	wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
    	sizer->Add(spacerPanel, 1, wxEXPAND|wxALL, 2);
	sizer->Add(rulerPanel, 0, wxEXPAND|wxALL, 2);
    	SetAutoLayout(true);
    	SetSizer(sizer);
    	Layout();
}
And it works, I mean when I resize the frame the ruler stays at the bottom.

Now when I try the same thing but with wx.NET :

public MainFrame(Size size)
			: base(null, -1, "LetItBurn!",wxDefaultPosition,
size, wxDEFAULT_FRAME_STYLE)
{
     // declare variables
     //... Create menus and toolbar

	spacerPanel = new Panel(this, -1);
	spacerPanel.BackgroundColour = new Colour( 128, 128, 128 );
	
	rulerPanel = new Panel(this,-1);
	rulerPanel.SetSize(200, 30);

	sizer = new BoxSizer(Orientation.wxVERTICAL);
	sizer.Add(spacerPanel, 1, Stretch.wxEXPAND|Direction.wxALL,2);
	sizer.Add(rulerPanel, 0, Stretch.wxEXPAND|Direction.wxALL, 0);
	AutoLayout = true;
	SetSizer(sizer);
	Layout();
}

It doesn't behave the same???
When I resize the frame the ruler (panel) stay to its place and is not
resized.
Why ?




-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click