summaryrefslogtreecommitdiff
path: root/Source/Core/DebuggerWX/Src/CodeWindow.cpp
diff options
context:
space:
mode:
authorShawn Hoffman <godisgovernment@gmail.com>2008-12-10 08:57:57 +0000
committerShawn Hoffman <godisgovernment@gmail.com>2008-12-10 08:57:57 +0000
commit514826f2828d6b89452fbf841d03bd66bbb26a02 (patch)
tree2a4853ce948c33de49ce92c58ea6fc8410e25067 /Source/Core/DebuggerWX/Src/CodeWindow.cpp
parent2cbef47d0e84a86a653d49b49190d05149749b9c (diff)
Fix up wxw asserts and exceptions caused by: the "booting..." msg, hacked up tooltips in the debugger, and the staticbitmaps in wiimoteframe.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1479 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/DebuggerWX/Src/CodeWindow.cpp')
-rw-r--r--Source/Core/DebuggerWX/Src/CodeWindow.cpp113
1 files changed, 24 insertions, 89 deletions
diff --git a/Source/Core/DebuggerWX/Src/CodeWindow.cpp b/Source/Core/DebuggerWX/Src/CodeWindow.cpp
index 2b38d5154e..f37ff57332 100644
--- a/Source/Core/DebuggerWX/Src/CodeWindow.cpp
+++ b/Source/Core/DebuggerWX/Src/CodeWindow.cpp
@@ -79,17 +79,12 @@ extern "C" {
static const long TOOLBAR_STYLE = wxTB_FLAT | wxTB_DOCKABLE | wxTB_TEXT;
BEGIN_EVENT_TABLE(CCodeWindow, wxFrame)
- EVT_LISTBOX(IDM_SYMBOLLIST, CCodeWindow::OnSymbolListChange)
- EVT_LISTBOX(IDM_CALLSTACKLIST, CCodeWindow::OnCallstackListChange)
- EVT_LISTBOX(IDM_CALLERSLIST, CCodeWindow::OnCallersListChange)
- EVT_LISTBOX(IDM_CALLSLIST, CCodeWindow::OnCallsListChange)
+ 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)
- EVT_MENU_HIGHLIGHT_ALL( CCodeWindow::OnStatusBar)
- /* 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_LOGWINDOW, CCodeWindow::OnToggleLogWindow)
EVT_MENU(IDM_REGISTERWINDOW, CCodeWindow::OnToggleRegisterWindow)
EVT_MENU(IDM_BREAKPOINTWINDOW, CCodeWindow::OnToggleBreakPointWindow)
@@ -137,7 +132,7 @@ BEGIN_EVENT_TABLE(CCodeWindow, wxFrame)
EVT_MENU(IDM_GOTOPC, CCodeWindow::OnCodeStep)
EVT_TEXT(IDM_ADDRBOX, CCodeWindow::OnAddrBoxChange)
- EVT_COMMAND(IDM_CODEVIEW, wxEVT_CODEVIEW_CHANGE, CCodeWindow::OnCodeViewChange)
+ EVT_COMMAND(ID_CODEVIEW, wxEVT_CODEVIEW_CHANGE, CCodeWindow::OnCodeViewChange)
END_EVENT_TABLE()
#define wxGetBitmapFromMemory(name) _wxGetBitmapFromMemory(name, sizeof(name))
@@ -178,7 +173,7 @@ CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter
wxKeyEventHandler(CCodeWindow::OnKeyDown),
(wxObject*)0, this);
- // Load settings for selectable windowses, but only if they have been created
+ // Load settings for selectable windows, but only if they have been created
this->Load(file);
if (m_BreakpointWindow) m_BreakpointWindow->Load(file);
if (m_RegisterWindow) m_RegisterWindow->Load(file);
@@ -268,14 +263,14 @@ void CCodeWindow::CreateGUIControls(const SCoreStartupParameter& _LocalCoreStart
DebugInterface* di = new PPCDebugInterface();
- codeview = new CCodeView(di, this, IDM_CODEVIEW);
+ codeview = new CCodeView(di, this, ID_CODEVIEW);
sizerBig->Add(sizerLeft, 2, wxEXPAND);
sizerBig->Add(codeview, 5, wxEXPAND);
- sizerLeft->Add(callstack = new wxListBox(this, IDM_CALLSTACKLIST, wxDefaultPosition, wxSize(90, 100)), 0, wxEXPAND);
- sizerLeft->Add(symbols = new wxListBox(this, IDM_SYMBOLLIST, wxDefaultPosition, wxSize(90, 100), 0, NULL, wxLB_SORT), 1, wxEXPAND);
- sizerLeft->Add(calls = new wxListBox(this, IDM_CALLSLIST, wxDefaultPosition, wxSize(90, 100), 0, NULL, wxLB_SORT), 0, wxEXPAND);
- sizerLeft->Add(callers = new wxListBox(this, IDM_CALLERSLIST, wxDefaultPosition, wxSize(90, 100), 0, NULL, wxLB_SORT), 0, wxEXPAND);
+ sizerLeft->Add(callstack = new wxListBox(this, ID_CALLSTACKLIST, wxDefaultPosition, wxSize(90, 100)), 0, wxEXPAND);
+ sizerLeft->Add(symbols = new wxListBox(this, ID_SYMBOLLIST, wxDefaultPosition, wxSize(90, 100), 0, NULL, wxLB_SORT), 1, wxEXPAND);
+ sizerLeft->Add(calls = new wxListBox(this, ID_CALLSLIST, wxDefaultPosition, wxSize(90, 100), 0, NULL, wxLB_SORT), 0, wxEXPAND);
+ sizerLeft->Add(callers = new wxListBox(this, ID_CALLERSLIST, wxDefaultPosition, wxSize(90, 100), 0, NULL, wxLB_SORT), 0, wxEXPAND);
SetSizer(sizerBig);
@@ -345,39 +340,24 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParam
{
// =======================================================================================
- // Windowses
+ // Windows
// ---------------
pMenuBar = new wxMenuBar(wxMB_DOCKABLE);
{
wxMenu* pCoreMenu = new wxMenu;
- wxMenuItem* interpreter = pCoreMenu->Append(IDM_INTERPRETER, _T("&Interpreter core")
- , wxString::FromAscii("This is nessesary to get break points"
- " and stepping to work as explained in the Developer Documentation. But it can be very"
- " slow, perhaps slower than 1 fps.")
- , wxITEM_CHECK);
+ wxMenuItem* interpreter = pCoreMenu->Append(IDM_INTERPRETER, _T("&Interpreter core"), wxEmptyString, wxITEM_CHECK);
interpreter->Check(!_LocalCoreStartupParameter.bUseJIT);
pCoreMenu->AppendSeparator();
- wxMenuItem* automaticstart = pCoreMenu->Append(IDM_AUTOMATICSTART, _T("&Automatic start")
- , wxString::FromAscii("Start the game directly instead of booting to pause. It also"
- " automatically loads the Default ISO when Dolphin starts, or the last game you loaded"
- " , if you have not given it an elf file with the --elf command line. This can be"
- " convenient if you are bugtesting with a certain game and want to rebuild"
- " and retry it several times, either with changes to Dolphin or if you are"
- " developing a homebrew game.")
- , wxITEM_CHECK);
+ wxMenuItem* automaticstart = pCoreMenu->Append(IDM_AUTOMATICSTART, _T("&Automatic start"), wxEmptyString, wxITEM_CHECK);
automaticstart->Check(bAutomaticStart);
pCoreMenu->AppendSeparator();
#ifdef JIT_OFF_OPTIONS
- jitunlimited = pCoreMenu->Append(IDM_JITUNLIMITED, _T("&Unlimited JIT Cache"),
- _T("Avoid any involuntary JIT cache clearing, this may prevent Zelda TP from crashing"),
- wxITEM_CHECK);
+ jitunlimited = pCoreMenu->Append(IDM_JITUNLIMITED, _T("&Unlimited JIT Cache"), wxEmptyString, wxITEM_CHECK);
pCoreMenu->AppendSeparator();
- jitoff = pCoreMenu->Append(IDM_JITOFF, _T("&JIT off (JIT core)"),
- _T("Turn off all JIT functions, but still use the JIT core from Jit.cpp"),
- wxITEM_CHECK);
+ jitoff = pCoreMenu->Append(IDM_JITOFF, _T("&JIT off (JIT core)"), wxEmptyString, wxITEM_CHECK);
jitlsoff = pCoreMenu->Append(IDM_JITLSOFF, _T("&JIT LoadStore off"), wxEmptyString, wxITEM_CHECK);
jitlslbzxoff = pCoreMenu->Append(IDM_JITLSLBZXOFF, _T(" &JIT LoadStore lbzx off"), wxEmptyString, wxITEM_CHECK);
jitlslxzoff = pCoreMenu->Append(IDM_JITLSLXZOFF, _T(" &JIT LoadStore lXz off"), wxEmptyString, wxITEM_CHECK);
@@ -390,8 +370,8 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParam
jitsroff = pCoreMenu->Append(IDM_JITSROFF, _T("&JIT SystemRegisters off"), wxEmptyString, wxITEM_CHECK);
#endif
-// wxMenuItem* dualcore = pDebugMenu->Append(IDM_DUALCORE, _T("&DualCore"), wxEmptyString, wxITEM_CHECK);
-// dualcore->Check(_LocalCoreStartupParameter.bUseDualCore);
+ //wxMenuItem* dualcore = pDebugMenu->Append(IDM_DUALCORE, _T("&DualCore"), wxEmptyString, wxITEM_CHECK);
+ //dualcore->Check(_LocalCoreStartupParameter.bUseDualCore);
pMenuBar->Append(pCoreMenu, _T("&CPU Mode"));
@@ -438,13 +418,7 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParam
pSymbolsMenu->Append(IDM_LOADMAPFILE, _T("&Load symbol map"));
pSymbolsMenu->Append(IDM_SAVEMAPFILE, _T("&Save symbol map"));
pSymbolsMenu->AppendSeparator();
- pSymbolsMenu->Append(IDM_SAVEMAPFILEWITHCODES, _T("Save code"),
- wxString::FromAscii("Save the entire disassembled code. This may take a several seconds"
- " and may require between 50 and 100 MB of hard drive space. It will only save code"
- " that are in the first 4 MB of memory, if you are debugging a game that load .rel"
- " files with code to memory you may want to increase that to perhaps 8 MB, you can do"
- " that from SymbolDB::SaveMap().")
- );
+ pSymbolsMenu->Append(IDM_SAVEMAPFILEWITHCODES, _T("Save code"));
pSymbolsMenu->AppendSeparator();
pSymbolsMenu->Append(IDM_CREATESIGNATUREFILE, _T("&Create signature file..."));
@@ -484,10 +458,10 @@ bool CCodeWindow::AutomaticStart()
return GetMenuBar()->IsChecked(IDM_AUTOMATICSTART);
}
-bool CCodeWindow::UseDualCore()
-{
- return GetMenuBar()->IsChecked(IDM_DUALCORE);
-}
+//bool CCodeWindow::UseDualCore()
+//{
+// return GetMenuBar()->IsChecked(IDM_DUALCORE);
+//}
// =======================================================================================
@@ -929,47 +903,8 @@ void CCodeWindow::OnSymbolListContextMenu(wxContextMenuEvent& event)
}
-// =======================================================================================
-// Show Tool Tip for menu items
-// --------------
-void CCodeWindow::DoTip(wxString text)
-{
- // Create a blank tooltip to clear the eventual old one
- static wxTipWindow *tw = NULL;
- if (tw)
- {
- tw->SetTipWindowPtr(NULL);
- tw->Close();
- }
- tw = NULL;
-
- // Don't make a new one for blank text
- if(text.empty()) return;
-
- tw = new wxTipWindow(this, text, 175, &tw);
-
- // Move it to the right
- #ifdef _WIN32
- POINT point;
- GetCursorPos(&point);
- tw->SetPosition(wxPoint(point.x + 25, point.y));
- #endif
-}
-
-// See the comment under BEGIN_EVENT_TABLE for explanation of why we use these two
-void CCodeWindow::OnStatusBar(wxMenuEvent& event)
-{
- DoTip(pMenuBar->GetHelpString(event.GetId()));
-}
-void CCodeWindow::OnStatusBar_(wxUpdateUIEvent& event)
-{
- DoTip(pMenuBar->GetHelpString(event.GetId()));
-}
-// ===========
-
-
/////////////////////////////////////////////////////////////////////////////////////////////////
-// Show and hide windowses
+// Show and hide windows
// -----------------------
/////////////////////////////////////////////////////////////////////////////////////////////////