Fix a segmentation fault when changing perspectives.

Some general code clean up.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5948 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice
2010-07-23 03:53:18 +00:00
parent ba67333053
commit 2e6c5b36ab
5 changed files with 188 additions and 247 deletions
File diff suppressed because it is too large Load Diff
+11 -14
View File
@@ -52,15 +52,13 @@ class CCodeWindow
const wxString& name = wxT("Code")
);
~CCodeWindow();
void Load();
void Save();
// Parent interaction
CFrame *Parent;
wxMenuBar * GetMenuBar();
wxAuiToolBar * GetToolBar();
int GetNootebookAffiliation(wxString);
wxAuiToolBar * GetToolBar();
wxBitmap m_Bitmaps[ToolbarDebugBitmapMax];
bool UseInterpreter();
@@ -68,11 +66,12 @@ class CCodeWindow
bool AutomaticStart();
bool JITNoBlockCache();
bool JITBlockLinking();
void JumpToAddress(u32 _Address);
void JumpToAddress(u32 _Address);
void Update();
void NotifyMapLoaded();
void CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParameter, wxMenuBar * pMenuBar);
void CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParameter,
wxMenuBar * pMenuBar);
void CreateMenuView(wxMenuBar * pMenuBar, wxMenu*);
void CreateMenuOptions(wxMenuBar * pMenuBar, wxMenu*);
void CreateMenuSymbols();
@@ -81,10 +80,10 @@ class CCodeWindow
void UpdateButtonStates();
void OpenPages();
void UpdateManager();
// Menu bar
// -------------------
void OnCPUMode(wxCommandEvent& event); // CPU Mode menu
void OnCPUMode(wxCommandEvent& event); // CPU Mode menu
void OnJITOff(wxCommandEvent& event);
void OnToggleWindow(wxCommandEvent& event);
@@ -125,7 +124,7 @@ class CCodeWindow
private:
enum
{
{
// Debugger GUI Objects
ID_CODEVIEW,
ID_CALLSTACKLIST,
@@ -140,17 +139,15 @@ class CCodeWindow
void OnCallersListChange(wxCommandEvent& event);
void OnCallsListChange(wxCommandEvent& event);
void OnCodeViewChange(wxCommandEvent &event);
void SingleCPUStep();
void SingleCPUStep();
void OnHostMessage(wxCommandEvent& event);
void UpdateLists();
void UpdateCallstack();
void OnStatusBar(wxMenuEvent& event); void OnStatusBar_(wxUpdateUIEvent& event);
void DoTip(wxString text);
void OnKeyDown(wxKeyEvent& event);
void InitBitmaps();
void CreateGUIControls(const SCoreStartupParameter& _LocalCoreStartupParameter);
void CreateGUIControls(const SCoreStartupParameter& _LocalCoreStartupParameter);
wxMenuItem* jitblocklinking, *jitnoblockcache, *jitoff;
wxMenuItem* jitlsoff, *jitlslxzoff, *jitlslwzoff, *jitlslbzxoff;
@@ -170,7 +167,7 @@ class CCodeWindow
wxListBox* calls;
Common::Event sync_event;
DECLARE_EVENT_TABLE()
DECLARE_EVENT_TABLE()
};
#endif /*CODEWINDOW_*/
#endif // CODEWINDOW_H_
+1 -10
View File
@@ -320,8 +320,6 @@ EVT_AUINOTEBOOK_TAB_RIGHT_UP(wxID_ANY, CFrame::OnTab)
// 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()
@@ -361,6 +359,7 @@ CFrame::CFrame(wxFrame* parent,
if (SConfig::GetInstance().m_InterfaceConsole) Console->Open();
m_LogWindow = new CLogWindow(this, IDM_LOGWINDOW);
m_LogWindow->Hide();
m_LogWindow->Disable();
// Start debugging mazimized
if (UseDebugger) this->Maximize(true);
@@ -600,14 +599,6 @@ void CFrame::PostEvent(wxCommandEvent& event)
else
event.Skip();
}
void CFrame::PostMenuEvent(wxMenuEvent& event)
{
if (g_pCodeWindow) g_pCodeWindow->GetEventHandler()->AddPendingEvent(event);
}
void CFrame::PostUpdateUIEvent(wxUpdateUIEvent& event)
{
if (g_pCodeWindow) g_pCodeWindow->GetEventHandler()->AddPendingEvent(event);
}
void CFrame::OnMove(wxMoveEvent& event)
{
-2
View File
@@ -126,8 +126,6 @@ class CFrame : public CRenderFrame
void ToggleLogWindow(bool, int i = -1);
void ToggleConsole(bool, int i = -1);
void PostEvent(wxCommandEvent& event);
void PostMenuEvent(wxMenuEvent& event);
void PostUpdateUIEvent(wxUpdateUIEvent& event);
void StatusBarMessage(const char * Text, ...);
void ClearStatusBar();
void OnSizeRequest(int& x, int& y, int& width, int& height);
+14 -2
View File
@@ -99,10 +99,14 @@ void CFrame::ToggleLogWindow(bool bShow, int i)
if (bShow)
{
if (!m_LogWindow) m_LogWindow = new CLogWindow(this, IDM_LOGWINDOW);
m_LogWindow->Enable();
DoAddPage(m_LogWindow, i, bFloatWindow[0]);
}
else
{
m_LogWindow->Disable();
DoRemovePage(m_LogWindow, bShow);
}
// Hide or Show the pane
if (!g_pCodeWindow)
@@ -142,6 +146,7 @@ void CFrame::ToggleConsole(bool bShow, int i)
ConsoleWin->AdoptAttributesFromHWND();
ConsoleWin->Reparent(ConsoleParent);
ConsoleParent->Enable();
DoAddPage(ConsoleParent, i, bFloatWindow[1]);
}
else // Hide
@@ -149,6 +154,10 @@ void CFrame::ToggleConsole(bool bShow, int i)
if(GetConsoleWindow())
ShowWindow(GetConsoleWindow(), SW_HIDE); // WIN32
wxPanel *ConsoleParent = (wxPanel*)FindWindowById(IDM_CONSOLEWINDOW);
if (ConsoleParent)
ConsoleParent->Disable();
// Then close the page
DoRemovePageId(IDM_CONSOLEWINDOW, true, true);
}
@@ -268,7 +277,7 @@ void CFrame::OnTab(wxAuiNotebookEvent& event)
for (int i = IDM_LOGWINDOW; i <= IDM_VIDEOWINDOW; i++)
{
wxWindow *Win = FindWindowById(i);
if (Win)
if (Win && Win->IsEnabled())
{
Item = new wxMenuItem(MenuPopup, i + IDM_FLOAT_LOGWINDOW - IDM_LOGWINDOW,
Win->GetName(), wxT(""), wxITEM_CHECK);
@@ -330,7 +339,10 @@ void CFrame::DoRemovePage(wxWindow * Win, bool _Hide)
{
GetNotebookFromId(i)->RemovePage(GetNotebookFromId(i)->GetPageIndex(Win));
if (_Hide)
Win->Hide();
{
Win->Hide();
Win->Reparent(this);
}
else
Win->Close();
}