void CFrame::OnNotebookPageClose(wxAuiNotebookEvent& event) { // Override event event.Veto(); wxAuiNotebook* Ctrl = (wxAuiNotebook*)event.GetEventObject(); if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_LOGWINDOW) ToggleLogWindow(false); if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_LOGCONFIGWINDOW) ToggleLogConfigWindow(false); if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_CONSOLEWINDOW) ToggleConsole(false); if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_REGISTERWINDOW) g_pCodeWindow->ToggleRegisterWindow(false); if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_BREAKPOINTWINDOW) g_pCodeWindow->ToggleBreakPointWindow(false); if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_JITWINDOW) g_pCodeWindow->ToggleJitWindow(false); if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_MEMORYWINDOW) g_pCodeWindow->ToggleMemoryWindow(false); if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_SOUNDWINDOW) g_pCodeWindow->ToggleSoundWindow(false); if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_VIDEOWINDOW) g_pCodeWindow->ToggleVideoWindow(false); }
void CApplication::CharEvent(int c) { if (c == '`') { ToggleConsole(); return; } if (glgui::CRootPanel::Get()->CharPressed(c)) return; DoCharPress(c); }
// Notebooks // --------------------- void CFrame::ClosePages() { ToggleLogWindow(false); ToggleLogConfigWindow(false); ToggleConsole(false); if (g_pCodeWindow) { g_pCodeWindow->ToggleCodeWindow(false); g_pCodeWindow->ToggleRegisterWindow(false); g_pCodeWindow->ToggleBreakPointWindow(false); g_pCodeWindow->ToggleMemoryWindow(false); g_pCodeWindow->ToggleJitWindow(false); g_pCodeWindow->ToggleSoundWindow(false); g_pCodeWindow->ToggleVideoWindow(false); } }
void CFrame::OnPaneClose(wxAuiManagerEvent& event) { event.Veto(); wxAuiNotebook * nb = (wxAuiNotebook*)event.pane->window; if (!nb) return; if (!g_pCodeWindow) { if (nb->GetPage(0)->GetId() == IDM_LOGWINDOW || nb->GetPage(0)->GetId() == IDM_LOGCONFIGWINDOW || nb->GetPage(0)->GetId() == IDM_CONSOLEWINDOW) { // Closing a pane containing the logwindow or a console closes both SConfig::GetInstance().m_InterfaceConsole = false; SConfig::GetInstance().m_InterfaceLogWindow = false; SConfig::GetInstance().m_InterfaceLogConfigWindow = false; ToggleConsole(false); ToggleLogWindow(false); ToggleLogConfigWindow(false); } } else { if (GetNotebookCount() == 1) { wxMessageBox(_("At least one pane must remain open."), _("Notice"), wxOK, this); } else if (nb->GetPageCount() != 0 && !nb->GetPageText(0).IsSameAs(wxT("<>"))) { wxMessageBox(_("You can't close panes that have pages in them."), _("Notice"), wxOK, this); } else { // Detach and delete the empty notebook event.pane->DestroyOnClose(true); m_Mgr->ClosePane(*event.pane); } } m_Mgr->Update(); }
void CFrame::OnToggleWindow(wxCommandEvent& event) { bool bShow = GetMenuBar()->IsChecked(event.GetId()); switch(event.GetId()) { case IDM_LOGWINDOW: if (!g_pCodeWindow) SConfig::GetInstance().m_InterfaceLogWindow = bShow; ToggleLogWindow(bShow); break; case IDM_LOGCONFIGWINDOW: if (!g_pCodeWindow) SConfig::GetInstance().m_InterfaceLogConfigWindow = bShow; ToggleLogConfigWindow(bShow); break; case IDM_CONSOLEWINDOW: if (!g_pCodeWindow) SConfig::GetInstance().m_InterfaceConsole = bShow; ToggleConsole(bShow); break; case IDM_REGISTERWINDOW: g_pCodeWindow->ToggleRegisterWindow(bShow); break; case IDM_BREAKPOINTWINDOW: g_pCodeWindow->ToggleBreakPointWindow(bShow); break; case IDM_MEMORYWINDOW: g_pCodeWindow->ToggleMemoryWindow(bShow); break; case IDM_JITWINDOW: g_pCodeWindow->ToggleJitWindow(bShow); break; case IDM_SOUNDWINDOW: g_pCodeWindow->ToggleSoundWindow(bShow); break; case IDM_VIDEOWINDOW: g_pCodeWindow->ToggleVideoWindow(bShow); break; } }
void ConsoleAPI::HandleKeyEvent(KeyEvent *e) { const QKeySequence &toggleConsole = framework_->Input()->KeyBinding("ToggleConsole", QKeySequence(Qt::Key_F1)); if (e->sequence == toggleConsole) ToggleConsole(); }
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(); }
void ConsoleAPI::HandleKeyEvent(KeyEvent *e) { if (e->sequence == framework->Input()->KeyBinding("ToggleConsole", QKeySequence(Qt::Key_F1))) ToggleConsole(); }
bool FCBondage::SBTracker::HandleCommand(const char* pCommandStr) { // All custom commands start with "//" if (pCommandStr[1] != 0x2F) return false; // Get the first argument or null if no argument. auto firstArg = FirstArg(pCommandStr); // Console toggle command if (strstr(pCommandStr, "//console")) { if (firstArg == NULL) return false; if (!strcmp(firstArg,"on")) { ToggleConsole(true); std::async(std::launch::async, &FCBondage::SBTracker::SendCommand,this,"/echo Console Opened."); } else if (!strcmp(firstArg,"off")) { ToggleConsole(false); std::async(std::launch::async, &FCBondage::SBTracker::SendCommand,this,"/echo Console Closed."); } return true; } // AutoUpdate toggle command if (strstr(pCommandStr, "//autoupdate")) { if (firstArg == NULL) return false; if (!strcmp(firstArg,"on")) { AutoUpdateFlag = true; std::async(std::launch::async, &FCBondage::SBTracker::SendCommand,this,"/echo Auto Updating Values."); } else if (!strcmp(firstArg,"off")) { AutoUpdateFlag = false; std::async(std::launch::async, &FCBondage::SBTracker::SendCommand,this,"/echo Not Auto Updating Values."); } return true; } // ShowAll toggle command if (strstr(pCommandStr, "//showall")) { if (firstArg == NULL) return false; if (!strcmp(firstArg,"on")) { ShowAllFlag = true; std::async(std::launch::async, &FCBondage::SBTracker::SendCommand,this,"/echo Showing All Items."); } else if (!strcmp(firstArg,"off")) { ShowAllFlag = false; std::async(std::launch::async, &FCBondage::SBTracker::SendCommand,this,"/echo Showing Only Novus Items."); } return true; } // Invoke DisplayCurrentValues if (strstr(pCommandStr, "//showcur")) { std::async(std::launch::async, &FCBondage::SBTracker::DisplayCurrentValues,this); return true; } // Set all values to 0. if (strstr(pCommandStr, "//reset")) { std::async(std::launch::async, &FCBondage::SBTracker::ClearValues,this); std::async(std::launch::async, &FCBondage::SBTracker::SendCommand,this,"/echo Values Cleared."); return true; } // Toggle value display mode if (strstr(pCommandStr, "//rawview")) { if (firstArg == NULL) return false; if (!strcmp(firstArg,"on")) { RawView = true; std::async(std::launch::async, &FCBondage::SBTracker::SendCommand,this,"/echo Showing values as raw integers."); } else if (!strcmp(firstArg,"off")) { RawView = false; std::async(std::launch::async, &FCBondage::SBTracker::SendCommand,this,"/echo Showing values as decimals."); } return true; } // Badly formatted command. return false; }