GUI: Stop the double posting of menu and toolbar events to the code window

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4176 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson 2009-09-03 05:24:30 +00:00
parent 47a16da49a
commit 566b5df761
6 changed files with 124 additions and 110 deletions

View File

@ -74,81 +74,86 @@ class CPluginInfo;
class CPluginManager; class CPluginManager;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Main // Main
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ // ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
BEGIN_EVENT_TABLE(CCodeWindow, wxPanel) BEGIN_EVENT_TABLE(CCodeWindow, wxPanel)
EVT_LISTBOX(ID_SYMBOLLIST, CCodeWindow::OnSymbolListChange)
EVT_LISTBOX(ID_CALLSTACKLIST, CCodeWindow::OnCallstackListChange)
EVT_LISTBOX(ID_CALLERSLIST, CCodeWindow::OnCallersListChange)
EVT_LISTBOX(ID_CALLSLIST, CCodeWindow::OnCallsListChange)
EVT_HOST_COMMAND(wxID_ANY, CCodeWindow::OnHostMessage) // Menu bar
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
EVT_MENU(IDM_INTERPRETER, CCodeWindow::OnCPUMode) // CPU Mode
EVT_MENU(IDM_AUTOMATICSTART, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_BOOTTOPAUSE, CCodeWindow::OnCPUMode)
EVT_COMMAND(ID_CODEVIEW, wxEVT_CODEVIEW_CHANGE, CCodeWindow::OnCodeViewChange) EVT_MENU(IDM_JITUNLIMITED, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_JITOFF, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_JITLSOFF, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_JITLSLXZOFF, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_JITLSLWZOFF, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_JITLSLBZXOFF, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_JITLSFOFF, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_JITLSPOFF, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_JITFPOFF, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_JITIOFF, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_JITPOFF, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_JITSROFF, CCodeWindow::OnCPUMode)
// Menu bar EVT_MENU(IDM_REGISTERWINDOW, CCodeWindow::OnToggleWindow) //views
EVT_MENU(IDM_INTERPRETER, CCodeWindow::OnCPUMode) // CPU Mode EVT_MENU(IDM_BREAKPOINTWINDOW, CCodeWindow::OnToggleWindow)
EVT_MENU(IDM_AUTOMATICSTART, CCodeWindow::OnCPUMode) EVT_MENU(IDM_MEMORYWINDOW, CCodeWindow::OnToggleWindow)
EVT_MENU(IDM_BOOTTOPAUSE, CCodeWindow::OnCPUMode) EVT_MENU(IDM_JITWINDOW, CCodeWindow::OnToggleWindow)
EVT_MENU(IDM_SOUNDWINDOW, CCodeWindow::OnToggleWindow)
EVT_MENU(IDM_VIDEOWINDOW, CCodeWindow::OnToggleWindow)
EVT_MENU(IDM_FONTPICKER, CCodeWindow::OnChangeFont)
EVT_MENU(IDM_JITUNLIMITED, CCodeWindow::OnCPUMode) EVT_MENU(IDM_CLEARSYMBOLS, CCodeWindow::OnSymbolsMenu)
EVT_MENU(IDM_JITOFF, CCodeWindow::OnCPUMode) EVT_MENU(IDM_LOADMAPFILE, CCodeWindow::OnSymbolsMenu)
EVT_MENU(IDM_JITLSOFF, CCodeWindow::OnCPUMode) EVT_MENU(IDM_SCANFUNCTIONS, CCodeWindow::OnSymbolsMenu)
EVT_MENU(IDM_JITLSLXZOFF, CCodeWindow::OnCPUMode) EVT_MENU(IDM_SAVEMAPFILE, CCodeWindow::OnSymbolsMenu)
EVT_MENU(IDM_JITLSLWZOFF, CCodeWindow::OnCPUMode) EVT_MENU(IDM_SAVEMAPFILEWITHCODES, CCodeWindow::OnSymbolsMenu)
EVT_MENU(IDM_JITLSLBZXOFF, CCodeWindow::OnCPUMode) EVT_MENU(IDM_CREATESIGNATUREFILE, CCodeWindow::OnSymbolsMenu)
EVT_MENU(IDM_JITLSFOFF, CCodeWindow::OnCPUMode) EVT_MENU(IDM_USESIGNATUREFILE, CCodeWindow::OnSymbolsMenu)
EVT_MENU(IDM_JITLSPOFF, CCodeWindow::OnCPUMode) EVT_MENU(IDM_PATCHHLEFUNCTIONS, CCodeWindow::OnSymbolsMenu)
EVT_MENU(IDM_JITFPOFF, CCodeWindow::OnCPUMode) EVT_MENU(IDM_RENAME_SYMBOLS, CCodeWindow::OnSymbolsMenu)
EVT_MENU(IDM_JITIOFF, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_JITPOFF, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_JITSROFF, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_REGISTERWINDOW, CCodeWindow::OnToggleWindow) //views EVT_MENU(IDM_CLEARCODECACHE, CCodeWindow::OnJitMenu)
EVT_MENU(IDM_BREAKPOINTWINDOW, CCodeWindow::OnToggleWindow) EVT_MENU(IDM_LOGINSTRUCTIONS, CCodeWindow::OnJitMenu)
EVT_MENU(IDM_MEMORYWINDOW, CCodeWindow::OnToggleWindow) EVT_MENU(IDM_SEARCHINSTRUCTION, CCodeWindow::OnJitMenu)
EVT_MENU(IDM_JITWINDOW, CCodeWindow::OnToggleWindow)
EVT_MENU(IDM_SOUNDWINDOW, CCodeWindow::OnToggleWindow)
EVT_MENU(IDM_VIDEOWINDOW, CCodeWindow::OnToggleWindow)
EVT_MENU(IDM_FONTPICKER, CCodeWindow::OnChangeFont)
EVT_MENU(IDM_CLEARSYMBOLS, CCodeWindow::OnSymbolsMenu) EVT_MENU(IDM_PROFILEBLOCKS, CCodeWindow::OnProfilerMenu)
EVT_MENU(IDM_LOADMAPFILE, CCodeWindow::OnSymbolsMenu) EVT_MENU(IDM_WRITEPROFILE, CCodeWindow::OnProfilerMenu)
EVT_MENU(IDM_SCANFUNCTIONS, CCodeWindow::OnSymbolsMenu)
EVT_MENU(IDM_SAVEMAPFILE, CCodeWindow::OnSymbolsMenu)
EVT_MENU(IDM_SAVEMAPFILEWITHCODES, CCodeWindow::OnSymbolsMenu)
EVT_MENU(IDM_CREATESIGNATUREFILE, CCodeWindow::OnSymbolsMenu)
EVT_MENU(IDM_USESIGNATUREFILE, CCodeWindow::OnSymbolsMenu)
EVT_MENU(IDM_PATCHHLEFUNCTIONS, CCodeWindow::OnSymbolsMenu)
EVT_MENU(IDM_RENAME_SYMBOLS, CCodeWindow::OnSymbolsMenu)
EVT_MENU(IDM_CLEARCODECACHE, CCodeWindow::OnJitMenu) // Menu tooltips
EVT_MENU(IDM_LOGINSTRUCTIONS, CCodeWindow::OnJitMenu) //EVT_MENU_HIGHLIGHT_ALL( CCodeWindow::OnStatusBar)
EVT_MENU(IDM_SEARCHINSTRUCTION, CCodeWindow::OnJitMenu) /* Do this to to avoid that the ToolTips get stuck when only the wxMenu is changed
and not any wxMenuItem that is required by EVT_MENU_HIGHLIGHT_ALL */
//EVT_UPDATE_UI(wxID_ANY, CCodeWindow::OnStatusBar_)
EVT_MENU(IDM_PROFILEBLOCKS, CCodeWindow::OnProfilerMenu) // Toolbar
EVT_MENU(IDM_WRITEPROFILE, CCodeWindow::OnProfilerMenu) // ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
EVT_MENU(IDM_DEBUG_GO, CCodeWindow::OnCodeStep)
EVT_MENU(IDM_STEP, CCodeWindow::OnCodeStep)
EVT_MENU(IDM_STEPOVER, CCodeWindow::OnCodeStep)
EVT_MENU(IDM_SKIP, CCodeWindow::OnCodeStep)
EVT_MENU(IDM_SETPC, CCodeWindow::OnCodeStep)
EVT_MENU(IDM_GOTOPC, CCodeWindow::OnCodeStep)
EVT_TEXT(IDM_ADDRBOX, CCodeWindow::OnAddrBoxChange)
// Toolbar
EVT_MENU(IDM_DEBUG_GO, CCodeWindow::OnCodeStep)
EVT_MENU(IDM_STEP, CCodeWindow::OnCodeStep)
EVT_MENU(IDM_STEPOVER, CCodeWindow::OnCodeStep)
EVT_MENU(IDM_SKIP, CCodeWindow::OnCodeStep)
EVT_MENU(IDM_SETPC, CCodeWindow::OnCodeStep)
EVT_MENU(IDM_GOTOPC, CCodeWindow::OnCodeStep)
EVT_TEXT(IDM_ADDRBOX, CCodeWindow::OnAddrBoxChange)
// Menu tooltips // Other
//EVT_MENU_HIGHLIGHT_ALL( CCodeWindow::OnStatusBar) // ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
/* Do this to to avoid that the ToolTips get stuck when only the wxMenu is changed EVT_LISTBOX(ID_SYMBOLLIST, CCodeWindow::OnSymbolListChange)
and not any wxMenuItem that is required by EVT_MENU_HIGHLIGHT_ALL */ EVT_LISTBOX(ID_CALLSTACKLIST, CCodeWindow::OnCallstackListChange)
//EVT_UPDATE_UI(wxID_ANY, CCodeWindow::OnStatusBar_) EVT_LISTBOX(ID_CALLERSLIST, CCodeWindow::OnCallersListChange)
EVT_LISTBOX(ID_CALLSLIST, CCodeWindow::OnCallsListChange)
EVT_HOST_COMMAND(wxID_ANY, CCodeWindow::OnHostMessage)
EVT_COMMAND(ID_CODEVIEW, wxEVT_CODEVIEW_CHANGE, CCodeWindow::OnCodeViewChange)
END_EVENT_TABLE() END_EVENT_TABLE()
// Class // Class
CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter, CFrame *ParentObject, wxWindow* parent, CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter, CFrame *ParentObject, wxWindow* parent,
wxWindowID id, const wxPoint& position, const wxSize& size, long style, const wxString& name) wxWindowID id, const wxPoint& position, const wxSize& size, long style, const wxString& name)
@ -187,10 +192,10 @@ wxAuiToolBar *CCodeWindow::GetToolBar()
{ {
return Parent->m_ToolBarDebug; return Parent->m_ToolBarDebug;
} }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Events // Events
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ // ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
void CCodeWindow::OnKeyDown(wxKeyEvent& event) void CCodeWindow::OnKeyDown(wxKeyEvent& event)
@ -536,7 +541,7 @@ void CCodeWindow::CreateGUIControls(const SCoreStartupParameter& _LocalCoreStart
sync_event.Init(); sync_event.Init();
} }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Menus // Menus

View File

@ -89,6 +89,11 @@ class CCodeWindow
void OpenPages(); void OpenPages();
void UpdateManager(); void UpdateManager();
// Menu bar
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
void OnCPUMode(wxCommandEvent& event); // CPU Mode menu
void OnJITOff(wxCommandEvent& event);
void OnToggleWindow(wxCommandEvent& event); void OnToggleWindow(wxCommandEvent& event);
void OnToggleCodeWindow(bool,int); void OnToggleCodeWindow(bool,int);
void OnToggleRegisterWindow(bool,int); void OnToggleRegisterWindow(bool,int);
@ -99,6 +104,12 @@ class CCodeWindow
void OnToggleVideoWindow(bool,int); void OnToggleVideoWindow(bool,int);
void OnChangeFont(wxCommandEvent& event); void OnChangeFont(wxCommandEvent& event);
void OnCodeStep(wxCommandEvent& event);
void OnAddrBoxChange(wxCommandEvent& event);
void OnSymbolsMenu(wxCommandEvent& event);
void OnJitMenu(wxCommandEvent& event);
void OnProfilerMenu(wxCommandEvent& event);
// Sub dialogs // Sub dialogs
wxMenuBar* pMenuBar; wxMenuBar* pMenuBar;
CRegisterWindow* m_RegisterWindow; CRegisterWindow* m_RegisterWindow;
@ -135,18 +146,9 @@ class CCodeWindow
void OnCallstackListChange(wxCommandEvent& event); void OnCallstackListChange(wxCommandEvent& event);
void OnCallersListChange(wxCommandEvent& event); void OnCallersListChange(wxCommandEvent& event);
void OnCallsListChange(wxCommandEvent& event); void OnCallsListChange(wxCommandEvent& event);
void OnCodeStep(wxCommandEvent& event);
void OnCodeViewChange(wxCommandEvent &event); void OnCodeViewChange(wxCommandEvent &event);
void SingleCPUStep(); void SingleCPUStep();
void OnAddrBoxChange(wxCommandEvent& event);
void OnHostMessage(wxCommandEvent& event); void OnHostMessage(wxCommandEvent& event);
void OnSymbolsMenu(wxCommandEvent& event);
void OnJitMenu(wxCommandEvent& event);
void OnProfilerMenu(wxCommandEvent& event);
void OnCPUMode(wxCommandEvent& event); // CPU Mode menu
void OnJITOff(wxCommandEvent& event);
void UpdateLists(); void UpdateLists();
void UpdateCallstack(); void UpdateCallstack();

View File

@ -339,18 +339,18 @@ void CCodeWindow::OnToggleWindow(wxCommandEvent& event)
{ {
Parent->DoToggleWindow(event.GetId(), GetMenuBar()->IsChecked(event.GetId())); Parent->DoToggleWindow(event.GetId(), GetMenuBar()->IsChecked(event.GetId()));
} }
void CCodeWindow::OnToggleCodeWindow(bool _show, int i) void CCodeWindow::OnToggleCodeWindow(bool _Show, int i)
{ {
if (_show) if (_Show)
{ {
Parent->DoAddPage(this, i, "Code"); Parent->DoAddPage(this, i, "Code");
} }
else // hide else // hide
Parent->DoRemovePage (this); Parent->DoRemovePage (this);
} }
void CCodeWindow::OnToggleRegisterWindow(bool _show, int i) void CCodeWindow::OnToggleRegisterWindow(bool _Show, int i)
{ {
if (_show) if (_Show)
{ {
if (!m_RegisterWindow) m_RegisterWindow = new CRegisterWindow(Parent); if (!m_RegisterWindow) m_RegisterWindow = new CRegisterWindow(Parent);
Parent->DoAddPage(m_RegisterWindow, i, "Registers"); Parent->DoAddPage(m_RegisterWindow, i, "Registers");
@ -359,9 +359,9 @@ void CCodeWindow::OnToggleRegisterWindow(bool _show, int i)
Parent->DoRemovePage (m_RegisterWindow); Parent->DoRemovePage (m_RegisterWindow);
} }
void CCodeWindow::OnToggleBreakPointWindow(bool _show, int i) void CCodeWindow::OnToggleBreakPointWindow(bool _Show, int i)
{ {
if (_show) if (_Show)
{ {
if (!m_BreakpointWindow) m_BreakpointWindow = new CBreakPointWindow(this, Parent); if (!m_BreakpointWindow) m_BreakpointWindow = new CBreakPointWindow(this, Parent);
#ifdef _WIN32 #ifdef _WIN32
@ -378,9 +378,9 @@ void CCodeWindow::OnToggleBreakPointWindow(bool _show, int i)
#endif #endif
} }
void CCodeWindow::OnToggleJitWindow(bool _show, int i) void CCodeWindow::OnToggleJitWindow(bool _Show, int i)
{ {
if (_show) if (_Show)
{ {
if (!m_JitWindow) m_JitWindow = new CJitWindow(Parent); if (!m_JitWindow) m_JitWindow = new CJitWindow(Parent);
#ifdef _WIN32 #ifdef _WIN32
@ -398,9 +398,9 @@ void CCodeWindow::OnToggleJitWindow(bool _show, int i)
} }
void CCodeWindow::OnToggleMemoryWindow(bool _show, int i) void CCodeWindow::OnToggleMemoryWindow(bool _Show, int i)
{ {
if (_show) if (_Show)
{ {
if (!m_MemoryWindow) m_MemoryWindow = new CMemoryWindow(Parent); if (!m_MemoryWindow) m_MemoryWindow = new CMemoryWindow(Parent);
#ifdef _WIN32 #ifdef _WIN32
@ -432,11 +432,11 @@ Notice: This windows docking for plugin windows will produce several wx debuggin
//Toggle Sound Debugging Window //Toggle Sound Debugging Window
void CCodeWindow::OnToggleSoundWindow(bool _show, int i) void CCodeWindow::OnToggleSoundWindow(bool _Show, int i)
{ {
// ConsoleListener* Console = LogManager::GetInstance()->getConsoleListener(); // ConsoleListener* Console = LogManager::GetInstance()->getConsoleListener();
if (_show) if (_Show)
{ {
if (Parent->GetNotebookCount() == 0) return; if (Parent->GetNotebookCount() == 0) return;
if (i < 0 || i > Parent->GetNotebookCount()-1) i = 0; if (i < 0 || i > Parent->GetNotebookCount()-1) i = 0;
@ -496,11 +496,11 @@ void CCodeWindow::OnToggleSoundWindow(bool _show, int i)
} }
// Toggle Video Debugging Window // Toggle Video Debugging Window
void CCodeWindow::OnToggleVideoWindow(bool _show, int i) void CCodeWindow::OnToggleVideoWindow(bool _Show, int i)
{ {
//GetMenuBar()->Check(event.GetId(), false); // Turn off //GetMenuBar()->Check(event.GetId(), false); // Turn off
if (_show) if (_Show)
{ {
if (Parent->GetNotebookCount() == 0) return; if (Parent->GetNotebookCount() == 0) return;
if (i < 0 || i > Parent->GetNotebookCount()-1) i = 0; if (i < 0 || i > Parent->GetNotebookCount()-1) i = 0;

View File

@ -210,7 +210,9 @@ int abc = 0;
const wxEventType wxEVT_HOST_COMMAND = wxNewEventType(); const wxEventType wxEVT_HOST_COMMAND = wxNewEventType();
BEGIN_EVENT_TABLE(CFrame, wxFrame) BEGIN_EVENT_TABLE(CFrame, wxFrame)
EVT_CLOSE(CFrame::OnClose)
// Menu bar
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
EVT_MENU(wxID_OPEN, CFrame::OnOpen) EVT_MENU(wxID_OPEN, CFrame::OnOpen)
EVT_MENU(wxID_EXIT, CFrame::OnQuit) EVT_MENU(wxID_EXIT, CFrame::OnQuit)
EVT_MENU(IDM_HELPWEBSITE, CFrame::OnHelp) EVT_MENU(IDM_HELPWEBSITE, CFrame::OnHelp)
@ -279,25 +281,28 @@ EVT_MENU_RANGE(IDM_SAVESLOT1, IDM_SAVESLOT8, CFrame::OnSaveState)
EVT_MENU_RANGE(IDM_FRAMESKIP0, IDM_FRAMESKIP9, CFrame::OnFrameSkip) EVT_MENU_RANGE(IDM_FRAMESKIP0, IDM_FRAMESKIP9, CFrame::OnFrameSkip)
EVT_MENU_RANGE(IDM_DRIVE1, IDM_DRIVE24, CFrame::OnBootDrive) EVT_MENU_RANGE(IDM_DRIVE1, IDM_DRIVE24, CFrame::OnBootDrive)
// Other
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
EVT_CLOSE(CFrame::OnClose)
EVT_SIZE(CFrame::OnResize) EVT_SIZE(CFrame::OnResize)
EVT_LIST_ITEM_ACTIVATED(LIST_CTRL, CFrame::OnGameListCtrl_ItemActivated) EVT_LIST_ITEM_ACTIVATED(LIST_CTRL, CFrame::OnGameListCtrl_ItemActivated)
EVT_HOST_COMMAND(wxID_ANY, CFrame::OnHostMessage) EVT_HOST_COMMAND(wxID_ANY, CFrame::OnHostMessage)
#if wxUSE_TIMER #if wxUSE_TIMER
EVT_TIMER(wxID_ANY, CFrame::OnTimer) EVT_TIMER(wxID_ANY, CFrame::OnTimer)
#endif #endif
// Debugger Menu Entries
EVT_MENU(wxID_ANY, CFrame::PostEvent)
EVT_TEXT(wxID_ANY, CFrame::PostEvent)
//EVT_MENU_HIGHLIGHT_ALL(CFrame::PostMenuEvent)
//EVT_UPDATE_UI(wxID_ANY, CFrame::PostUpdateUIEvent)
EVT_AUI_PANE_CLOSE(CFrame::OnPaneClose) EVT_AUI_PANE_CLOSE(CFrame::OnPaneClose)
EVT_AUINOTEBOOK_PAGE_CLOSE(wxID_ANY, CFrame::OnNotebookPageClose) EVT_AUINOTEBOOK_PAGE_CLOSE(wxID_ANY, CFrame::OnNotebookPageClose)
EVT_AUINOTEBOOK_ALLOW_DND(wxID_ANY, CFrame::OnAllowNotebookDnD) EVT_AUINOTEBOOK_ALLOW_DND(wxID_ANY, CFrame::OnAllowNotebookDnD)
EVT_AUINOTEBOOK_PAGE_CHANGED(wxID_ANY, CFrame::OnNotebookPageChanged) EVT_AUINOTEBOOK_PAGE_CHANGED(wxID_ANY, CFrame::OnNotebookPageChanged)
// Post events to child panels
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
EVT_MENU(wxID_ANY, CFrame::PostEvent)
EVT_TEXT(wxID_ANY, CFrame::PostEvent)
//EVT_MENU_HIGHLIGHT_ALL(CFrame::PostMenuEvent)
//EVT_UPDATE_UI(wxID_ANY, CFrame::PostUpdateUIEvent)
END_EVENT_TABLE() END_EVENT_TABLE()
//--------------- //---------------
@ -312,7 +317,7 @@ CFrame::CFrame(wxFrame* parent,
bool ShowLogWindow, bool ShowLogWindow,
long style) long style)
: wxFrame(parent, id, title, pos, size, style) : wxFrame(parent, id, title, pos, size, style)
, m_LogWindow(NULL), m_ToolBar(NULL), m_ToolBarDebug(NULL), m_ToolBarAui(NULL) , m_LogWindow(NULL), m_MenuBar(NULL), m_ToolBar(NULL), m_ToolBarDebug(NULL), m_ToolBarAui(NULL)
, m_pStatusBar(NULL), m_GameListCtrl(NULL), m_Panel(NULL) , m_pStatusBar(NULL), m_GameListCtrl(NULL), m_Panel(NULL)
, UseDebugger(_UseDebugger), m_bEdit(false), m_bTabSplit(false), m_bNoDocking(false), bRenderToMain(true) , UseDebugger(_UseDebugger), m_bEdit(false), m_bTabSplit(false), m_bNoDocking(false), bRenderToMain(true)
, HaveLeds(false), HaveSpeakers(false) , HaveLeds(false), HaveSpeakers(false)
@ -541,14 +546,16 @@ void CFrame::OnClose(wxCloseEvent& event)
// Warning: This may cause an endless loop if the event is propagated back to its parent // Warning: This may cause an endless loop if the event is propagated back to its parent
void CFrame::PostEvent(wxCommandEvent& event) void CFrame::PostEvent(wxCommandEvent& event)
{ {
event.Skip();
event.StopPropagation();
if (g_pCodeWindow if (g_pCodeWindow
&& event.GetId() >= IDM_INTERPRETER && event.GetId() <= IDM_ADDRBOX && event.GetId() >= IDM_INTERPRETER && event.GetId() <= IDM_ADDRBOX
&& event.GetId() != IDM_JITUNLIMITED //&& event.GetId() != IDM_JITUNLIMITED
) )
{
event.StopPropagation();
wxPostEvent(g_pCodeWindow, event); wxPostEvent(g_pCodeWindow, event);
}
else
event.Skip();
} }
void CFrame::PostMenuEvent(wxMenuEvent& event) void CFrame::PostMenuEvent(wxMenuEvent& event)
{ {

View File

@ -68,6 +68,7 @@ class CFrame : public wxFrame
// These have to be public // These have to be public
CCodeWindow* g_pCodeWindow; CCodeWindow* g_pCodeWindow;
wxMenuBar* m_MenuBar;
wxBitmap aNormalFile; wxBitmap aNormalFile;
void InitBitmaps(); void InitBitmaps();
void DoStop(); void DoStop();

View File

@ -98,10 +98,9 @@ wxInfoWindow* InfoWindow;
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ // ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
void CFrame::CreateMenu() void CFrame::CreateMenu()
{ {
if (GetMenuBar()) if (GetMenuBar()) GetMenuBar()->Destroy();
GetMenuBar()->Destroy();
wxMenuBar* menuBar = new wxMenuBar(wxMB_DOCKABLE); m_MenuBar = new wxMenuBar(wxMB_DOCKABLE);
// file menu // file menu
wxMenu* fileMenu = new wxMenu; wxMenu* fileMenu = new wxMenu;
@ -123,7 +122,7 @@ void CFrame::CreateMenu()
fileMenu->Append(IDM_RESTART, UseDebugger ? _T("Restart in regular mode") : _T("Restart in debugging mode")); fileMenu->Append(IDM_RESTART, UseDebugger ? _T("Restart in regular mode") : _T("Restart in debugging mode"));
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
fileMenu->Append(wxID_EXIT, _T("E&xit\tAlt+F4")); fileMenu->Append(wxID_EXIT, _T("E&xit\tAlt+F4"));
menuBar->Append(fileMenu, _T("&File")); m_MenuBar->Append(fileMenu, _T("&File"));
// Emulation menu // Emulation menu
wxMenu* emulationMenu = new wxMenu; wxMenu* emulationMenu = new wxMenu;
@ -163,7 +162,7 @@ void CFrame::CreateMenu()
loadMenu->Append(IDM_LOADSLOT1 + i - 1, wxString::Format(_T("Slot %i\tF%i"), i, i)); loadMenu->Append(IDM_LOADSLOT1 + i - 1, wxString::Format(_T("Slot %i\tF%i"), i, i));
saveMenu->Append(IDM_SAVESLOT1 + i - 1, wxString::Format(_T("Slot %i\tShift+F%i"), i, i)); saveMenu->Append(IDM_SAVESLOT1 + i - 1, wxString::Format(_T("Slot %i\tShift+F%i"), i, i));
} }
menuBar->Append(emulationMenu, _T("&Emulation")); m_MenuBar->Append(emulationMenu, _T("&Emulation"));
// Options menu // Options menu
wxMenu* pOptionsMenu = new wxMenu; wxMenu* pOptionsMenu = new wxMenu;
@ -175,7 +174,7 @@ void CFrame::CreateMenu()
pOptionsMenu->Append(IDM_CONFIG_WIIMOTE_PLUGIN, _T("&Wiimote Settings")); pOptionsMenu->Append(IDM_CONFIG_WIIMOTE_PLUGIN, _T("&Wiimote Settings"));
pOptionsMenu->AppendSeparator(); pOptionsMenu->AppendSeparator();
pOptionsMenu->Append(IDM_TOGGLE_FULLSCREEN, _T("&Fullscreen\tAlt+Enter")); pOptionsMenu->Append(IDM_TOGGLE_FULLSCREEN, _T("&Fullscreen\tAlt+Enter"));
menuBar->Append(pOptionsMenu, _T("&Options")); m_MenuBar->Append(pOptionsMenu, _T("&Options"));
// Tools menu // Tools menu
wxMenu* toolsMenu = new wxMenu; wxMenu* toolsMenu = new wxMenu;
@ -192,7 +191,7 @@ void CFrame::CreateMenu()
toolsMenu->Append(IDM_LOAD_WII_MENU, _T("Load Wii Menu")); toolsMenu->Append(IDM_LOAD_WII_MENU, _T("Load Wii Menu"));
} }
menuBar->Append(toolsMenu, _T("&Tools")); m_MenuBar->Append(toolsMenu, _T("&Tools"));
wxMenu* viewMenu = new wxMenu; wxMenu* viewMenu = new wxMenu;
viewMenu->AppendCheckItem(IDM_TOGGLE_TOOLBAR, _T("Show &Toolbar")); viewMenu->AppendCheckItem(IDM_TOGGLE_TOOLBAR, _T("Show &Toolbar"));
@ -221,7 +220,7 @@ void CFrame::CreateMenu()
viewMenu->Check(IDM_LISTDRIVES, SConfig::GetInstance().m_ListDrives); viewMenu->Check(IDM_LISTDRIVES, SConfig::GetInstance().m_ListDrives);
viewMenu->AppendSeparator(); viewMenu->AppendSeparator();
viewMenu->Append(IDM_PURGECACHE, _T("Purge Cache")); viewMenu->Append(IDM_PURGECACHE, _T("Purge Cache"));
menuBar->Append(viewMenu, _T("&View")); m_MenuBar->Append(viewMenu, _T("&View"));
// Help menu // Help menu
wxMenu* helpMenu = new wxMenu; wxMenu* helpMenu = new wxMenu;
@ -231,12 +230,12 @@ void CFrame::CreateMenu()
helpMenu->Append(IDM_HELPGOOGLECODE, _T("Dolphin at &Google Code")); helpMenu->Append(IDM_HELPGOOGLECODE, _T("Dolphin at &Google Code"));
helpMenu->AppendSeparator(); helpMenu->AppendSeparator();
helpMenu->Append(IDM_HELPABOUT, _T("&About...")); helpMenu->Append(IDM_HELPABOUT, _T("&About..."));
menuBar->Append(helpMenu, _T("&Help")); m_MenuBar->Append(helpMenu, _T("&Help"));
if (UseDebugger) g_pCodeWindow->CreateMenu(SConfig::GetInstance().m_LocalCoreStartupParameter, menuBar); if (UseDebugger) g_pCodeWindow->CreateMenu(SConfig::GetInstance().m_LocalCoreStartupParameter, m_MenuBar);
// Associate the menu bar with the frame // Associate the menu bar with the frame
SetMenuBar(menuBar); SetMenuBar(m_MenuBar);
} }