List Info

Thread: Error connecting event to wxChoice control in XRC loaded dialogs




Error connecting event to wxChoice control in XRC loaded dialogs
user name
2006-12-03 17:03:02

Hi!

Looks like a hole in the XRC logic of DB. You can, just to check, turn
off XRC in settings, regenerate the source files and rebuild. It
should go away. If it does, it's definitely a hole in XRC logic and
you'll need a fix from Julian.

You can turn the XRC back on and regenerate the files again to get
back to where you are, but you'll also have to remove the event
handler and code it by hand.

HTH:
Dave S.

wxMS_developers · Development with wxWidgets on MSWindows
http://tech.groups.yahoo.com/group/wxMS_developers/join

wxMS_developers RSS feed
http://rss.groups.yahoo.com/group/wxMS_developers/rss

wxWidgets Code Exchange
http://wxcodex.net/

--- In anthemion-devtools%40yahoogroups.com">anthemion-devtoolsyahoogroups.com, "motormuizen"
<motormuizen...> wrote:
&gt;
> Dear all,
>
> Could anyone give me a suggestion how to solve the following problem:
>
> - Dialog project using XRC files to load/store dialogs
&gt; - Project compiles and runs with no errors/warnings (Windows/Cygwin)
>; - I add an event handler to a wxChoice - control
&gt; - a line with "itemChoice7-&gt;Connect...." is inserted in the cpp file:
>;
>
> void ProgramOptions::CreateControls()
> {
> ////begin ProgramOptions content construction
> if (!wxXmlResource::Get()->LoadDialog(this, GetParent(),
> _T("ID_PROGRAMOPTIONS";)))
> wxLogError(wxT(";Missing wxXmlResource::Get()->Load() in
> OnInit()?&quot;));
> // Connect events and objects
&gt; itemChoice7->Connect(ID_CHOICE1, wxEVT_CREATE,
> wxWindowCreateEventHandler(ProgramOptions::OnCreate), NULL, this);
&gt; ////end ProgramOptions content construction
>
> // Create custom windows not generated automatically here.
>; ////begin ProgramOptions content initialisation
> ////end ProgramOptions content initialisation
> }
>
>
> - but this error appear when I try to compile:
>
> *** program.cpp:107: error: `itemChoice7' undeclared (first use this
> function)
> *** program.cpp:107: error: (Each undeclared identifier is reported
> only once for each function it appears in.)
> *** program.cpp:107: error: `ID_CHOICE1' undeclared (first use this
> function)
>
> - Shouldn't something be added to the EVENT_TABLE also?
>
> For example adding an event to a wxButton control in the same dialog
&gt; does NOT insert a ....->Connect(... type of line, but adds something
> like this
> EVT_BUTTON( XRCID(&quot;ID_BUTTON1"), Program::OnButton1Click )
> to the EVENT_TABLE
>
> Any ideas what is happening?
>

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )