void CFrame::ReloadPanes() { // Close all pages ClosePages(); CloseAllNotebooks(); // Create new panes with notebooks for (u32 i = 0; i < Perspectives[ActivePerspective].Width.size() - 1; i++) { wxString PaneName = wxString::Format("Pane %i", i + 1); m_Mgr->AddPane(CreateEmptyNotebook(), wxAuiPaneInfo().Hide() .CaptionVisible(m_bEdit).Dockable(!m_bNoDocking).Position(i) .Name(PaneName).Caption(PaneName)); } // Perspectives m_Mgr->LoadPerspective(Perspectives[ActivePerspective].Perspective, false); // Restore settings TogglePaneStyle(m_bNoDocking, IDM_NO_DOCKING); TogglePaneStyle(m_bEdit, IDM_EDIT_PERSPECTIVES); // Load GUI settings g_pCodeWindow->Load(); // Open notebook pages AddRemoveBlankPage(); g_pCodeWindow->OpenPages(); // Repopulate perspectives PopulateSavedPerspectives(); }
void CFrame::AddPane(int dir) { int PaneNum = GetNotebookCount() + 1; wxString PaneName = wxString::Format("Pane %i", PaneNum); wxAuiPaneInfo PaneInfo = wxAuiPaneInfo() .CaptionVisible(m_bEdit).Dockable(!m_bNoDocking) .Name(PaneName).Caption(PaneName) .Position(GetNotebookCount()); switch (dir) { case ADD_PANE_TOP: PaneInfo = PaneInfo.Top(); break; case ADD_PANE_BOTTOM: PaneInfo = PaneInfo.Bottom(); break; case ADD_PANE_LEFT: PaneInfo = PaneInfo.Left(); break; case ADD_PANE_RIGHT: PaneInfo = PaneInfo.Right(); break; case ADD_PANE_CENTER: PaneInfo = PaneInfo.Center(); break; default: break; } m_Mgr->AddPane(CreateEmptyNotebook(), PaneInfo); AddRemoveBlankPage(); m_Mgr->Update(); }
void CFrame::AddPane() { int PaneNum = GetNotebookCount() + 1; wxString PaneName = wxString::Format("Pane %i", PaneNum); m_Mgr->AddPane(CreateEmptyNotebook(), wxAuiPaneInfo() .CaptionVisible(m_bEdit).Dockable(!m_bNoDocking) .Name(PaneName).Caption(PaneName) .Position(GetNotebookCount())); AddRemoveBlankPage(); m_Mgr->Update(); }
void CFrame::OnNotebookPageChanged(wxAuiNotebookEvent& event) { event.Skip(); if (!g_pCodeWindow) return; // Remove the blank page if any AddRemoveBlankPage(); // Update the notebook affiliation for (int i = IDM_LOGWINDOW; i <= IDM_CODEWINDOW; i++) { if(GetNotebookAffiliation(i) >= 0) g_pCodeWindow->iNbAffiliation[i - IDM_LOGWINDOW] = GetNotebookAffiliation(i); } }
void CFrame::DoRemovePage(wxWindow *Win, bool bHide) { if (!Win) return; wxWindow *Parent = FindWindowById(Win->GetId() + IDM_LOG_WINDOW_PARENT - IDM_LOG_WINDOW); if (Parent) { if (bHide) { Win->Hide(); Win->Reparent(this); } else { Win->Destroy(); } Parent->Destroy(); } else { for (int i = 0; i < GetNotebookCount(); i++) { int PageIndex = GetNotebookFromId(i)->GetPageIndex(Win); if (PageIndex != wxNOT_FOUND) { GetNotebookFromId(i)->RemovePage(PageIndex); if (bHide) { Win->Hide(); Win->Reparent(this); } else { Win->Destroy(); } } } } if (g_pCodeWindow) AddRemoveBlankPage(); }
void CFrame::DoFloatNotebookPage(wxWindowID Id) { wxPanel *Win = (wxPanel*)FindWindowById(Id); if (!Win) return; for (int i = 0; i < GetNotebookCount(); i++) { wxAuiNotebook *nb = GetNotebookFromId(i); if (nb->GetPageIndex(Win) != wxNOT_FOUND) { nb->RemovePage(nb->GetPageIndex(Win)); // Create the parent frame and reparent the window CreateParentFrame(Win->GetId() + IDM_LOG_WINDOW_PARENT - IDM_LOG_WINDOW, Win->GetName(), Win); if (nb->GetPageCount() == 0) AddRemoveBlankPage(); } } }