GUI: Tab split option in toolbar

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4083 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson
2009-08-27 17:17:48 +00:00
parent e15de53f15
commit f9cf9c7610
4 changed files with 26 additions and 4 deletions

View File

@ -247,6 +247,7 @@ EVT_MENU(IDM_CONFIG_WIIMOTE_PLUGIN, CFrame::OnPluginWiimote)
EVT_MENU(IDM_PERSPECTIVE_0, CFrame::OnToolBar) EVT_MENU(IDM_PERSPECTIVE_0, CFrame::OnToolBar)
EVT_MENU(IDM_PERSPECTIVE_1, CFrame::OnToolBar) EVT_MENU(IDM_PERSPECTIVE_1, CFrame::OnToolBar)
EVT_MENU(IDM_TAB_SPLIT, CFrame::OnToolBar)
#if defined(HAVE_SFML) && HAVE_SFML #if defined(HAVE_SFML) && HAVE_SFML
EVT_MENU(IDM_NETPLAY, CFrame::OnNetPlay) EVT_MENU(IDM_NETPLAY, CFrame::OnNetPlay)
@ -372,7 +373,7 @@ CFrame::CFrame(bool showLogWindow,
m_Panel = new CPanel(this, IDM_MPANEL); m_Panel = new CPanel(this, IDM_MPANEL);
//wxPanel * m_Panel2 = new wxPanel(this, wxID_ANY); //wxPanel * m_Panel2 = new wxPanel(this, wxID_ANY);
static int Style = wxAUI_NB_TOP | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS | wxAUI_NB_TAB_EXTERNAL_MOVE | wxNO_BORDER; static int Style = wxAUI_NB_TOP | wxAUI_NB_SCROLL_BUTTONS | wxAUI_NB_TAB_EXTERNAL_MOVE | wxNO_BORDER;
wxBitmap aNormalFile = wxArtProvider::GetBitmap(wxART_NORMAL_FILE, wxART_OTHER, wxSize(16,16)); wxBitmap aNormalFile = wxArtProvider::GetBitmap(wxART_NORMAL_FILE, wxART_OTHER, wxSize(16,16));
if (UseDebugger) if (UseDebugger)

View File

@ -115,6 +115,7 @@ class CFrame : public wxFrame
void HidePane(); void HidePane();
void SetSimplePaneSize(); void SetSimplePaneSize();
void SetPaneSize(wxArrayInt,wxArrayInt); void SetPaneSize(wxArrayInt,wxArrayInt);
void ToggleNotebookStyle(long);
void Save(); void Save();
private: private:

View File

@ -282,8 +282,9 @@ void CFrame::PopulateToolbarAui(wxAuiToolBar* ToolBar)
h = m_Bitmaps[Toolbar_FileOpen].GetHeight(); h = m_Bitmaps[Toolbar_FileOpen].GetHeight();
ToolBar->SetToolBitmapSize(wxSize(w, h)); ToolBar->SetToolBitmapSize(wxSize(w, h));
ToolBar->AddTool(IDM_PERSPECTIVE_0, wxT("View 1"), g_pCodeWindow->m_Bitmaps[Toolbar_GotoPC], wxT("View 1")); ToolBar->AddTool(IDM_PERSPECTIVE_0, wxT("View 1"), g_pCodeWindow->m_Bitmaps[Toolbar_GotoPC], wxT("View 1"), wxITEM_CHECK);
ToolBar->AddTool(IDM_PERSPECTIVE_1, wxT("View 2"), g_pCodeWindow->m_Bitmaps[Toolbar_GotoPC], wxT("View 2")); ToolBar->AddTool(IDM_PERSPECTIVE_1, wxT("View 2"), g_pCodeWindow->m_Bitmaps[Toolbar_GotoPC], wxT("View 2"), wxITEM_CHECK);
ToolBar->AddTool(IDM_TAB_SPLIT, wxT("Split"), g_pCodeWindow->m_Bitmaps[Toolbar_GotoPC], wxT("Tab Split"), wxITEM_CHECK);
ToolBar->Realize(); ToolBar->Realize();
} }
@ -719,11 +720,30 @@ void CFrame::OnToolBar(wxCommandEvent& event)
switch (event.GetId()) switch (event.GetId())
{ {
case IDM_PERSPECTIVE_0: case IDM_PERSPECTIVE_0:
m_ToolBarAui->ToggleTool(IDM_PERSPECTIVE_1, false);
DoLoadPerspective(0); DoLoadPerspective(0);
break; break;
case IDM_PERSPECTIVE_1: case IDM_PERSPECTIVE_1:
m_ToolBarAui->ToggleTool(IDM_PERSPECTIVE_0, false);
DoLoadPerspective(1); DoLoadPerspective(1);
break; break;
case IDM_TAB_SPLIT:
ToggleNotebookStyle(wxAUI_NB_TAB_SPLIT);
break;
}
}
void CFrame::ToggleNotebookStyle(long Style)
{
wxAuiPaneInfoArray& AllPanes = m_Mgr->GetAllPanes();
for (int i = 0, Count = AllPanes.GetCount(); i < Count; ++i)
{
wxAuiPaneInfo& Pane = AllPanes.Item(i);
if (Pane.window->IsKindOf(CLASSINFO(wxAuiNotebook)))
{
wxAuiNotebook* NB = (wxAuiNotebook*)Pane.window;
NB->SetWindowStyleFlag(NB->GetWindowStyleFlag() ^ Style);
NB->Refresh();
}
} }
} }
///////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -1096,7 +1116,6 @@ void CFrame::UpdateGUI()
m_ToolBar->SetToolLabel(IDM_PLAY, _("Pause")); m_ToolBar->SetToolLabel(IDM_PLAY, _("Pause"));
} }
GetMenuBar()->FindItem(IDM_PLAY)->SetText(_("&Pause\tF10")); GetMenuBar()->FindItem(IDM_PLAY)->SetText(_("&Pause\tF10"));
} }
else else
{ {

View File

@ -179,6 +179,7 @@ enum
ID_TOOLBAR_AUI, ID_TOOLBAR_AUI,
IDM_PERSPECTIVE_0, IDM_PERSPECTIVE_0,
IDM_PERSPECTIVE_1, IDM_PERSPECTIVE_1,
IDM_TAB_SPLIT,
// -------------------------------------------------------------- // --------------------------------------------------------------
IDM_TOGGLE_DUALCORE, // Other IDM_TOGGLE_DUALCORE, // Other