[ wxwindows-Bugs-1522671 ] using wxNewId when creating XRCID's causes
id clash
SourceForge.net
noreply at sourceforge.net
Fri Jul 14 09:59:17 PDT 2006
Bugs item #1522671, was opened at 2006-07-14 13:59
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1522671&group_id=9863
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: XML resources
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Rodolfo Schulz de Lima (rodlima)
Assigned to: Vaclav Slavik (vaclavslavik)
Summary: using wxNewId when creating XRCID's causes id clash
Initial Comment:
Under certain circumstances, it may occur an id clash
in a XRC dialog containing a wxDatePickerCtrl and other
controls. This was tested in wxGTK and I think it
doesn't affect other platforms.
If you add a wxDatePickerCtrl in a XRC, when
instantiating it, it'll obviously create a real
wxDatePickerCtrl, and the xrc loader will assign its id
using wxNewId() and mapping it to its string
representation.
The problem is that internally the wxDatePickerCtrl
created uses a wxDatePopupInternal child control which
gets its (default) id by calling
wxWindowBase::NewControlId.
So, as we are using two different and overlapping (in
wxGTK) sets of ids, we may end up having two controls
with the same id (assigned by wxNewID and NewControlId)
in a dialog.
This causes problem with a class generated by wxrc. It
calls FindWindow to retrieve a control associated with
an XRCID, but gets the other control. Hence the
wxStaticCast fails with a NULL pointer assertion
because it's dealing with a control of another class
(in my case, wxDatePopupInternal).
IMO, I think it's better to use just one set of ids
throughout wxWidgets by getting rid of wxNewId and
somehow using wxWindowBase::NewControlId instead (or
the other way round).
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1522671&group_id=9863
More information about the wx-dev
mailing list