mirror of
https://github.com/visualboyadvance-m/visualboyadvance-m
synced 2025-10-05 23:52:49 +02:00
Compare commits
2 Commits
0510656ca3
...
dialog-acc
Author | SHA1 | Date | |
---|---|---|---|
|
8fa2e48134 | ||
|
ad6592e193 |
@@ -46,7 +46,7 @@ if(NOT ENABLE_ASM) # inline asm is not allowed with -fPIC
|
||||
endif()
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
add_compile_options(-ggdb3 -Og -fno-omit-frame-pointer -Wall -Wextra)
|
||||
add_compile_options(-ggdb3 -fno-omit-frame-pointer -Wall -Wextra)
|
||||
else()
|
||||
add_compile_options(-Ofast -fomit-frame-pointer)
|
||||
endif()
|
||||
|
@@ -145,9 +145,11 @@ AccelConfig::AccelConfig(wxWindow* parent,
|
||||
PopulateTreeWithMenu(&command_to_item_id_, tree_, id, menu->GetMenu(i), recents,
|
||||
menu->GetMenuLabelText(i) + '\n');
|
||||
}
|
||||
tree_->ExpandAll();
|
||||
tree_->SelectItem(menu_id);
|
||||
|
||||
// Set a minimum size for the tree so the default dialog size is reasonable.
|
||||
tree_->SetMinSize(wxSize(300, 300));
|
||||
|
||||
int w, h;
|
||||
current_keys_->GetTextExtent("CTRL-ALT-SHIFT-ENTER", &w, &h);
|
||||
wxSize size(w, h);
|
||||
|
@@ -894,11 +894,15 @@ EVT_MOVE_START(MainFrame::OnMoveStart)
|
||||
EVT_MOVE_END(MainFrame::OnMoveEnd)
|
||||
EVT_SIZE(MainFrame::OnSize)
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
|
||||
// For tracking menubar state.
|
||||
EVT_MENU_OPEN(MainFrame::MenuPopped)
|
||||
EVT_MENU_CLOSE(MainFrame::MenuPopped)
|
||||
EVT_MENU_HIGHLIGHT_ALL(MainFrame::MenuPopped)
|
||||
|
||||
#endif // defined(__WXMSW__)
|
||||
|
||||
END_EVENT_TABLE()
|
||||
|
||||
void MainFrame::OnActivate(wxActivateEvent& event)
|
||||
@@ -1152,8 +1156,9 @@ void MainFrame::ResetMenuAccelerators() {
|
||||
ResetRecentAccelerators();
|
||||
}
|
||||
|
||||
void MainFrame::MenuPopped(wxMenuEvent& evt)
|
||||
{
|
||||
#if defined(__WXMSW__)
|
||||
|
||||
void MainFrame::MenuPopped(wxMenuEvent& evt) {
|
||||
// We consider the menu closed when the main menubar or system menu is closed, not any submenus.
|
||||
// On Windows nullptr is the system menu.
|
||||
if (evt.GetEventType() == wxEVT_MENU_CLOSE && (evt.GetMenu() == nullptr || evt.GetMenu()->GetMenuBar() == GetMenuBar()))
|
||||
@@ -1166,18 +1171,16 @@ void MainFrame::MenuPopped(wxMenuEvent& evt)
|
||||
|
||||
// On Windows, opening the menubar will stop the app, but DirectSound will
|
||||
// loop, so we pause audio here.
|
||||
void MainFrame::SetMenusOpened(bool state)
|
||||
{
|
||||
void MainFrame::SetMenusOpened(bool state) {
|
||||
menus_opened = state;
|
||||
|
||||
#ifdef __WXMSW__
|
||||
if (menus_opened)
|
||||
soundPause();
|
||||
else if (!paused)
|
||||
soundResume();
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // defined(__WXMSW__)
|
||||
|
||||
// ShowModal that also disables emulator loop
|
||||
// uses dialog_opened as a nesting counter
|
||||
int MainFrame::ShowModal(wxDialog* dlg)
|
||||
@@ -1338,12 +1341,12 @@ int wxvbamApp::FilterEvent(wxEvent& event)
|
||||
return wxEventFilter::Event_Skip;
|
||||
}
|
||||
|
||||
if (!frame->CanProcessShortcuts()) {
|
||||
if (event.GetEventType() != VBAM_EVT_USER_INPUT) {
|
||||
// We only treat "VBAM_EVT_USER_INPUT" events here.
|
||||
return wxEventFilter::Event_Skip;
|
||||
}
|
||||
|
||||
if (event.GetEventType() != VBAM_EVT_USER_INPUT) {
|
||||
// We only treat "VBAM_EVT_USER_INPUT" events here.
|
||||
if (!frame->CanProcessShortcuts()) {
|
||||
return wxEventFilter::Event_Skip;
|
||||
}
|
||||
|
||||
|
@@ -97,7 +97,7 @@ public:
|
||||
bool pending_fullscreen;
|
||||
#if __WXMAC__
|
||||
// I suppose making this work will require tweaking the bundle
|
||||
void MacOpenFile(const wxString& f)
|
||||
void MacOpenFile(const wxString& f) override
|
||||
{
|
||||
pending_load = f;
|
||||
};
|
||||
@@ -219,10 +219,15 @@ public:
|
||||
// possible
|
||||
void StartModal();
|
||||
void StopModal();
|
||||
// however, adding a handler for open/close menu to do the same is unsafe.
|
||||
// there is no guarantee every show will be matched by a hide.
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
|
||||
// On Windows, we need to disable the audio loop when the menu is open. We also disable
|
||||
// shortcuts to prevent issues. This is not necessary on other systems.
|
||||
void MenuPopped(wxMenuEvent& evt);
|
||||
|
||||
#endif // defined(__WXMSW__)
|
||||
|
||||
// flags for enabling commands
|
||||
int cmd_enable;
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
|
||||
<object class="wxDialog" name="AccelConfig">
|
||||
<title>Key Shortcuts</title>
|
||||
<style>wxRESIZE_BORDER</style>
|
||||
<style>wxRESIZE_BORDER|wxCLOSE_BOX</style>
|
||||
<object class="wxBoxSizer">
|
||||
<orient>wxVERTICAL</orient>
|
||||
<flag>wxEXPAND</flag>
|
||||
@@ -56,6 +56,7 @@
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<flag>wxEXPAND</flag>
|
||||
<object class="wxBoxSizer">
|
||||
<object class="sizeritem">
|
||||
<object class="wxButton" name="Assign">
|
||||
@@ -80,7 +81,6 @@
|
||||
</object>
|
||||
<orient>wxVERTICAL</orient>
|
||||
</object>
|
||||
<flag>wxEXPAND</flag>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<flag>wxALL</flag>
|
||||
@@ -98,6 +98,7 @@
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<flag>wxEXPAND</flag>
|
||||
<object class="wxBoxSizer">
|
||||
<object class="sizeritem">
|
||||
<flag>wxALL</flag>
|
||||
@@ -113,7 +114,6 @@
|
||||
</object>
|
||||
<orient>wxVERTICAL</orient>
|
||||
</object>
|
||||
<flag>wxEXPAND</flag>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
|
Reference in New Issue
Block a user