Page 1 of 1

All Controls on top of each other, at top left

Posted: Sat Mar 16, 2013 7:51 am
by softport
Hello, I hope this won't involve a re-installation. When I run a program in the IDE, or the executable, all the controls are piled on top of each other and moved to the top left corner. Below is an example line from "create GUI controls". All the other controls have the position set to wxDefaultPosition as well.

I have tried closing and reopening the project and starting a new project. The same thing happens.

WxButton1 = new wxButton(this, ID_WXBUTTON1, _("WxButton1"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _("WxButton1"));

Thanks!

Re: All Controls piled on top of each other at top left

Posted: Sat Mar 16, 2013 9:19 pm
by catalin

Re: All Controls piled on top of each other at top left

Posted: Sun Mar 17, 2013 4:24 am
by softport
Thanks you catalin, for a second I thought that might be it. The last thing I was doing was playing with sizers, then deleted them all. Maybe some were some left in the CreateGUIControls() section. No such luck.

I have restarted my program with Visual Studio 2008, and am not enjoying it.

Code: Select all

void HIDAPI_McLBox2Frm::CreateGUIControls()
{
	//Do not add custom code between
	//GUI Items Creation Start and GUI Items Creation End
	//wxDev-C++ designer will remove them.
	//Add the custom code before or after the blocks
	////GUI Items Creation Start

	WxButton1 = new wxButton(this, ID_WXBUTTON1, _("WxButton1"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _("WxButton1"));

	WxEdit3 = new wxTextCtrl(this, ID_WXEDIT3, _("WxEdit3"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _("WxEdit3"));

	WxEdit2 = new wxTextCtrl(this, ID_WXEDIT2, _("WxEdit2"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _("WxEdit2"));

	WxEdit1 = new wxTextCtrl(this, ID_WXEDIT1, _("WxEdit1"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _("WxEdit1"));

	SetTitle(_("HIDAPI_McLBox2"));
	SetIcon(wxNullIcon);
	SetSize(9,0,438,221);
	Center();
	
	////GUI Items Creation End
}

Re: All Controls piled on top of each other at top left

Posted: Sun Mar 17, 2013 10:22 am
by catalin
..So use them in your code...
Almost all the GUI samples that come with wxW use sizers. Learn how to do it and use them yourself.

Re: All Controls piled on top of each other at top left

Posted: Sun Mar 17, 2013 10:42 am
by softport
Catalin, thank you, but using sizers is not going to solve the problem: the IDE not functioning as it should. Objects I create on the frame are not getting their positions recorded in the Create GUI controls section of the code.

Re: All Controls piled on top of each other at top left

Posted: Mon Mar 18, 2013 4:03 pm
by tbreina
Looks like it is a bug. To correct it, go to Tools->Designer Options->Code Generation Options and uncheck the boxes for "Use Default Position" and "Use Default Size". Then change something on your form to cause the code to auto-generate.

-Tony

Re: All Controls piled on top of each other at top left

Posted: Mon Mar 18, 2013 11:36 pm
by softport
Thanks Tony, that fixed it!