GUI: Views toolbar, save view on exit

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4074 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson
2009-08-27 07:33:07 +00:00
parent 217e0da0e6
commit cb0eafcfc8
6 changed files with 257 additions and 112 deletions

View File

@ -27,9 +27,6 @@
#include <wx/mstream.h>
#include <wx/tipwin.h>
// ugly that this lib included code from the main
#include "../../DolphinWX/Src/Globals.h"
#include "Host.h"
#include "Debugger.h"
@ -171,7 +168,7 @@ CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter
, m_BreakpointWindow(NULL)
, m_MemoryWindow(NULL)
, m_JitWindow(NULL)
, m_ToolBar2(NULL), m_NB0(NULL), m_NB1(NULL)
, m_ToolBarDebug(NULL), m_NB0(NULL), m_NB1(NULL)
{
// Load ini settings
this->Load();
@ -211,7 +208,7 @@ wxMenuBar *CCodeWindow::GetMenuBar()
}
wxAuiToolBar *CCodeWindow::GetToolBar()
{
if (GetParentFrame()) return m_ToolBar2;
if (GetParentFrame()) return m_ToolBarDebug;
}
bool CCodeWindow::IsActive()
{
@ -219,7 +216,7 @@ bool CCodeWindow::IsActive()
}
void CCodeWindow::UpdateToolbar(wxAuiToolBar * _ToolBar2)
{
m_ToolBar2 = _ToolBar2;
m_ToolBarDebug = _ToolBar2;
}
void CCodeWindow::UpdateNotebook(int _i, wxAuiNotebook * _NB)
{
@ -508,11 +505,10 @@ void CCodeWindow::InitBitmaps()
m_Bitmaps[Toolbar_Skip] = wxGetBitmapFromMemory(toolbar_add_memcheck_png);
m_Bitmaps[Toolbar_GotoPC] = wxGetBitmapFromMemory(toolbar_add_memcheck_png);
m_Bitmaps[Toolbar_SetPC] = wxGetBitmapFromMemory(toolbar_add_memcheck_png);
m_Bitmaps[Toolbar_Pause] = wxGetBitmapFromMemory(toolbar_pause_png);
m_Bitmaps[Toolbar_DebugPause] = wxGetBitmapFromMemory(toolbar_pause_png);
// scale to 16x16 for toolbar
for (size_t n = Toolbar_DebugGo; n < Bitmaps_max; n++)
for (size_t n = Toolbar_DebugGo; n < ToolbarDebugBitmapMax; n++)
{
m_Bitmaps[n] = wxBitmap(m_Bitmaps[n].ConvertToImage().Scale(16, 16));
}
@ -859,7 +855,7 @@ void CCodeWindow::UpdateButtonStates()
{
ToolBar->SetToolShortHelp(IDM_DEBUG_GO, _T("&Pause"));
ToolBar->SetToolLabel(IDM_DEBUG_GO, _("Pause"));
ToolBar->SetToolBitmap(IDM_DEBUG_GO, m_Bitmaps[Toolbar_Pause]);
ToolBar->SetToolBitmap(IDM_DEBUG_GO, m_Bitmaps[Toolbar_DebugPause]);
ToolBar->EnableTool(IDM_DEBUG_GO, true);
ToolBar->EnableTool(IDM_STEP, false);
ToolBar->EnableTool(IDM_STEPOVER, false);
@ -922,7 +918,7 @@ void CCodeWindow::RecreateToolbar(wxAuiToolBar * toolBar)
long style = TOOLBAR_STYLE;
style &= ~(wxTB_HORIZONTAL | wxTB_VERTICAL | wxTB_BOTTOM | wxTB_RIGHT | wxTB_HORZ_LAYOUT | wxTB_TOP);
wxToolBar* theToolBar = CreateToolBar(style, ID_TOOLBAR2);
wxToolBar* theToolBar = CreateToolBar(style, ID_TOOLBAR_DEBUG);
PopulateToolbar(theToolBar);
SetToolBar(theToolBar);

View File

@ -28,6 +28,9 @@
#include "Thread.h"
#include "CoreParameter.h"
// GUI global
#include "../../DolphinWX/Src/Globals.h"
class CRegisterWindow;
class CBreakPointWindow;
class CMemoryWindow;
@ -54,10 +57,10 @@ class CCodeWindow
void Load();
void Save();
// Function redirection
// Function redirection and parent interaction
wxFrame *GetParentFrame();
wxMenuBar * GetMenuBar();
wxAuiToolBar * GetToolBar(), * m_ToolBar2;
wxAuiToolBar * GetToolBar(), * m_ToolBarDebug;
wxAuiNotebook *m_NB0, *m_NB1;
bool IsActive();
void UpdateToolbar(wxAuiToolBar *);
@ -68,13 +71,13 @@ class CCodeWindow
#endif
wxWindow * GetNootebookPage(wxString);
void DoToggleWindow(int,bool);
wxBitmap m_Bitmaps[ToolbarDebugBitmapMax];
bool UseInterpreter();
bool BootToPause();
bool AutomaticStart();
bool UnlimitedJITCache();
bool JITBlockLinking();
//bool UseDualCore(); // not used
void JumpToAddress(u32 _Address);
void Update();
@ -106,18 +109,6 @@ class CCodeWindow
ID_SYMBOLLIST
};
enum
{
Toolbar_DebugGo,
Toolbar_Pause,
Toolbar_Step,
Toolbar_StepOver,
Toolbar_Skip,
Toolbar_GotoPC,
Toolbar_SetPC,
Bitmaps_max
};
// Settings
bool bAutomaticStart; bool bBootToPause;
bool bRegisterWindow;
@ -161,6 +152,9 @@ class CCodeWindow
void DoTip(wxString text);
void OnKeyDown(wxKeyEvent& event);
void InitBitmaps();
void CreateGUIControls(const SCoreStartupParameter& _LocalCoreStartupParameter);
wxMenuItem* jitblocklinking, *jitunlimited, *jitoff;
wxMenuItem* jitlsoff, *jitlslxzoff, *jitlslwzoff, *jitlslbzxoff;
wxMenuItem* jitlspoff;
@ -177,12 +171,7 @@ class CCodeWindow
wxListBox* calls;
Common::Event sync_event;
wxBitmap m_Bitmaps[Bitmaps_max];
DECLARE_EVENT_TABLE()
void InitBitmaps();
void CreateGUIControls(const SCoreStartupParameter& _LocalCoreStartupParameter);
DECLARE_EVENT_TABLE()
};
#endif /*CODEWINDOW_*/