Author Topic: wxSmith - problem adding a custom wxPanel into a wxSplitterWindow  (Read 4051 times)

Offline surfinbird

  • Single posting newcomer
  • *
  • Posts: 8
Hi,

I have created a project using wxSmith, but have a problem getting it compiled.
This is what I do:

I have made a wxWidgets project using the wxWidgets project wizard. I've customised it this way:
- wxWidgets 2.8.x
- wxSmith gui builder & frame based application type
- MSVC++ 2008 (Express Edition)
- wxWidgets built as a monolithic library
After the wizard has done its job, the project compiles.

Next, using wxSmith, I have added:
- a new wxPanel (using the wxSmith->Add wxPanel menu); I've given it the name TestPanel
   (Note: this causes Code:Blocks to crash occasionaly)
- a wxSplitterWindow to the default wxFrame
- a wxPanel control to the wxSplitterWindow, in the properties I've renamed the class name from wxPanel to TestPanel

My first compile attempt gave me this error:
wxWidgetsTestMain.h, line 44: error C2143: syntax error : missing ';' before '*'
wxWidgetsTestMain.h, line 44: error C4430: missing type specifier - int assumed. Note: C++ does not support default-int


I could get around this by adding "#include "TestPanel.h" to the wxWidgetsTestMain.h file
Next compile gave me:
wxWidgetTestMain.cpp, line 69: error C2661: 'TestPanel:TestPanel' : no overloaded function takes 6 arguments.

wxSmith generated source code for the TestPanel with a constructor that takes 4 arguments, but the wxWidgetsTestFrame tries
to instantiate a TestPanel using 6 arguments. When I comment out the last two arguments I finaly got the project compiled.

However, each time a change is made to the wxFrame, wxSmith regenerates the source code and hence the 4/6 argument problem.
I have attached the project as reference.

Can anybody tell me if this is a program flaw or just a bad way of me using wxSmith?
Is it possible to tweak the wxSmith source generation in such a way that it doesn't erase my modifications?

[attachment deleted by admin]

Offline surfinbird

  • Single posting newcomer
  • *
  • Posts: 8
Re: wxSmith - problem adding a custom wxPanel into a wxSplitterWindow
« Reply #1 on: January 20, 2008, 11:36:16 pm »
I forgot to mention that I'm using Code::Blocks build SVN4830 ...

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: wxSmith - problem adding a custom wxPanel into a wxSplitterWindow
« Reply #2 on: January 21, 2008, 12:19:44 pm »
Read this post: http://forums.codeblocks.org/index.php/topic,7541.msg57045.html#msg57045

I've described there how to use custom panels like standard wxPanel classes.


Regards
   BYO

Offline surfinbird

  • Single posting newcomer
  • *
  • Posts: 8
Re: wxSmith - problem adding a custom wxPanel into a wxSplitterWindow
« Reply #3 on: January 21, 2008, 03:09:49 pm »
Thanks for the link BYO