All Controls on top of each other, at top left Topic is solved

If you are using wxDev-C++ for your wxWidgets design, please ask your questions here instead of in IDE Related.
Post Reply
softport
Experienced Solver
Experienced Solver
Posts: 61
Joined: Sat Jan 28, 2012 3:55 pm
Location: Houston TX
Contact:

All Controls on top of each other, at top left

Post by softport » Sat Mar 16, 2013 7:51 am

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!
Last edited by softport on Tue Mar 19, 2013 1:47 am, edited 1 time in total.
Windows XP, wxDev-C++ 7.4.2.259, wxWidgets 2.8.12, MingW

catalin
Moderator
Moderator
Posts: 1526
Joined: Wed Nov 12, 2008 7:23 am
Location: Romania

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

Post by catalin » Sat Mar 16, 2013 9:19 pm


softport
Experienced Solver
Experienced Solver
Posts: 61
Joined: Sat Jan 28, 2012 3:55 pm
Location: Houston TX
Contact:

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

Post by softport » Sun Mar 17, 2013 4:24 am

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
}
Windows XP, wxDev-C++ 7.4.2.259, wxWidgets 2.8.12, MingW

catalin
Moderator
Moderator
Posts: 1526
Joined: Wed Nov 12, 2008 7:23 am
Location: Romania

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

Post by catalin » Sun Mar 17, 2013 10:22 am

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

softport
Experienced Solver
Experienced Solver
Posts: 61
Joined: Sat Jan 28, 2012 3:55 pm
Location: Houston TX
Contact:

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

Post by softport » Sun Mar 17, 2013 10:42 am

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.
Windows XP, wxDev-C++ 7.4.2.259, wxWidgets 2.8.12, MingW

tbreina
Moderator
Moderator
Posts: 1289
Joined: Thu Nov 25, 2004 7:38 pm
Location: Coronado, CA

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

Post by tbreina » Mon Mar 18, 2013 4:03 pm

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
Everybody's got something to hide except for me and my monkey.

softport
Experienced Solver
Experienced Solver
Posts: 61
Joined: Sat Jan 28, 2012 3:55 pm
Location: Houston TX
Contact:

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

Post by softport » Mon Mar 18, 2013 11:36 pm

Thanks Tony, that fixed it!
Windows XP, wxDev-C++ 7.4.2.259, wxWidgets 2.8.12, MingW

Post Reply