wxStaticBox causing Weird Problems in wxMAC 2.6.1 Topic is solved

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
cd_hodges
Earned some good credits
Earned some good credits
Posts: 145
Joined: Thu Feb 03, 2005 4:46 pm

wxStaticBox causing Weird Problems in wxMAC 2.6.1

Post by cd_hodges » Fri Aug 12, 2005 2:31 pm

I have just discovered and interesting "BUG"? in the wxMac port of wxWidgets. If I create a panel that contains buttons, or comboboxes and I put a wxStaticBox around them they are completely disabled. Here's an example:

Code: Select all

	_addrPanelPrimary = new wxPanel(_addressPanel, ID__ADDRPANELPRIMARY, wxPoint(2,2), wxSize(290,115),wxTAB_TRAVERSAL);
	_addressSizer->Add(_addrPanelPrimary,1,wxALIGN_CENTER_VERTICAL | wxALL,5);

	WxStaticText3 = new wxStaticText(_addrPanelPrimary, ID_WXSTATICTEXT3, wxT("Address"), wxPoint(7,21), wxSize(42,17), 0, wxT("WxStaticText3"));

	WxStaticText5 = new wxStaticText(_addrPanelPrimary, ID_WXSTATICTEXT5, wxT("Address"), wxPoint(7,44), wxSize(42,17), 0, wxT("WxStaticText5"));

	WxStaticText6 = new wxStaticText(_addrPanelPrimary, ID_WXSTATICTEXT6, wxT("City/State"), wxPoint(7,67), wxSize(51,17), 0, wxT("WxStaticText6"));

	_addrPrimary = new wxTextCtrl(_addrPanelPrimary, ID__ADDRRPRIMARY, wxT(""), wxPoint(59,17), wxSize(215,19), 0, wxDefaultValidator, wxT("_addrrPrimary"));

	_addrPrimary2 = new wxTextCtrl(_addrPanelPrimary, ID__ADDRPRIMARY2, wxT(""), wxPoint(59,40), wxSize(215,19), 0, wxDefaultValidator, wxT("_addrPrimary2"));

	_cityPrimary = new wxTextCtrl(_addrPanelPrimary, ID__ADDRPRIMARYCITY, wxT(""), wxPoint(59,63), wxSize(121,19), 0, wxDefaultValidator, wxT("_cityPrimary"));

	WxStaticText7 = new wxStaticText(_addrPanelPrimary, ID_WXSTATICTEXT7, wxT("Zip"), wxPoint(7,90), wxSize(19,17), 0, wxT("WxStaticText7"));

	_statePrimary = new wxComboBox(_addrPanelPrimary, ID__STATEPRIMARY, wxT(""),wxPoint(186,63), wxSize(50,25),0,NULL,wxCB_SORT);
     populateStateList((wxControlWithItems*)_statePrimary);

	_zipPrimary = new wxTextCtrl(_addrPanelPrimary, ID__ZIPPRIMARY, wxT(""), wxPoint(59,86), wxSize(70,19), 0, wxTextValidator(wxFILTER_NUMERIC), wxT("_zipPrimary"));
	_zipPrimary->SetMaxLength(10);

	WxStaticBox1 = new wxStaticBox(_addrPanelPrimary, ID_WXSTATICBOX1, "Primary Address", wxPoint(0,0), wxSize(290,115));
Now you'll notice that when I create the combobox I call a utility function "populateStateList" that fills the combobox with a list of U.S. states. And when I try to click on the combobox buttons nothing happens. Under Windows with the same code the combobox works normally.

Anyone else seen anything like this? Is this a bug and is there a workaround?

I'm using wxMAC 2.6.1, XCode 2.1 and GCC 4.0

thanks,

Christopher Hodges

KevinHock
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 236
Joined: Sat Sep 04, 2004 1:49 pm
Location: Ohio, USA
Contact:

Post by KevinHock » Fri Aug 12, 2005 4:14 pm

You need to create the static box before all of the controls you want to have inside it. You would then create a wxStaticBoxSizer and use the wxStaticBox as its parent.

Again here, like in the other thread, it appears you are using absolute positioning and sizing, which are likely to give sub-optimal results and will not work in a cross-platform way. You would serve yourself well to spend a little time learning sizers. You can also use any number of GUI builders (like DialogBlocks or wxDesigner or others) to do all the hard work for you.

Sizers information is available in the online documentation, or there is also a good sizers chapter in the new wxWidgets book.

cd_hodges
Earned some good credits
Earned some good credits
Posts: 145
Joined: Thu Feb 03, 2005 4:46 pm

Post by cd_hodges » Fri Aug 12, 2005 6:58 pm

Once again thanks for your help.

chris

daddydave
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 214
Joined: Wed Jun 15, 2005 3:31 am
Location: United States
Contact:

Post by daddydave » Fri Aug 12, 2005 7:24 pm

cd, I think you meant to Accept Kevin's answer instead of your own!

KevinHock
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 236
Joined: Sat Sep 04, 2004 1:49 pm
Location: Ohio, USA
Contact:

Post by KevinHock » Sat Aug 13, 2005 5:24 am

Yes, that would be very appreciated. :) Moderator?

lowjoel
Moderator
Moderator
Posts: 1511
Joined: Sun Jun 19, 2005 11:37 am
Location: Singapore
Contact:

Post by lowjoel » Sat Aug 13, 2005 6:56 am

sorry kevin but i have to disappoint you... sigh... apparently you might like to submit this as a feature request to the wxforum bugtracker? its not implemented yet...

KevinHock
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 236
Joined: Sat Sep 04, 2004 1:49 pm
Location: Ohio, USA
Contact:

Post by KevinHock » Sat Aug 13, 2005 1:13 pm

What, no manual manipulation of the database? 8) Anyway, yes, this would definitely be good since I'm shorted 9 points and I'm sure it's bound to happen again that someone will accept the wrong answer by mistake. I'll enter it...

Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg » Sat Aug 13, 2005 1:18 pm

It is fixed. We have an UNACCEPT button for that ;-) and now the kudos for his hard work are going to .... Kevin! :-)

- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb

KevinHock
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 236
Joined: Sat Sep 04, 2004 1:49 pm
Location: Ohio, USA
Contact:

Post by KevinHock » Sat Aug 13, 2005 1:19 pm

I was looking at the bugtracker and there was some indication of an "Unaccept" button -- this sounds like a way to unaccept an answerr? I'll hold off until I hear back.

KevinHock
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 236
Joined: Sat Sep 04, 2004 1:49 pm
Location: Ohio, USA
Contact:

Post by KevinHock » Sat Aug 13, 2005 1:39 pm

OK, great, thanks! I PMed upcase about another thread since he did some wxAwards manipulation for me last time there was a mistake, but the other thread by cd_hodges in this forum had the same problem. 8)

Post Reply