Author Topic: includes and declarations disappear or double  (Read 3613 times)

Offline szurilo

  • Multiple posting newcomer
  • *
  • Posts: 37
includes and declarations disappear or double
« on: February 05, 2008, 10:13:45 am »
Hi!

I have a strange problem with CB 4821 unicode, with wxWidegts 2.8.7 under Debian.
Sometimes my variable declarations and header includes disappear or doubled in the source of my application.
I cant tell when, but after closing or saving the project it used to happens.
For example, i declare in the main header file:
wxBoxSizer* BoxSizer4;
Its ok for a while but once, suddenly CB put this row inside the constructor of my main wxDialog window.
Or i declare this:
wxChoice** Chn_Choice0;
and this:
#include <wx/choice.h>
and after some running the include disappear and i get errors.
Why is that? Thx.

Szurilo

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: includes and declarations disappear or double
« Reply #1 on: February 05, 2008, 10:41:08 am »
Hi !

Did you put your code in a part that is managed by a graphical interface designer (wxSmith, wxGlade) ?

Dje

Offline szurilo

  • Multiple posting newcomer
  • *
  • Posts: 37
Re: includes and declarations disappear or double
« Reply #2 on: February 05, 2008, 11:18:16 am »
Well i think you mean this part:
//(*Headers(SRC_SRM_apiDialog)
#include <wx/sizer.h>
#include <wx/stattext.h>
//*)
My answer is no. I always put my code other places to separate what i and what the compiler/linker do.
Anyway where can i read about these automatic things that wxSmith doing?

Szurilo

Offline szurilo

  • Multiple posting newcomer
  • *
  • Posts: 37
Re: includes and declarations disappear or double
« Reply #3 on: February 05, 2008, 03:16:11 pm »
I noticed, declarations appear in the constructor of the main wxDialog window if i save my wxSmith *.wxs file.
This, of course, leads to errors, in this case a segmentation fault.

Szurilo

Offline wobien

  • Multiple posting newcomer
  • *
  • Posts: 69
Re: includes and declarations disappear or double
« Reply #4 on: February 05, 2008, 04:02:07 pm »
For example, i declare in the main header file:
wxBoxSizer* BoxSizer4;
I noticed, declarations appear in the constructor of the main wxDialog window if i save my wxSmith *.wxs file.
If you use wxSmith you must not declare the objects in wxSmith yourself, wxSmith will do it for you.
If you specify the object as a member (in the properties window of wxSmith) it will be declared in the headerfile of your main window, otherwise in the  constructor of the main window.
When you edit or save the wxs file wxSmith will update the associated header and implementation files.