From 6f4a0903c01451168c20f7f7bf10953ffa41f8a0 Mon Sep 17 00:00:00 2001 From: John Peterson Date: Wed, 2 Sep 2009 15:23:53 +0000 Subject: [PATCH] GUI: Small bugfix, new panes were unfloatable by default git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4160 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/DolphinWX/Src/Frame.cpp | 4 ++-- Source/Core/DolphinWX/Src/Frame.h | 2 +- Source/Core/DolphinWX/Src/FrameAui.cpp | 23 ++++++++++++----------- Source/Core/DolphinWX/Src/Globals.h | 2 +- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index 6d2689f366..9c7c23ccf3 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -238,7 +238,7 @@ EVT_MENU(IDM_PERSPECTIVES_ADD_PANE, CFrame::OnToolBar) EVT_MENU_RANGE(IDM_PERSPECTIVES_0, IDM_PERSPECTIVES_100, CFrame::OnSelectPerspective) EVT_MENU(IDM_ADD_PERSPECTIVE, CFrame::OnDropDownToolbarSelect) EVT_MENU(IDM_TAB_SPLIT, CFrame::OnDropDownToolbarSelect) -EVT_MENU(IDM_FLOATABLE_PANES, CFrame::OnDropDownToolbarSelect) +EVT_MENU(IDM_NO_DOCKING, CFrame::OnDropDownToolbarSelect) #if defined(HAVE_SFML) && HAVE_SFML EVT_MENU(IDM_NETPLAY, CFrame::OnNetPlay) @@ -313,7 +313,7 @@ CFrame::CFrame(wxFrame* parent, : wxFrame(parent, id, title, pos, size, style) , m_LogWindow(NULL), m_ToolBar(NULL), m_ToolBarDebug(NULL), m_ToolBarAui(NULL) , m_pStatusBar(NULL), m_GameListCtrl(NULL), m_Panel(NULL) - , UseDebugger(_UseDebugger), m_bEdit(false), m_bTabSplit(false), m_bFloatPane(false), bRenderToMain(true) + , UseDebugger(_UseDebugger), m_bEdit(false), m_bTabSplit(false), m_bNoDocking(false), bRenderToMain(true) , HaveLeds(false), HaveSpeakers(false) , m_fLastClickTime(0), m_iLastMotionTime(0), LastMouseX(0), LastMouseY(0) #if wxUSE_TIMER diff --git a/Source/Core/DolphinWX/Src/Frame.h b/Source/Core/DolphinWX/Src/Frame.h index 2546fb9df6..f494683f93 100644 --- a/Source/Core/DolphinWX/Src/Frame.h +++ b/Source/Core/DolphinWX/Src/Frame.h @@ -168,7 +168,7 @@ class CFrame : public wxFrame bool UseDebugger; bool m_bEdit; bool m_bTabSplit; - bool m_bFloatPane; + bool m_bNoDocking; char **drives; diff --git a/Source/Core/DolphinWX/Src/FrameAui.cpp b/Source/Core/DolphinWX/Src/FrameAui.cpp index 439f9c2dea..85dd97bd91 100644 --- a/Source/Core/DolphinWX/Src/FrameAui.cpp +++ b/Source/Core/DolphinWX/Src/FrameAui.cpp @@ -534,10 +534,10 @@ void CFrame::OnDropDownSettingsToolbar(wxAuiToolBarEvent& event) menuPopup.Append(new wxMenuItem(&menuPopup)); Item = new wxMenuItem(&menuPopup, IDM_TAB_SPLIT, wxT("Tab split"), wxT(""), wxITEM_CHECK); menuPopup.Append(Item); - if (m_bTabSplit) Item->Check(true); - Item = new wxMenuItem(&menuPopup, IDM_FLOATABLE_PANES, wxT("No docking"), wxT(""), wxITEM_CHECK); + Item->Check(m_bTabSplit); + Item = new wxMenuItem(&menuPopup, IDM_NO_DOCKING, wxT("No docking"), wxT(""), wxITEM_CHECK); menuPopup.Append(Item); - if (m_bFloatPane) Item->Check(true); + Item->Check(m_bNoDocking); // Line up our menu with the button wxRect rect = Tb->GetToolRect(event.GetId()); @@ -656,9 +656,9 @@ void CFrame::OnDropDownToolbarSelect(wxCommandEvent& event) m_bTabSplit = event.IsChecked(); ToggleNotebookStyle(wxAUI_NB_TAB_SPLIT); break; - case IDM_FLOATABLE_PANES: - m_bFloatPane = event.IsChecked(); - TogglePaneStyle(m_bFloatPane, IDM_FLOATABLE_PANES); + case IDM_NO_DOCKING: + m_bNoDocking = event.IsChecked(); + TogglePaneStyle(m_bNoDocking, IDM_NO_DOCKING); break; } } @@ -712,12 +712,12 @@ void CFrame::TogglePaneStyle(bool On, int EventId) Pane.Dockable(On); break; /* - case IDM_FLOATABLE_PANES: + case IDM_NO_DOCKING: Pane.Dockable(!On); break; */ } - Pane.Dockable(!m_bFloatPane); + Pane.Dockable(!m_bNoDocking); } } m_Mgr->Update(); @@ -964,7 +964,7 @@ void CFrame::ReloadPanes() for (u32 i = 0; i < Perspectives.at(ActivePerspective).Width.size() - 1; i++) { m_Mgr->AddPane(CreateEmptyNotebook(), wxAuiPaneInfo().Hide() - .CaptionVisible(m_bEdit).Floatable(m_bFloatPane)); + .CaptionVisible(m_bEdit).Dockable(!m_bNoDocking)); } HideAllNotebooks(true); @@ -975,7 +975,7 @@ void CFrame::ReloadPanes() // Reset toolbars ResetToolbarStyle(); // Restore settings - TogglePaneStyle(m_bFloatPane, IDM_FLOATABLE_PANES); + TogglePaneStyle(m_bNoDocking, IDM_NO_DOCKING); TogglePaneStyle(m_bEdit, IDM_EDIT_PERSPECTIVES); } // Create one pane by default @@ -1148,7 +1148,8 @@ void CFrame::NamePanes() void CFrame::AddPane() { m_Mgr->AddPane(CreateEmptyNotebook(), wxAuiPaneInfo() - .CaptionVisible(m_bEdit).Floatable(m_bFloatPane)); + .CaptionVisible(m_bEdit).Dockable(!m_bNoDocking)); + NamePanes(); AddRemoveBlankPage(); m_Mgr->Update(); diff --git a/Source/Core/DolphinWX/Src/Globals.h b/Source/Core/DolphinWX/Src/Globals.h index ad8c1f6bc8..8c64134a54 100644 --- a/Source/Core/DolphinWX/Src/Globals.h +++ b/Source/Core/DolphinWX/Src/Globals.h @@ -182,7 +182,7 @@ enum IDM_PERSPECTIVES_ADD_PANE, IDM_EDIT_PERSPECTIVES, IDM_TAB_SPLIT, - IDM_FLOATABLE_PANES, + IDM_NO_DOCKING, IDM_PERSPECTIVES_0, IDM_PERSPECTIVES_100 = IDM_PERSPECTIVES_0 + 100, // --------------------------------------------------------------