PLEASE MY PROJECT IS STUCK

"Vincent RICHOMME" <[email protected]> Tue, 31 Aug 2004 18:40:25 +0200
Newsgroups gmane.comp.lib.wxwindows.wxnet
Message-ID <[email protected]>
Hi I have already posted a question because the same code behaves
differently between "normal" wxWidget and the wx.NET bindings.
And since I have no answer I ask again. 
I am the main developer of the open source project LetItBurn(hosted on
sourceforge) and before to start I thought that wx.NET would be a good
choice since I already have wrote some code in C++ and it worked fine.
Now when I try the porting to c# it doesn't behave the same.
If nobody can answer my question or help me I will write my project in C++
But it would be a pity because I really think wx.NET is a good toolkit and I
prefer c#.

My problem is I want to create a ruler indicating the space remaining on the
CD you want to burn. I have tried this simple thing in C++ and it works.

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();
}
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 ?


So if you have any idea or maybe a suggestion. I may use the wrong way to
proceed.

I would be very grateful to anyone who could help me.I cand send you files
in C++ and C# for you to see.

Thanks




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