missed something that caused it to not properly load the xrc interface.

This commit is contained in:
wowzaman12 2015-03-28 16:15:25 +00:00
parent 025e466bff
commit 843a90632f
1 changed files with 12 additions and 11 deletions

View File

@ -2281,7 +2281,7 @@ bool MainFrame::InitMore(void)
// just verify preview window & mag sel present // just verify preview window & mag sel present
{ {
wxPanel *prev; wxPanel *prev;
prev=SafeXRCCTRL<wxPanel>(d, "Preview"); prev=SafeXRCCTRL<wxPanel>(d, "Preview");
if(!wxDynamicCast(prev->GetParent(), wxScrolledWindow)) if(!wxDynamicCast(prev->GetParent(), wxScrolledWindow))
throw std::runtime_error("Unable to load a dialog control from the builtin xrc file: Preview"); throw std::runtime_error("Unable to load a dialog control from the builtin xrc file: Preview");
SafeXRCCTRL<wxControlWithItems>(d, "Magnification"); SafeXRCCTRL<wxControlWithItems>(d, "Magnification");
@ -2289,10 +2289,10 @@ bool MainFrame::InitMore(void)
} }
//// File menu //// File menu
LoadXRCDialog("GBAROMInfo"); d=LoadXRCDialog("GBAROMInfo");
// just verify fields present // just verify fields present
wxControl *lab; wxControl *lab;
#define getlab(n) lab=SafeXRCCTRL<wxControl>(d, n) #define getlab(n) lab=SafeXRCCTRL<wxControl>(d, n)
getlab("Title"); getlab("Title");
getlab("GameCode"); getlab("GameCode");
getlab("MakerCode"); getlab("MakerCode");
@ -2338,21 +2338,21 @@ bool MainFrame::InitMore(void)
#endif #endif
wxRadioButton *rb; wxRadioButton *rb;
#define getrbi(n, o, v) do { \ #define getrbi(n, o, v) do { \
rb=SafeXRCCTRL<wxRadioButton>(d, n); \ rb=SafeXRCCTRL<wxRadioButton>(d, n); \
rb->SetValidator(wxBoolIntValidator(&o, v)); \ rb->SetValidator(wxBoolIntValidator(&o, v)); \
} while(0) } while(0)
#define getrbb(n, o) do { \ #define getrbb(n, o) do { \
rb=SafeXRCCTRL<wxRadioButton>(d, n); \ rb=SafeXRCCTRL<wxRadioButton>(d, n); \
rb->SetValidator(wxGenericValidator(&o)); \ rb->SetValidator(wxGenericValidator(&o)); \
} while(0) } while(0)
#define getrbbr(n, o) do { \ #define getrbbr(n, o) do { \
rb=SafeXRCCTRL<wxRadioButton>(d, n); \ rb=SafeXRCCTRL<wxRadioButton>(d, n); \
rb->SetValidator(wxBoolRevValidator(&o)); \ rb->SetValidator(wxBoolRevValidator(&o)); \
} while(0) } while(0)
wxBoolEnValidator *benval; wxBoolEnValidator *benval;
wxBoolEnHandler *ben; wxBoolEnHandler *ben;
#define getbe(n, o, cv, t, wt) do { \ #define getbe(n, o, cv, t, wt) do { \
cv=SafeXRCCTRL<t>(d, n); \ cv=SafeXRCCTRL<t>(d, n); \
cv->SetValidator(wxBoolEnValidator(&o)); \ cv->SetValidator(wxBoolEnValidator(&o)); \
benval = wxStaticCast(cv->GetValidator(), wxBoolEnValidator); \ benval = wxStaticCast(cv->GetValidator(), wxBoolEnValidator); \
static wxBoolEnHandler _ben; \ static wxBoolEnHandler _ben; \
@ -2363,7 +2363,7 @@ bool MainFrame::InitMore(void)
// of checkboxes. A lot of work for little benefit. // of checkboxes. A lot of work for little benefit.
wxBoolRevEnValidator *brenval; wxBoolRevEnValidator *brenval;
#define getbre(n, o, cv, t, wt) do { \ #define getbre(n, o, cv, t, wt) do { \
cv=SafeXRCCTRL<t>(d, n); \ cv=SafeXRCCTRL<t>(d, n); \
cv->SetValidator(wxBoolRevEnValidator(&o)); \ cv->SetValidator(wxBoolRevEnValidator(&o)); \
brenval = wxStaticCast(cv->GetValidator(), wxBoolRevEnValidator); \ brenval = wxStaticCast(cv->GetValidator(), wxBoolRevEnValidator); \
wx##wt##BoolEnHandlerConnect(rb, wxID_ANY, *ben); \ wx##wt##BoolEnHandlerConnect(rb, wxID_ANY, *ben); \
@ -2391,7 +2391,7 @@ bool MainFrame::InitMore(void)
#define getrbbd(n, o) getbre(n, o, rb, wxRadioButton, RBD) #define getrbbd(n, o) getbre(n, o, rb, wxRadioButton, RBD)
wxTextCtrl *tc; wxTextCtrl *tc;
#define gettc(n, o) do { \ #define gettc(n, o) do { \
tc=SafeXRCCTRL<wxTextCtrl>(d, n); \ tc=SafeXRCCTRL<wxTextCtrl>(d, n); \
tc->SetValidator(wxTextValidator(wxFILTER_NONE, &o)); \ tc->SetValidator(wxTextValidator(wxFILTER_NONE, &o)); \
} while(0) } while(0)
#ifndef NO_LINK #ifndef NO_LINK
@ -2436,7 +2436,7 @@ bool MainFrame::InitMore(void)
cheat_list_handler.dlg = d; cheat_list_handler.dlg = d;
d->SetEscapeId(wxID_OK); d->SetEscapeId(wxID_OK);
wxCheckedListCtrl *cl; wxCheckedListCtrl *cl;
cl=SafeXRCCTRL<wxCheckedListCtrl>(d, "Cheats"); cl=SafeXRCCTRL<wxCheckedListCtrl>(d, "Cheats");
if(!cl->Init()) if(!cl->Init())
throw std::runtime_error("Unable to initialize the Cheats dialog control from the builtin xrc file!"); throw std::runtime_error("Unable to initialize the Cheats dialog control from the builtin xrc file!");
cheat_list_handler.list = cl; cheat_list_handler.list = cl;
@ -2571,7 +2571,7 @@ bool MainFrame::InitMore(void)
wxCommandEventHandler(CheatFind_t::f), \ wxCommandEventHandler(CheatFind_t::f), \
NULL, &cheat_find_handler); NULL, &cheat_find_handler);
#define cf_enbutton(n, v) do { \ #define cf_enbutton(n, v) do { \
cheat_find_handler.v=SafeXRCCTRL<wxButton>(d, n); \ cheat_find_handler.v=SafeXRCCTRL<wxButton>(d, n); \
cheat_find_handler.v->Disable(); \ cheat_find_handler.v->Disable(); \
} while(0) } while(0)
cf_button("Search", Search); cf_button("Search", Search);
@ -2587,6 +2587,7 @@ bool MainFrame::InitMore(void)
d->Connect(wxEVT_COMMAND_LIST_ITEM_SELECTED, d->Connect(wxEVT_COMMAND_LIST_ITEM_SELECTED,
wxListEventHandler(CheatFind_t::Select), wxListEventHandler(CheatFind_t::Select),
NULL, &cheat_find_handler); NULL, &cheat_find_handler);
d->Fit();
} }
d=LoadXRCDialog("CheatAdd"); d=LoadXRCDialog("CheatAdd");