diff options
| author | shuffle2 <godisgovernment@gmail.com> | 2014-08-11 20:12:24 -0700 |
|---|---|---|
| committer | shuffle2 <godisgovernment@gmail.com> | 2014-08-11 20:12:24 -0700 |
| commit | 0b27e0f3f080d8550d907ec63b17360ba85d7349 (patch) | |
| tree | 7668a0d67240e2e9abc80c62620c8feaef6d949b /Source/Core/DolphinWX/FrameTools.cpp | |
| parent | edf660f21fcb01b52d9588d8e66367e1b6fefb5f (diff) | |
| parent | d46ca557b8d52948112cbb8f0622d9588172f8a9 (diff) | |
Merge pull request #761 from archshift/better-toolbar
Changed main toolbar to be flush with the rest of the window.
Diffstat (limited to 'Source/Core/DolphinWX/FrameTools.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/FrameTools.cpp | 102 |
1 files changed, 29 insertions, 73 deletions
diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp index 3310623c2c..d1303d3ee3 100644 --- a/Source/Core/DolphinWX/FrameTools.cpp +++ b/Source/Core/DolphinWX/FrameTools.cpp @@ -36,11 +36,11 @@ Core::GetWindowHandle(). #include <wx/strconv.h> #include <wx/string.h> #include <wx/thread.h> +#include <wx/toolbar.h> #include <wx/toplevel.h> #include <wx/translation.h> #include <wx/utils.h> #include <wx/window.h> -#include <wx/aui/auibar.h> #include <wx/aui/framemanager.h> #ifdef __APPLE__ @@ -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(); @@ -528,21 +528,6 @@ void CFrame::PopulateToolbar(wxAuiToolBar* 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() @@ -553,32 +538,19 @@ 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 = wxTB_DEFAULT_STYLE | wxTB_TEXT; - 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) + if (!m_ToolBar) { - m_ToolBarDebug = new wxAuiToolBar(this, ID_TOOLBAR_DEBUG, wxDefaultPosition, wxDefaultSize, TOOLBAR_STYLE); - g_pCodeWindow->PopulateToolbar(m_ToolBarDebug); + m_ToolBar = CreateToolBar(TOOLBAR_STYLE, wxID_ANY, "TBMain"); - m_Mgr->AddPane(m_ToolBarDebug, wxAuiPaneInfo(). - Name("TBDebug").Caption("TBDebug"). - ToolbarPane().Top(). - LeftDockable(false).RightDockable(false).Floatable(false)); + if (g_pCodeWindow) + { + g_pCodeWindow->PopulateToolbar(m_ToolBar); + m_ToolBar->AddSeparator(); + } - 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)); + PopulateToolbar(m_ToolBar); } UpdateGUI(); @@ -1721,22 +1693,25 @@ 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")); + m_ToolBar->SetToolNormalBitmap(IDM_PLAY, m_Bitmaps[Toolbar_Pause]); + } + else + { + PlayTool->SetLabel(_("Play")); + PlayTool->SetShortHelp(_("Play")); + m_ToolBar->SetToolNormalBitmap(IDM_PLAY, m_Bitmaps[Toolbar_Play]); + } } } @@ -1898,26 +1873,7 @@ void CFrame::OnToggleToolbar(wxCommandEvent& event) } void CFrame::DoToggleToolbar(bool _show) { - if (_show) - { - m_Mgr->GetPane("TBMain").Show(); - if (g_pCodeWindow) - { - m_Mgr->GetPane("TBDebug").Show(); - m_Mgr->GetPane("TBAui").Show(); - } - m_Mgr->Update(); - } - else - { - m_Mgr->GetPane("TBMain").Hide(); - if (g_pCodeWindow) - { - m_Mgr->GetPane("TBDebug").Hide(); - m_Mgr->GetPane("TBAui").Hide(); - } - m_Mgr->Update(); - } + GetToolBar()->Show(_show); } // Enable and disable the status bar |
