Fixed the wxDialogs on wx3.0.2 due to a change in behaviour with FindWindow.

This commit is contained in:
skidau 2015-04-22 13:54:27 +00:00
parent ad60e2cd67
commit 69c7f79e92
2 changed files with 6 additions and 2 deletions

View File

@ -21,7 +21,7 @@ extern "C" {
#include "../gba/agbprint.h"
#define GetXRCDialog(n) \
dynamic_cast<wxDialog*>(FindWindow(XRCID(n)))
dynamic_cast<wxDialog*>(FindWindowByName(n))
bool cmditem_lt(const struct cmditem &cmd1, const struct cmditem &cmd2)
{

View File

@ -44,7 +44,7 @@ static void mark_recursive(wxWindowBase *w)
}
#define GetXRCDialog(n) \
wxStaticCast(wxGetApp().frame->FindWindow(XRCID(n)), wxDialog)
wxStaticCast(wxGetApp().frame->FindWindowByName(n), wxDialog)
// Event handlers must be methods of wxEvtHandler-derived objects
@ -1979,9 +1979,11 @@ wxDialog * MainFrame::LoadXRCDialog(const char * name)
/* wx-2.9.1 doesn't set parent for propertysheetdialogs for some reason */
/* this will generate a gtk warning but it is necessary for later */
/* retrieval using FindWindow() */
#if (wxMAJOR_VERSION < 3)
if(!dialog->GetParent())
dialog->Reparent(this);
mark_recursive(dialog);
#endif
return dialog;
}
@ -1996,9 +1998,11 @@ wxPropertySheetDialog * MainFrame::LoadXRCropertySheetDialog(const char * name)
/* wx-2.9.1 doesn't set parent for propertysheetdialogs for some reason */
/* this will generate a gtk warning but it is necessary for later */
/* retrieval using FindWindow() */
#if (wxMAJOR_VERSION < 3)
if(!dialog->GetParent())
dialog->Reparent(this);
mark_recursive(dialog);
#endif
return dialog;
}