Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: marlo_nl on November 12, 2007, 08:36:45 am

Title: wxSmith: problem with wxRadioBox control
Post by: marlo_nl on November 12, 2007, 08:36:45 am
I've encountered the following issue with a wxSmith Dialog Based application:

When implementing a wxRadioBox in a Top Level wxDialog, compilation and building the application works just fine.
When implementing a wxRadioBox in a non Top Level wxDialog, the code generated by wxSmith will results in a compilation error.

After doing some tests I found that this is (most probably) caused by a missing header file declaration.

For the Top Level wxDialog the header file (DialogApp5Main.h) contains the following (auto-generated) code:

//(*Headers(DialogApp5Dialog)
#include <wx/sizer.h>
#include <wx/stattext.h>
#include <wx/radiobox.h>
#include <wx/statline.h>
#include <wx/button.h>
#include <wx/dialog.h>
//*)

For the non Top Level wxDialog, the header file (Test.h) contains the following auto-generated code:

//(*Headers(Test)
#include <wx/radiobox.h>
#include <wx/button.h>
#include <wx/dialog.h>
//*)

When compiling the non Top Level wxDialog file (Test.cpp) the following error occurs:

xxxx\DialogApp5\Test.cpp:: In constructor `Test::Test(wxWindow*, wxWindowID)':
xxxx\DialogApp5\Test.cpp:29: error: invalid use of undefined type `struct wxRadioBox'
C:\GplDevTools\wxWidgets-2.8.4\include\wx\msw\window.h:37: error: forward declaration of `struct wxRadioBox'
:: === Build finished: 2 errors, 0 warnings ===


The compilation error can be corrected by manually adding the following include file to the Test.h header file:

#include <wx/stattext.h>
//(*Headers(Test)
#include <wx/radiobox.h>
#include <wx/button.h>
#include <wx/dialog.h>
//*)


My questions are the following:
- Is this a bug in the wxSmith auto code generation?
- Although including the header file <wx/stattext.h> solves the compilation problem I’m not sure if including this header file is the right thing to do. I found that by including <wx/defs.h> (which is also included when using the <wx/stattext.h> header file) will also correct the compilation problem. What header file best to include to solve the compilation problem?



My test environment:
CodeBlocks snv 4564
Compiler mingw32-g++ (gcc) version 3.4.5
wxWidgets Library: libwxmsw28ud.a
OS: WinXP


Regards, Marlo