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(); }
CFrame::CFrame(wxFrame* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, bool _UseDebugger, bool _BatchMode, bool ShowLogWindow, long style) : CRenderFrame(parent, id, title, pos, size, style) , g_pCodeWindow(NULL), g_NetPlaySetupDiag(NULL), g_CheatsWindow(NULL) , m_ToolBar(NULL), m_ToolBarDebug(NULL), m_ToolBarAui(NULL) , m_GameListCtrl(NULL), m_Panel(NULL) , m_RenderFrame(NULL), m_RenderParent(NULL) , m_LogWindow(NULL), m_LogConfigWindow(NULL) , m_FifoPlayerDlg(NULL), UseDebugger(_UseDebugger) , m_bBatchMode(_BatchMode), m_bEdit(false), m_bTabSplit(false), m_bNoDocking(false) , m_bGameLoading(false) { for (int i = 0; i <= IDM_CODEWINDOW - IDM_LOGWINDOW; i++) bFloatWindow[i] = false; if (ShowLogWindow) SConfig::GetInstance().m_InterfaceLogWindow = true; // Give it a console early to show potential messages from this onward ConsoleListener *Console = LogManager::GetInstance()->GetConsoleListener(); if (SConfig::GetInstance().m_InterfaceConsole) Console->Open(); // Start debugging maximized if (UseDebugger) this->Maximize(true); // Debugger class if (UseDebugger) { g_pCodeWindow = new CCodeWindow(SConfig::GetInstance().m_LocalCoreStartupParameter, this, IDM_CODEWINDOW); LoadIniPerspectives(); g_pCodeWindow->Load(); } // Create toolbar bitmaps InitBitmaps(); // Give it a status bar SetStatusBar(CreateStatusBar(2, wxST_SIZEGRIP, ID_STATUSBAR)); if (!SConfig::GetInstance().m_InterfaceStatusbar) GetStatusBar()->Hide(); // Give it a menu bar CreateMenu(); // --------------- // Main panel // This panel is the parent for rendering and it holds the gamelistctrl m_Panel = new CPanel(this, IDM_MPANEL); m_GameListCtrl = new CGameListCtrl(m_Panel, LIST_CTRL, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxSUNKEN_BORDER | wxLC_ALIGN_LEFT); wxBoxSizer *sizerPanel = new wxBoxSizer(wxHORIZONTAL); sizerPanel->Add(m_GameListCtrl, 1, wxEXPAND | wxALL); m_Panel->SetSizer(sizerPanel); // --------------- // Manager m_Mgr = new wxAuiManager(this, wxAUI_MGR_DEFAULT | wxAUI_MGR_LIVE_RESIZE); m_Mgr->AddPane(m_Panel, wxAuiPaneInfo() .Name(_T("Pane 0")).Caption(_T("Pane 0")).PaneBorder(false) .CaptionVisible(false).Layer(0).Center().Show()); if (!g_pCodeWindow) m_Mgr->AddPane(CreateEmptyNotebook(), wxAuiPaneInfo() .Name(_T("Pane 1")).Caption(_("Logging")).CaptionVisible(true) .Layer(0).FloatingSize(wxSize(600, 350)).CloseButton(true).Hide()); AuiFullscreen = m_Mgr->SavePerspective(); // Create toolbar RecreateToolbar(); if (!SConfig::GetInstance().m_InterfaceToolbar) DoToggleToolbar(false); m_LogWindow = new CLogWindow(this, IDM_LOGWINDOW); m_LogWindow->Hide(); m_LogWindow->Disable(); g_TASInputDlg = new TASInputDlg(this); Movie::SetInputManip(TASManipFunction); State::SetOnAfterLoadCallback(OnAfterLoadCallback); // Setup perspectives if (g_pCodeWindow) { // Load perspective DoLoadPerspective(); } else { if (SConfig::GetInstance().m_InterfaceLogWindow) ToggleLogWindow(true); if (SConfig::GetInstance().m_InterfaceLogConfigWindow) ToggleLogConfigWindow(true); if (SConfig::GetInstance().m_InterfaceConsole) ToggleConsole(true); } // Show window Show(); // Commit m_Mgr->Update(); #ifdef _WIN32 SetToolTip(wxT("")); GetToolTip()->SetAutoPop(25000); #endif #if defined(HAVE_XRANDR) && HAVE_XRANDR m_XRRConfig = new X11Utils::XRRConfiguration(X11Utils::XDisplayFromHandle(GetHandle()), X11Utils::XWindowFromHandle(GetHandle())); #endif // ------------------------- // Connect event handlers m_Mgr->Bind(wxEVT_AUI_RENDER, &CFrame::OnManagerResize, this); // ---------- // Update controls UpdateGUI(); }