More work on trying to remove C macros

This commit is contained in:
Arthur Moore 2015-01-11 01:53:12 -05:00
parent c757fb961d
commit 14febfd022
1 changed files with 11 additions and 12 deletions

View File

@ -2595,13 +2595,12 @@ bool MainFrame::InitMore(void)
d=LoadXRCDialog("CheatEdit"); d=LoadXRCDialog("CheatEdit");
wxChoice *ch; wxChoice *ch;
#define getch(n, o) do { \ #define getch(pointer, name, validator)\
ch=vfld(d, n, wxChoice); \ ch=vfld(pointer, name, wxChoice); \
ch->SetValidator(wxGenericValidator(&o)); \ ch->SetValidator(wxGenericValidator(&validator));
} while(0)
{ {
// d->Reparent(cheat_list_handler.dlg); // broken // d->Reparent(cheat_list_handler.dlg); // broken
getch("Type", cheat_list_handler.ce_type); getch(d, "Type", cheat_list_handler.ce_type);
cheat_list_handler.ce_type_ch = ch; cheat_list_handler.ce_type_ch = ch;
gettc("Desc", cheat_list_handler.ce_desc); gettc("Desc", cheat_list_handler.ce_desc);
tc->SetMaxLength(sizeof(cheatsList[0].desc) - 1); tc->SetMaxLength(sizeof(cheatsList[0].desc) - 1);
@ -2759,7 +2758,7 @@ bool MainFrame::InitMore(void)
d=LoadXRCropertySheetDialog("GameBoyConfig"); d=LoadXRCropertySheetDialog("GameBoyConfig");
{ {
/// System and Peripherals /// System and Peripherals
getch("System", gbEmulatorType); getch(d, "System", gbEmulatorType);
// "Display borders" corresponds to 2 variables, so it is handled // "Display borders" corresponds to 2 variables, so it is handled
// in command handler. Plus making changes might require resizing // in command handler. Plus making changes might require resizing
// game area. Validation only here. // game area. Validation only here.
@ -2833,9 +2832,9 @@ bool MainFrame::InitMore(void)
d=LoadXRCropertySheetDialog("GameBoyAdvanceConfig"); d=LoadXRCropertySheetDialog("GameBoyAdvanceConfig");
{ {
/// System and peripherals /// System and peripherals
getch("SaveType", gopts.save_type); getch(d, "SaveType", gopts.save_type);
BatConfigHandler.type = ch; BatConfigHandler.type = ch;
getch("FlashSize", gopts.flash_size); getch(d, "FlashSize", gopts.flash_size);
BatConfigHandler.size = ch; BatConfigHandler.size = ch;
d->Connect(XRCID("SaveType"), wxEVT_COMMAND_CHOICE_SELECTED, d->Connect(XRCID("SaveType"), wxEVT_COMMAND_CHOICE_SELECTED,
wxCommandEventHandler(BatConfig_t::ChangeType), wxCommandEventHandler(BatConfig_t::ChangeType),
@ -2885,7 +2884,7 @@ bool MainFrame::InitMore(void)
d=LoadXRCropertySheetDialog("DisplayConfig"); d=LoadXRCropertySheetDialog("DisplayConfig");
{ {
/// On-Screen Display /// On-Screen Display
getch("SpeedIndicator", gopts.osd_speed); getch(d, "SpeedIndicator", gopts.osd_speed);
getcbb("NoStatusMsg", gopts.no_osd_status); getcbb("NoStatusMsg", gopts.no_osd_status);
getcbb("Transparent", gopts.osd_transparent); getcbb("Transparent", gopts.osd_transparent);
@ -2935,7 +2934,7 @@ bool MainFrame::InitMore(void)
cb=vfld(d, "MMX", wxCheckBox); cb=vfld(d, "MMX", wxCheckBox);
cb->Hide(); cb->Hide();
#endif #endif
getch("Filter", gopts.filter); getch(d, "Filter", gopts.filter);
// these two are filled and/or hidden at dialog load time // these two are filled and/or hidden at dialog load time
wxControl *pll; wxControl *pll;
wxChoice *pl; wxChoice *pl;
@ -2948,7 +2947,7 @@ bool MainFrame::InitMore(void)
ch->Connect(wxEVT_COMMAND_CHOICE_SELECTED, ch->Connect(wxEVT_COMMAND_CHOICE_SELECTED,
wxCommandEventHandler(PluginEnable_t::ToggleChoice), wxCommandEventHandler(PluginEnable_t::ToggleChoice),
NULL, &PluginEnableHandler); NULL, &PluginEnableHandler);
getch("IFB", gopts.ifb); getch(d, "IFB", gopts.ifb);
} }
d=LoadXRCropertySheetDialog("SoundConfig"); d=LoadXRCropertySheetDialog("SoundConfig");
@ -2964,7 +2963,7 @@ bool MainFrame::InitMore(void)
d->Connect(XRCID("Volume100"), wxEVT_COMMAND_BUTTON_CLICKED, d->Connect(XRCID("Volume100"), wxEVT_COMMAND_BUTTON_CLICKED,
wxCommandEventHandler(SoundConfig_t::FullVol), wxCommandEventHandler(SoundConfig_t::FullVol),
NULL, &sound_config_handler); NULL, &sound_config_handler);
getch("Rate", gopts.sound_qual); getch(d, "Rate", gopts.sound_qual);
/// Advanced /// Advanced
#define audapi_rb(n, v) do {\ #define audapi_rb(n, v) do {\