diff options
| author | archshift <admin@archshift.com> | 2014-08-15 22:33:58 -0700 |
|---|---|---|
| committer | archshift <admin@archshift.com> | 2014-08-17 12:57:44 -0700 |
| commit | b7f379768914e04f31e61e2026b287ae9a9acee2 (patch) | |
| tree | 86f436ebb05f9e1522c469a09bc9fa0c1fa061a9 /Source/Core/DolphinWX/FrameTools.cpp | |
| parent | b74a34795ba7162e825e20679536c1ed9a62c083 (diff) | |
Wx: further cleanup to toolbar creation process
Diffstat (limited to 'Source/Core/DolphinWX/FrameTools.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/FrameTools.cpp | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp index 1857cdda35..530d450ba6 100644 --- a/Source/Core/DolphinWX/FrameTools.cpp +++ b/Source/Core/DolphinWX/FrameTools.cpp @@ -522,38 +522,33 @@ void CFrame::PopulateToolbar(wxToolBar* ToolBar) WxUtils::AddToolbarButton(ToolBar, IDM_CONFIG_DSP_EMULATOR, _("DSP"), m_Bitmaps[Toolbar_ConfigDSP], _("DSP settings")); WxUtils::AddToolbarButton(ToolBar, IDM_CONFIG_PAD_PLUGIN, _("GCPad"), m_Bitmaps[Toolbar_ConfigPAD], _("GameCube Pad settings")); WxUtils::AddToolbarButton(ToolBar, IDM_CONFIG_WIIMOTE_PLUGIN, _("Wiimote"), m_Bitmaps[Toolbar_Wiimote], _("Wiimote settings")); - - // after adding the buttons to the toolbar, must call Realize() to reflect - // the changes - ToolBar->Realize(); } // Delete and recreate the toolbar void CFrame::RecreateToolbar() { - if (m_ToolBar) + static const long TOOLBAR_STYLE = wxTB_DEFAULT_STYLE | wxTB_TEXT; + + if (m_ToolBar != nullptr) { - m_Mgr->DetachPane(m_ToolBar); m_ToolBar->Destroy(); m_ToolBar = nullptr; } - long TOOLBAR_STYLE = wxTB_DEFAULT_STYLE | wxTB_TEXT; + m_ToolBar = CreateToolBar(TOOLBAR_STYLE, wxID_ANY); - if (!m_ToolBar) + if (g_pCodeWindow) { - m_ToolBar = CreateToolBar(TOOLBAR_STYLE, wxID_ANY, "TBMain"); - - if (g_pCodeWindow) - { - g_pCodeWindow->PopulateToolbar(m_ToolBar); - m_ToolBar->AddSeparator(); - } - - PopulateToolbar(m_ToolBar); + g_pCodeWindow->PopulateToolbar(m_ToolBar); + m_ToolBar->AddSeparator(); } + PopulateToolbar(m_ToolBar); + // after adding the buttons to the toolbar, must call Realize() to reflect + // the changes + m_ToolBar->Realize(); + UpdateGUI(); } |
