void ScopeINDI::SetupDialog() { // contrary to camera the telescope setup dialog is called only when not connected // show the server and device configuration INDIConfig *indiDlg = new INDIConfig(wxGetActiveWindow(),TYPE_MOUNT); indiDlg->INDIhost = INDIhost; indiDlg->INDIport = INDIport; indiDlg->INDIDevName = INDIMountName; indiDlg->INDIDevPort = INDIMountPort; // initialize with actual values indiDlg->SetSettings(); // try to connect to server indiDlg->Connect(); if (indiDlg->ShowModal() == wxID_OK) { // if OK save the values to the current profile indiDlg->SaveSettings(); INDIhost = indiDlg->INDIhost; INDIport = indiDlg->INDIport; INDIMountName = indiDlg->INDIDevName; INDIMountPort = indiDlg->INDIDevPort; pConfig->Profile.SetString("/indi/INDIhost", INDIhost); pConfig->Profile.SetLong("/indi/INDIport", INDIport); pConfig->Profile.SetString("/indi/INDImount", INDIMountName); pConfig->Profile.SetString("/indi/INDImount_port",INDIMountPort); m_Name = INDIMountName; } indiDlg->Disconnect(); indiDlg->Destroy(); delete indiDlg; }
void InterpreterDisAsmFrame::OnKeyDown(wxKeyEvent& event) { if(wxGetActiveWindow() != wxGetTopLevelParent(this)) { event.Skip(); return; } if(event.ControlDown()) { if(event.GetKeyCode() == WXK_SPACE) { DoStep(wxCommandEvent()); return; } } else { switch(event.GetKeyCode()) { case WXK_PAGEUP: ShowAddr( PC - (m_item_count * 2) * 4 ); return; case WXK_PAGEDOWN: ShowAddr( PC ); return; case WXK_UP: ShowAddr( PC - (m_item_count + 1) * 4 ); return; case WXK_DOWN: ShowAddr( PC - (m_item_count - 1) * 4 ); return; } } event.Skip(); }
void RainExceptionDialog::show(RainException* pE, bool bDeleteException) { RainExceptionDialog oDialog(wxGetActiveWindow(), pE); oDialog.ShowModal(); if(bDeleteException) delete pE; }
void Camera_INDIClass::CameraSetup() { // show the server and device configuration INDIConfig *indiDlg = new INDIConfig(wxGetActiveWindow(),TYPE_CAMERA); indiDlg->INDIhost = INDIhost; indiDlg->INDIport = INDIport; indiDlg->INDIDevName = INDICameraName; indiDlg->INDIDevCCD = INDICameraCCD; indiDlg->INDIDevPort = INDICameraPort; // initialize with actual values indiDlg->SetSettings(); // try to connect to server indiDlg->Connect(); if (indiDlg->ShowModal() == wxID_OK) { // if OK save the values to the current profile indiDlg->SaveSettings(); INDIhost = indiDlg->INDIhost; INDIport = indiDlg->INDIport; INDICameraName = indiDlg->INDIDevName; INDICameraCCD = indiDlg->INDIDevCCD; INDICameraPort = indiDlg->INDIDevPort; pConfig->Profile.SetString("/indi/INDIhost", INDIhost); pConfig->Profile.SetLong("/indi/INDIport", INDIport); pConfig->Profile.SetString("/indi/INDIcam", INDICameraName); pConfig->Profile.SetLong("/indi/INDIcam_ccd",INDICameraCCD); pConfig->Profile.SetString("/indi/INDIcam_port",INDICameraPort); Name = INDICameraName; SetCCDdevice(); } indiDlg->Disconnect(); indiDlg->Destroy(); delete indiDlg; }
void RSXDebugger::OnKeyDown(wxKeyEvent& event) { if(wxGetActiveWindow() == wxGetTopLevelParent(this)) { switch(event.GetKeyCode()) { case WXK_F5: UpdateInformation(); return; } } event.Skip(); }
void MainFrame::OnKeyDown(wxKeyEvent& event) { if(wxGetActiveWindow() /*== this*/ && event.ControlDown()) { switch(event.GetKeyCode()) { case 'C': case 'c': if(Emu.IsPaused()) Emu.Resume(); else if(Emu.IsReady()) Emu.Run(); return; case 'P': case 'p': if(Emu.IsRunned()) Emu.Pause(); return; case 'S': case 's': if(!Emu.IsStopped()) Emu.Stop(); return; case 'R': case 'r': if(!Emu.m_path.IsEmpty()) {Emu.Stop(); Emu.Run();} return; } } event.Skip(); }
void CFrame::OnHostMessage(wxCommandEvent& event) { switch (event.GetId()) { case IDM_UPDATEGUI: UpdateGUI(); break; case IDM_UPDATESTATUSBAR: if (GetStatusBar() != NULL) GetStatusBar()->SetStatusText(event.GetString(), event.GetInt()); break; case IDM_UPDATETITLE: if (m_RenderFrame != NULL) m_RenderFrame->SetTitle(event.GetString()); break; case IDM_WINDOWSIZEREQUEST: { std::pair<int, int> *win_size = (std::pair<int, int> *)(event.GetClientData()); OnRenderWindowSizeRequest(win_size->first, win_size->second); delete win_size; } break; case WM_USER_CREATE: if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor) m_RenderParent->SetCursor(wxCURSOR_BLANK); break; #ifdef __WXGTK__ case IDM_PANIC: { wxString caption = event.GetString().BeforeFirst(':'); wxString text = event.GetString().AfterFirst(':'); bPanicResult = (wxYES == wxMessageBox(text, caption, event.GetInt() ? wxYES_NO : wxOK, wxGetActiveWindow())); panic_event.Set(); } break; #endif case WM_USER_STOP: DoStop(); break; } }
void OnSignaturePINCode(wxCommandEvent& WXUNUSED(event)) { pinCode.Clear(); wxWindow* parent = wxGetActiveWindow(); SignPinCodeDlg signPINCodeDlg(parent, wxID_ANY, wxT("Signature PIN code"), nbrRetries, hash); if (signPINCodeDlg.ShowModal() == wxID_OK) { pinCode = signPINCodeDlg.GetPassword(); } if (parent) { parent->SetFocus(); } ExitMainLoop(); }
void OnAuthenticationPINCode(wxCommandEvent& WXUNUSED(event)) { pinCode.Clear(); wxWindow* parent = wxGetActiveWindow(); PinCodeDlg pinCodeDlg(parent, wxID_ANY, wxT("Authentication PIN code"), nbrRetries); if (pinCodeDlg.ShowModal() == wxID_OK) { pinCode = pinCodeDlg.GetPassword(); } if (parent) { parent->SetFocus(); } ExitMainLoop(); }
void Application::HandleEvent(wxEvtHandler* handler, wxEventFunction func, wxEvent& event) const { try { wxAppConsole::HandleEvent(handler, func, event); } catch (const FRAbort&) { // Do nothing. FRAbort is a silent exception. } catch (const std::exception& e) { wxMessageBox(e.what(), _("Unhandled Error in FlameRobin"), wxOK | wxICON_ERROR, wxGetTopLevelParent(wxGetActiveWindow())); } }
bool wxMsgAlert(const char* caption, const char* text, bool yes_no, int /*Style*/) { #ifdef __WXGTK__ if (wxIsMainThread()) #endif return wxYES == wxMessageBox(StrToWxStr(text), StrToWxStr(caption), (yes_no) ? wxYES_NO : wxOK, wxGetActiveWindow()); #ifdef __WXGTK__ else { wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_PANIC); event.SetString(StrToWxStr(caption) + ":" + StrToWxStr(text)); event.SetInt(yes_no); main_frame->GetEventHandler()->AddPendingEvent(event); main_frame->panic_event.Wait(); return main_frame->bPanicResult; } #endif }
wxWindow* DIALOG_SHIM::GetParentForModalDialog(wxWindow *parent, long style) const { // creating a parent-less modal dialog will result (under e.g. wxGTK2) // in an unfocused dialog, so try to find a valid parent for it unless we // were explicitly asked not to if ( style & wxDIALOG_NO_PARENT ) return NULL; // first try the given parent if ( parent ) parent = CheckIfCanBeUsedAsParent(wxGetTopLevelParent(parent)); // then the currently active window if ( !parent ) parent = CheckIfCanBeUsedAsParent( wxGetTopLevelParent(wxGetActiveWindow())); // and finally the application main window if ( !parent ) parent = CheckIfCanBeUsedAsParent(wxTheApp->GetTopWindow()); return parent; }
wxWindow * bmx_wxgetactivewindow() { return wxGetActiveWindow(); }