void CFrame::ToggleLogWindow(bool bShow) { if (!m_LogWindow) return; GetMenuBar()->FindItem(IDM_LOG_WINDOW)->Check(bShow); if (bShow) { // Create a new log window if it doesn't exist. if (!m_LogWindow) { m_LogWindow = new CLogWindow(this, IDM_LOG_WINDOW); } m_LogWindow->Enable(); DoAddPage(m_LogWindow, g_pCodeWindow ? g_pCodeWindow->iNbAffiliation[0] : 0, g_pCodeWindow ? bFloatWindow[0] : false); } else { // Hiding the log window, so disable it and remove it. m_LogWindow->Disable(); DoRemovePage(m_LogWindow, true); } // Hide or Show the pane if (!g_pCodeWindow) TogglePane(); }
void CFrame::ToggleLogWindow(bool bShow) { if (!m_LogWindow) return; GetMenuBar()->FindItem(IDM_LOGWINDOW)->Check(bShow); if (bShow) { if (!m_LogWindow) m_LogWindow = new CLogWindow(this, IDM_LOGWINDOW); m_LogWindow->Enable(); DoAddPage(m_LogWindow, g_pCodeWindow ? g_pCodeWindow->iNbAffiliation[0] : 0, g_pCodeWindow ? bFloatWindow[0] : false); } else { m_LogWindow->Disable(); DoRemovePage(m_LogWindow, true); } // Hide or Show the pane if (!g_pCodeWindow) TogglePane(); }
bool wxBookCtrlBase::DeletePage(size_t nPage) { wxWindow *page = DoRemovePage(nPage); if ( !(page || AllowNullPage()) ) return false; // delete NULL is harmless delete page; return true; }
bool wxTreebook::DeletePage(size_t pagePos) { wxCHECK_MSG( IS_VALID_PAGE(pagePos), false, wxT("Invalid tree index") ); wxTreebookPage *oldPage = DoRemovePage(pagePos); if ( !oldPage ) return false; delete oldPage; return true; }
void CFrame::ToggleConsole(bool bShow) { #ifdef _WIN32 GetMenuBar()->FindItem(IDM_CONSOLEWINDOW)->Check(bShow); if (bShow) { // If the console doesn't exist, we create it if (!GetConsoleWindow()) { ConsoleListener *Console = LogManager::GetInstance()->GetConsoleListener(); Console->Open(); } else { ShowWindow(GetConsoleWindow(), SW_SHOW); } // Create the parent window if it doesn't exist wxPanel *ConsoleParent = (wxPanel*)FindWindowById(IDM_CONSOLEWINDOW); if (!ConsoleParent) ConsoleParent = new wxPanel(this, IDM_CONSOLEWINDOW, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _("Console")); wxWindow *ConsoleWin = new wxWindow(); ConsoleWin->SetHWND((WXHWND)GetConsoleWindow()); ConsoleWin->AdoptAttributesFromHWND(); ConsoleWin->Reparent(ConsoleParent); ConsoleParent->Enable(); const int nbIndex = IDM_CONSOLEWINDOW - IDM_LOGWINDOW; DoAddPage(ConsoleParent, g_pCodeWindow ? g_pCodeWindow->iNbAffiliation[nbIndex] : 0, g_pCodeWindow ? bFloatWindow[nbIndex] : false); } else // Hide { if(GetConsoleWindow()) ShowWindow(GetConsoleWindow(), SW_HIDE); // WIN32 wxPanel *ConsoleParent = (wxPanel*)FindWindowById(IDM_CONSOLEWINDOW); if (ConsoleParent) ConsoleParent->Disable(); // Then close the page DoRemovePage(ConsoleParent, true); } // Hide or Show the pane if (!g_pCodeWindow) TogglePane(); #endif }
void CFrame::ToggleLogConfigWindow(bool bShow) { GetMenuBar()->FindItem(IDM_LOGCONFIGWINDOW)->Check(bShow); if (bShow) { if (!m_LogConfigWindow) m_LogConfigWindow = new LogConfigWindow(this, m_LogWindow, IDM_LOGCONFIGWINDOW); const int nbIndex = IDM_LOGCONFIGWINDOW - IDM_LOGWINDOW; DoAddPage(m_LogConfigWindow, g_pCodeWindow ? g_pCodeWindow->iNbAffiliation[nbIndex] : 0, g_pCodeWindow ? bFloatWindow[nbIndex] : false); } else { DoRemovePage(m_LogConfigWindow, false); m_LogConfigWindow = NULL; } // Hide or Show the pane if (!g_pCodeWindow) TogglePane(); }