Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: samsam598 on August 12, 2009, 11:43:52 am

Title: invalid use of undefined type `struct wxRadioBox'|
Post by: samsam598 on August 12, 2009, 11:43:52 am
Greeting to everybody!

I am using C::B + wxSmith to learn wxWidgets programming.I met a problem that wxRadioBox does not work properly,or wxSmith does not generate xrc file properly,I don't know anyway...

Some background:
** wxWidgets 2.9rc6+MinGW3.4.5 +C::B nightly build5716 under Windows XP
** Using wxSmith to design a wxDialog (MyDialog),put a wxRadionBox on it,ID:ID_RADIOBOX1, var name:rbChoice;
** Within rbChoice added 2 choices :Classic | Extra;
** Added a button on the dialog to test .

Code

MyDialog:MyDialog(wxWindow* parent)
{
//(*Initialize(MyDialog)
wxXmlResource::Get()->LoadObject(this,parent,_T("MyDialog"),_T("wxDialog"));

//some other controls...

Button1 = (wxButton*)FindWindow(XRCID("ID_BUTTON1"));
rdChoice = (wxRadioBox*)FindWindow(XRCID("ID_RADIOBOX1"));


Connect(XRCID("ID_BUTTON1"),wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&DForm::OnTestButtonClick);
}

void MyDialog::OnTestButtonClick(wxCommandEvent& event)
{
    int choice= rbChoice->GetSelection();
    switch( choice)
{
    case 0:
     wxMessageBox(_T("Classic"));
    break;
   case 1:
    wxMessageBox(_R("Extra"));
    break;

}

When I compile under C::B,got below errors:

F:\CodeBlocksProject\usesqliteApp\DForm.cpp|393|error: invalid use of undefined type `struct wxRadioBox'|
E:\wxWidget30\include\wx\msw\window.h|34|error: forward declaration of `struct wxRadioBox'|

I don't know why,but I tested under wxDev-Cpp almost the same stuff.it is OK.

Could anybody here figure me out what's going one here?
Thanks in advance.

Best Regards,
Sam
Title: Re: invalid use of undefined type `struct wxRadioBox'|
Post by: oBFusCATed on August 12, 2009, 12:47:15 pm
Do you have the include for the wxRadioBox class?

See here http://docs.wxwidgets.org/stable/wx_wxradiobox.html what do you need (you show check the docs for your version of wx thought)
Title: Re: invalid use of undefined type `struct wxRadioBox'|
Post by: samsam598 on August 13, 2009, 04:14:07 am
Do you have the include for the wxRadioBox class?

See here http://docs.wxwidgets.org/stable/wx_wxradiobox.html what do you need (you show check the docs for your version of wx thought)

Yes.I did.I re-implemented the UI by changing not to  generate xrc file this time and the problem is solved temporarily.

Thanks and regards,
Sam