Skip to content
Permalink
Browse files

Add hotkeys for changing sizes (1x ... 6x).

Use a accelerator to quickly provide a way to change to/from multipliers
of the original size.

- Fix #415.
  • Loading branch information
denisfa authored and rkitover committed Jun 29, 2019
1 parent fa77010 commit 90b3f35408349b741e8d191a7a0a7d93d4718b5b
Showing with 64 additions and 0 deletions.
  1. +36 −0 src/wx/cmdevents.cpp
  2. +7 −0 src/wx/opts.cpp
  3. +21 −0 src/wx/xrc/MainMenu.xrc
@@ -2115,6 +2115,42 @@ EVT_HANDLER(GameBoyConfigure, "Game Boy options...")
update_opts();
}

EVT_HANDLER(SetSize1x, "1x")
{
gopts.video_scale = 1;
panel->AdjustSize(true);
}

EVT_HANDLER(SetSize2x, "2x")
{
gopts.video_scale = 2;
panel->AdjustSize(true);
}

EVT_HANDLER(SetSize3x, "3x")
{
gopts.video_scale = 3;
panel->AdjustSize(true);
}

EVT_HANDLER(SetSize4x, "4x")
{
gopts.video_scale = 4;
panel->AdjustSize(true);
}

EVT_HANDLER(SetSize5x, "5x")
{
gopts.video_scale = 5;
panel->AdjustSize(true);
}

EVT_HANDLER(SetSize6x, "6x")
{
gopts.video_scale = 6;
panel->AdjustSize(true);
}

EVT_HANDLER(GameBoyAdvanceConfigure, "Game Boy Advance options...")
{
wxDialog* dlg = GetXRCDialog("GameBoyAdvanceConfig");
@@ -74,6 +74,13 @@ const wxAcceleratorEntry default_accels[] = {
wxAcceleratorEntry(wxMOD_NONE, WXK_PAUSE, XRCID("Pause")),
wxAcceleratorEntry(wxMOD_CMD, wxT('P'), XRCID("Pause")),
wxAcceleratorEntry(wxMOD_CMD, wxT('R'), XRCID("Reset")),
// add shortcuts for original size multiplier #415
wxAcceleratorEntry(wxMOD_NONE, wxT('1'), XRCID("SetSize1x")),
wxAcceleratorEntry(wxMOD_NONE, wxT('2'), XRCID("SetSize2x")),
wxAcceleratorEntry(wxMOD_NONE, wxT('3'), XRCID("SetSize3x")),
wxAcceleratorEntry(wxMOD_NONE, wxT('4'), XRCID("SetSize4x")),
wxAcceleratorEntry(wxMOD_NONE, wxT('5'), XRCID("SetSize5x")),
wxAcceleratorEntry(wxMOD_NONE, wxT('6'), XRCID("SetSize6x")),
// save oldest is more commonly used than save other
//wxAcceleratorEntry(wxMOD_CMD, wxT('S'), XRCID("Save")),
wxAcceleratorEntry(wxMOD_CMD, wxT('S'), XRCID("SaveGameOldest")),
@@ -295,6 +295,27 @@
<label>_Start in full screen</label>
<checkable>1</checkable>
</object>
<object class="wxMenu">
<label>_Quick resize</label>
<object class="wxMenuItem" name="SetSize1x">
<label>_1x</label>
</object>
<object class="wxMenuItem" name="SetSize2x">
<label>_2x</label>
</object>
<object class="wxMenuItem" name="SetSize3x">
<label>_3x</label>
</object>
<object class="wxMenuItem" name="SetSize4x">
<label>_4x</label>
</object>
<object class="wxMenuItem" name="SetSize5x">
<label>_5x</label>
</object>
<object class="wxMenuItem" name="SetSize6x">
<label>_6x</label>
</object>
</object>
<object class="wxMenuItem" name="RetainAspect">
<label>_Retain aspect ratio</label>
<checkable>1</checkable>

0 comments on commit 90b3f35

Please sign in to comment.
You can’t perform that action at this time.