From 019d5aee498b04963c2a38cc200d607c288c9b64 Mon Sep 17 00:00:00 2001 From: archshift Date: Fri, 8 Aug 2014 03:43:13 -0700 Subject: Changed toolbar to be static, increasing UI integration --- Source/Core/DolphinWX/FrameTools.cpp | 51 ++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 28 deletions(-) (limited to 'Source/Core/DolphinWX/FrameTools.cpp') diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp index 3310623c2c..59037f872f 100644 --- a/Source/Core/DolphinWX/FrameTools.cpp +++ b/Source/Core/DolphinWX/FrameTools.cpp @@ -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) - { - 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) { - 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_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]); + } } } -- cgit v1.2.3 From 400a7bd6126bdb86eb2b6e000e9c393400e394b9 Mon Sep 17 00:00:00 2001 From: archshift Date: Fri, 8 Aug 2014 13:20:28 -0700 Subject: Switch play/pause button icons when necessary --- Source/Core/DolphinWX/FrameTools.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'Source/Core/DolphinWX/FrameTools.cpp') diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp index 59037f872f..49f4cb5e3d 100644 --- a/Source/Core/DolphinWX/FrameTools.cpp +++ b/Source/Core/DolphinWX/FrameTools.cpp @@ -1722,15 +1722,13 @@ void CFrame::UpdateGUI() { PlayTool->SetLabel(_("Pause")); PlayTool->SetShortHelp(_("Pause")); - // TODO: Change icon - // m_ToolBar->SetToolBitmap(IDM_PLAY, m_Bitmaps[Toolbar_Pause]); + m_ToolBar->SetToolNormalBitmap(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]); + m_ToolBar->SetToolNormalBitmap(IDM_PLAY, m_Bitmaps[Toolbar_Play]); } } } -- cgit v1.2.3 From 67d67884a1103de713a6d76b52524e94825ce0ce Mon Sep 17 00:00:00 2001 From: archshift Date: Fri, 8 Aug 2014 14:36:20 -0700 Subject: Allow toggling the toolbar in the menu --- Source/Core/DolphinWX/FrameTools.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'Source/Core/DolphinWX/FrameTools.cpp') diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp index 49f4cb5e3d..0115a9faac 100644 --- a/Source/Core/DolphinWX/FrameTools.cpp +++ b/Source/Core/DolphinWX/FrameTools.cpp @@ -1891,26 +1891,21 @@ void CFrame::OnToggleToolbar(wxCommandEvent& event) } void CFrame::DoToggleToolbar(bool _show) { - if (_show) + GetToolBar()->Show(_show); + + if (g_pCodeWindow) { - m_Mgr->GetPane("TBMain").Show(); - if (g_pCodeWindow) + if (_show) { - m_Mgr->GetPane("TBDebug").Show(); m_Mgr->GetPane("TBAui").Show(); } - m_Mgr->Update(); - } - else - { - m_Mgr->GetPane("TBMain").Hide(); - if (g_pCodeWindow) + else { - m_Mgr->GetPane("TBDebug").Hide(); m_Mgr->GetPane("TBAui").Hide(); } - m_Mgr->Update(); } + + m_Mgr->Update(); } // Enable and disable the status bar -- cgit v1.2.3 From 6cd0ebab9363f7c0335b6817379e77ddb0adb7a7 Mon Sep 17 00:00:00 2001 From: archshift Date: Fri, 8 Aug 2014 15:02:35 -0700 Subject: Included toolbar headers, preventing forward-decl errors --- Source/Core/DolphinWX/FrameTools.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'Source/Core/DolphinWX/FrameTools.cpp') diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp index 0115a9faac..03681c83df 100644 --- a/Source/Core/DolphinWX/FrameTools.cpp +++ b/Source/Core/DolphinWX/FrameTools.cpp @@ -36,6 +36,7 @@ Core::GetWindowHandle(). #include #include #include +#include #include #include #include -- cgit v1.2.3 From b8b72861b5a608add9e23a016ee18e02d7099ddb Mon Sep 17 00:00:00 2001 From: archshift Date: Sat, 9 Aug 2014 00:42:32 -0700 Subject: Removed AuiTB, moved functions to menubar (Debug->Perspectives) --- Source/Core/DolphinWX/FrameTools.cpp | 46 ++++-------------------------------- 1 file changed, 5 insertions(+), 41 deletions(-) (limited to 'Source/Core/DolphinWX/FrameTools.cpp') diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp index 03681c83df..59ed822bd8 100644 --- a/Source/Core/DolphinWX/FrameTools.cpp +++ b/Source/Core/DolphinWX/FrameTools.cpp @@ -41,7 +41,6 @@ Core::GetWindowHandle(). #include #include #include -#include #include #ifdef __APPLE__ @@ -529,21 +528,6 @@ void CFrame::PopulateToolbar(wxToolBar* ToolBar) ToolBar->Realize(); } -void CFrame::PopulateToolbarAui(wxAuiToolBar* ToolBar) -{ - int w = m_Bitmaps[Toolbar_FileOpen].GetWidth(), - h = m_Bitmaps[Toolbar_FileOpen].GetHeight(); - ToolBar->SetToolBitmapSize(wxSize(w, h)); - - ToolBar->AddTool(IDM_SAVE_PERSPECTIVE, _("Save"), g_pCodeWindow->m_Bitmaps[Toolbar_GotoPC], _("Save current perspective")); - ToolBar->AddTool(IDM_EDIT_PERSPECTIVES, _("Edit"), g_pCodeWindow->m_Bitmaps[Toolbar_GotoPC], _("Edit current perspective")); - - ToolBar->SetToolDropDown(IDM_SAVE_PERSPECTIVE, true); - ToolBar->SetToolDropDown(IDM_EDIT_PERSPECTIVES, true); - - ToolBar->Realize(); -} - // Delete and recreate the toolbar void CFrame::RecreateToolbar() @@ -554,24 +538,18 @@ void CFrame::RecreateToolbar() m_ToolBar->Destroy(); } - 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); + long TOOLBAR_STYLE = wxTB_DEFAULT_STYLE | wxTB_TEXT; if (g_pCodeWindow && !m_ToolBarDebug) { m_ToolBarDebug = CreateToolBar(TOOLBAR_STYLE, wxID_ANY, "TBDebug"); g_pCodeWindow->PopulateToolbar(m_ToolBarDebug); - - m_ToolBarAui = new wxAuiToolBar(this, ID_TOOLBAR_AUI, wxDefaultPosition, wxDefaultSize, TOOLBAR_STYLE); - PopulateToolbarAui(m_ToolBarAui); - m_Mgr->AddPane(m_ToolBarAui, wxAuiPaneInfo(). - Name("TBAui").Caption("TBAui"). - ToolbarPane().Top(). - LeftDockable(false).RightDockable(false).Floatable(false)); + m_ToolBarDebug->AddSeparator(); } + m_ToolBar = CreateToolBar(TOOLBAR_STYLE, wxID_ANY, "TBMain"); + PopulateToolbar(m_ToolBar); + UpdateGUI(); } @@ -1893,20 +1871,6 @@ void CFrame::OnToggleToolbar(wxCommandEvent& event) void CFrame::DoToggleToolbar(bool _show) { GetToolBar()->Show(_show); - - if (g_pCodeWindow) - { - if (_show) - { - m_Mgr->GetPane("TBAui").Show(); - } - else - { - m_Mgr->GetPane("TBAui").Hide(); - } - } - - m_Mgr->Update(); } // Enable and disable the status bar -- cgit v1.2.3 From b81617fba1d618d3f0c9b645fc057645616caa1f Mon Sep 17 00:00:00 2001 From: archshift Date: Sat, 9 Aug 2014 00:56:20 -0700 Subject: Removed TBDebug, using TBMain instead. Fixed debugger assert. --- Source/Core/DolphinWX/FrameTools.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'Source/Core/DolphinWX/FrameTools.cpp') diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp index 59ed822bd8..d1303d3ee3 100644 --- a/Source/Core/DolphinWX/FrameTools.cpp +++ b/Source/Core/DolphinWX/FrameTools.cpp @@ -540,15 +540,18 @@ void CFrame::RecreateToolbar() long TOOLBAR_STYLE = wxTB_DEFAULT_STYLE | wxTB_TEXT; - if (g_pCodeWindow && !m_ToolBarDebug) + if (!m_ToolBar) { - m_ToolBarDebug = CreateToolBar(TOOLBAR_STYLE, wxID_ANY, "TBDebug"); - g_pCodeWindow->PopulateToolbar(m_ToolBarDebug); - m_ToolBarDebug->AddSeparator(); - } + m_ToolBar = CreateToolBar(TOOLBAR_STYLE, wxID_ANY, "TBMain"); - m_ToolBar = CreateToolBar(TOOLBAR_STYLE, wxID_ANY, "TBMain"); - PopulateToolbar(m_ToolBar); + if (g_pCodeWindow) + { + g_pCodeWindow->PopulateToolbar(m_ToolBar); + m_ToolBar->AddSeparator(); + } + + PopulateToolbar(m_ToolBar); + } UpdateGUI(); } -- cgit v1.2.3