Changed toolbar to be static, increasing UI integration

This commit is contained in:
archshift 2014-08-08 03:43:13 -07:00
parent b38022df43
commit 019d5aee49
5 changed files with 34 additions and 38 deletions

View File

@ -128,7 +128,7 @@ wxMenuBar *CCodeWindow::GetMenuBar()
return Parent->GetMenuBar();
}
wxAuiToolBar *CCodeWindow::GetToolBar()
wxToolBar *CCodeWindow::GetToolBar()
{
return Parent->m_ToolBarDebug;
}
@ -588,7 +588,7 @@ void CCodeWindow::InitBitmaps()
bitmap = wxBitmap(bitmap.ConvertToImage().Scale(24, 24));
}
void CCodeWindow::PopulateToolbar(wxAuiToolBar* toolBar)
void CCodeWindow::PopulateToolbar(wxToolBar* toolBar)
{
int w = m_Bitmaps[0].GetWidth(),
h = m_Bitmaps[0].GetHeight();
@ -625,7 +625,7 @@ void CCodeWindow::UpdateButtonStates()
bool Initialized = (Core::GetState() != Core::CORE_UNINITIALIZED);
bool Pause = (Core::GetState() == Core::CORE_PAUSE);
bool Stepping = CCPU::IsStepping();
wxAuiToolBar* ToolBar = GetToolBar();
wxToolBar* ToolBar = GetToolBar();
// Toolbar
if (!ToolBar)

View File

@ -27,7 +27,7 @@ class DSPDebuggerLLE;
class GFXDebuggerPanel;
struct SCoreStartupParameter;
class wxAuiToolBar;
class wxToolBar;
class wxListBox;
class wxMenu;
class wxMenuBar;
@ -52,7 +52,7 @@ class CCodeWindow
// Parent interaction
CFrame *Parent;
wxMenuBar * GetMenuBar();
wxAuiToolBar * GetToolBar();
wxToolBar * GetToolBar();
wxBitmap m_Bitmaps[ToolbarDebugBitmapMax];
bool UseInterpreter();
@ -67,8 +67,8 @@ class CCodeWindow
void CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParameter, wxMenuBar *pMenuBar);
void CreateMenuOptions(wxMenu *pMenu);
void CreateMenuSymbols(wxMenuBar *pMenuBar);
void RecreateToolbar(wxAuiToolBar*);
void PopulateToolbar(wxAuiToolBar* toolBar);
void RecreateToolbar(wxToolBar*);
void PopulateToolbar(wxToolBar* toolBar);
void UpdateButtonStates();
void OpenPages();
void UpdateManager();

View File

@ -138,9 +138,10 @@ public:
X11Utils::XRRConfiguration *m_XRRConfig;
#endif
wxToolBar *m_ToolBar, *m_ToolBarDebug;
// AUI
wxAuiManager *m_Mgr;
wxAuiToolBar *m_ToolBar, *m_ToolBarDebug, *m_ToolBarAui;
wxAuiToolBar *m_ToolBarAui;
bool bFloatWindow[IDM_CODEWINDOW - IDM_LOGWINDOW + 1];
// Perspectives (Should find a way to make all of this private)
@ -195,7 +196,7 @@ private:
wxBitmap m_Bitmaps[EToolbar_Max];
wxBitmap m_BitmapsMenu[EToolbar_Max];
void PopulateToolbar(wxAuiToolBar* toolBar);
void PopulateToolbar(wxToolBar* toolBar);
void PopulateToolbarAui(wxAuiToolBar* toolBar);
void RecreateToolbar();
void CreateMenu();

View File

@ -584,7 +584,7 @@ void CFrame::OnToolBar(wxCommandEvent& event)
break;
case IDM_EDIT_PERSPECTIVES:
m_bEdit = !m_bEdit;
m_ToolBarAui->SetToolSticky(IDM_EDIT_PERSPECTIVES, m_bEdit);
//m_ToolBarAui->SetToolSticky(IDM_EDIT_PERSPECTIVES, m_bEdit);
TogglePaneStyle(m_bEdit, IDM_EDIT_PERSPECTIVES);
break;
}

View File

@ -501,7 +501,7 @@ wxString CFrame::GetMenuLabel(int Id)
// Create toolbar items
// ---------------------
void CFrame::PopulateToolbar(wxAuiToolBar* ToolBar)
void CFrame::PopulateToolbar(wxToolBar* ToolBar)
{
int w = m_Bitmaps[Toolbar_FileOpen].GetWidth(),
h = m_Bitmaps[Toolbar_FileOpen].GetHeight();
@ -553,26 +553,16 @@ void CFrame::RecreateToolbar()
m_ToolBar->Destroy();
}
long TOOLBAR_STYLE = wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_TEXT /*wxAUI_TB_OVERFLOW overflow visible*/;
m_ToolBar = new wxAuiToolBar(this, ID_TOOLBAR, wxDefaultPosition, wxDefaultSize, TOOLBAR_STYLE);
long TOOLBAR_STYLE = wxAUI_TB_PLAIN_BACKGROUND | wxAUI_TB_TEXT /*wxAUI_TB_OVERFLOW overflow visible*/;
m_ToolBar = CreateToolBar(TOOLBAR_STYLE, wxID_ANY, "TBMain");
PopulateToolbar(m_ToolBar);
m_Mgr->AddPane(m_ToolBar, wxAuiPaneInfo().
Name("TBMain").Caption("TBMain").
ToolbarPane().Top().
LeftDockable(false).RightDockable(false).Floatable(false));
if (g_pCodeWindow && !m_ToolBarDebug)
{
m_ToolBarDebug = new wxAuiToolBar(this, ID_TOOLBAR_DEBUG, wxDefaultPosition, wxDefaultSize, TOOLBAR_STYLE);
m_ToolBarDebug = CreateToolBar(TOOLBAR_STYLE, wxID_ANY, "TBDebug");
g_pCodeWindow->PopulateToolbar(m_ToolBarDebug);
m_Mgr->AddPane(m_ToolBarDebug, wxAuiPaneInfo().
Name("TBDebug").Caption("TBDebug").
ToolbarPane().Top().
LeftDockable(false).RightDockable(false).Floatable(false));
m_ToolBarAui = new wxAuiToolBar(this, ID_TOOLBAR_AUI, wxDefaultPosition, wxDefaultSize, TOOLBAR_STYLE);
PopulateToolbarAui(m_ToolBarAui);
m_Mgr->AddPane(m_ToolBarAui, wxAuiPaneInfo().
@ -1721,22 +1711,27 @@ void CFrame::UpdateGUI()
AccessWiiMote(0x0104)->IsConnected());
}
if (Running)
if (m_ToolBar)
{
if (m_ToolBar)
// Get the tool that controls pausing/playing
wxToolBarToolBase * PlayTool = m_ToolBar->FindById(IDM_PLAY);
if (PlayTool)
{
m_ToolBar->SetToolBitmap(IDM_PLAY, m_Bitmaps[Toolbar_Pause]);
m_ToolBar->SetToolShortHelp(IDM_PLAY, _("Pause"));
m_ToolBar->SetToolLabel(IDM_PLAY, _("Pause"));
}
}
else
{
if (m_ToolBar)
{
m_ToolBar->SetToolBitmap(IDM_PLAY, m_Bitmaps[Toolbar_Play]);
m_ToolBar->SetToolShortHelp(IDM_PLAY, _("Play"));
m_ToolBar->SetToolLabel(IDM_PLAY, _("Play"));
if (Running)
{
PlayTool->SetLabel(_("Pause"));
PlayTool->SetShortHelp(_("Pause"));
// TODO: Change icon
// m_ToolBar->SetToolBitmap(IDM_PLAY, m_Bitmaps[Toolbar_Pause]);
}
else
{
PlayTool->SetLabel(_("Play"));
PlayTool->SetShortHelp(_("Play"));
// TODO: Change icon
// m_ToolBar->SetToolBitmap(IDM_PLAY, m_Bitmaps[Toolbar_Play]);
}
}
}