void CFrame::DoAddPage(wxWindow *Win, int i, bool Float) { if (!Win) return; if (i < 0 || i > GetNotebookCount()-1) i = 0; if (Win && GetNotebookFromId(i)->GetPageIndex(Win) != wxNOT_FOUND) return; if (!Float) GetNotebookFromId(i)->AddPage(Win, Win->GetName(), true); else CreateParentFrame(Win->GetId() + IDM_LOGWINDOW_PARENT - IDM_LOGWINDOW, Win->GetName(), Win); }
void CFrame::DoAddPage(wxWindow *Win, int i, bool Float) { if (!Win) return; // Ensure accessor remains within valid bounds. if (i < 0 || i > GetNotebookCount() - 1) i = 0; // The page was already previously added, no need to add it again. if (Win && GetNotebookFromId(i)->GetPageIndex(Win) != wxNOT_FOUND) return; if (!Float) GetNotebookFromId(i)->AddPage(Win, Win->GetName(), true); else CreateParentFrame(Win->GetId() + IDM_LOG_WINDOW_PARENT - IDM_LOG_WINDOW, Win->GetName(), Win); }
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(); } } }