void SelectionBar::OnFocus(wxFocusEvent &event) { wxCommandEvent e(EVT_CAPTURE_KEYBOARD); if (event.GetEventType() == wxEVT_KILL_FOCUS) { e.SetEventType(EVT_RELEASE_KEYBOARD); } e.SetEventObject(this); GetParent()->GetEventHandler()->ProcessEvent(e); Refresh(false); event.Skip(); }
void cbStyledTextCtrl::OnKillFocus(wxFocusEvent& event) { // cancel auto-completion list when losing focus if (AutoCompActive()) { AutoCompCancel(); } if (CallTipActive()) { CallTipCancel(); } event.Skip(); }
void wxNumberEditCtrl::OnKillFocus(wxFocusEvent& event) { if(!GetValue().IsNumber()) { Clear(); *this << *m_pValue; } else { GetValue().ToLong(m_pValue); m_pParent->OnNumberEditCtrlChanged(); } event.Skip(); }
void GSPanel::OnFocusLost( wxFocusEvent& evt ) { evt.Skip(); m_HasFocus = false; DoShowMouse(); #ifdef __linux__ // TODO OSX handle properly these HACK2: otherwise events are not recognized // HACK2: In gsopen2 there is one event buffer read by both wx/gui and pad plugin. Wx deletes // the event before the pad see it. So you send key event directly to the pad. if( (PADWriteEvent != NULL) && (GSopen2 != NULL) ) { keyEvent event = {0, 10}; // X equivalent of FocusOut PADWriteEvent(event); } #endif //Console.Warning("GS frame > focus lost"); }
void wxNotebook::OnSetFocus ( wxFocusEvent& rEvent ) { // // This function is only called when the focus is explicitly set (i.e. from // the program) to the notebook - in this case we don't need the // complicated OnNavigationKey() logic because the programmer knows better // what [s]he wants // // set focus to the currently selected page if any // if (m_nSelection != -1) m_pages[m_nSelection]->SetFocus(); rEvent.Skip(); } // end of wxNotebook::OnSetFocus
void AGE_Frame::OnTerrainCountChange(wxFocusEvent &Event) { if(!((AGETextCtrl*)Event.GetEventObject())->SaveEdits()) return; uint16_t UsedTerrains = lexical_cast<uint16_t>(((wxTextCtrl*)Event.GetEventObject())->GetValue()); // Resize terrain restrictions for(short loop = 0; loop < GenieFile->TerrainRestrictions.size(); loop++) { GenieFile->TerrainRestrictions[loop].TerrainAccessible.resize(UsedTerrains); if(GenieVersion >= genie::GV_AoK) GenieFile->TerrainRestrictions[loop].TerrainPassGraphics.resize(UsedTerrains); } wxCommandEvent E; OnTerrainRestrictionsSelect(E); Event.Skip(); }
/* TextEditor::onFocusLoss * Called when the text editor loses focus *******************************************************************/ void TextEditor::onFocusLoss(wxFocusEvent& e) { // Hide calltip+autocomplete box hideCalltip(); AutoCompCancel(); // Hide current line marker MarkerDeleteAll(1); MarkerDeleteAll(2); // Clear word matches SetIndicatorCurrent(8); IndicatorClearRange(0, GetTextLength()); prev_word_match = ""; e.Skip(); }
void GSPanel::OnFocusLost( wxFocusEvent& evt ) { evt.Skip(); m_HasFocus = false; DoShowMouse(); #if defined(__unix__) // HACK2: In gsopen2 there is one event buffer read by both wx/gui and pad plugin. Wx deletes // the event before the pad see it. So you send key event directly to the pad. if( (PADWriteEvent != NULL) && (GSopen2 != NULL) ) { keyEvent event = {0, 10}; // X equivalent of FocusOut PADWriteEvent(event); } #endif //Console.Warning("GS frame > focus lost"); UpdateScreensaver(); }
void wxGridCellEditorEvtHandler::OnKillFocus(wxFocusEvent& event) { // Don't disable the cell if we're just starting to edit it if ( m_inSetFocus ) { event.Skip(); return; } // accept changes m_grid->DisableCellEditControl(); // notice that we must not skip the event here because the call above may // delete the control which received the kill focus event in the first // place and if we pretend not having processed the event, the search for a // handler for it will continue using the now deleted object resulting in a // crash }
// // Handle the wxEVT_SET_FOCUS event // void KeyView::OnSetFocus(wxFocusEvent & event) { // Allow further processing event.Skip(); // Refresh the selected line to pull in any changes while // focus was away...like when setting a new key value. This // will also refresh the visual (highlighted) state. if (GetSelection() != wxNOT_FOUND) { RefreshLine(GetSelection()); } #if wxUSE_ACCESSIBILITY // Tell accessibility of the change mAx->SetCurrentLine(GetSelection()); #endif }
void LoginForm::onBlur(wxFocusEvent& event) { if (event.GetId() == m_tbUsername->GetId()) { if (m_tbUsername->GetValue() == "") m_tbUsername->SetValue(Managers::GetString(L"#LF_USER")); } else if (event.GetId() == m_tbPassword->GetId()) { if (m_tbPassword->GetValue() == "" && m_tbPassword->IsShown()) { m_tbPassword->Show(false); m_tbPasswordDisp->Show(true); Layout(); return; } } event.Skip(); }
void wxWebView::OnKillFocus(wxFocusEvent& event) { if (m_impl && m_impl->page && m_impl->page->focusController()) { m_impl->page->focusController()->setFocused(false); // We also handle active state in OnTLWActivated, but if a user does not // call event.Skip() in their own EVT_ACTIVATE handler, we won't get those // callbacks. So we handle active state here as well as a fallback. wxTopLevelWindow* tlw = dynamic_cast<wxTopLevelWindow*>(wxGetTopLevelParent(this)); if (tlw && tlw->IsActive()) m_impl->page->focusController()->setActive(true); else m_impl->page->focusController()->setActive(false); } while (HasCapture()) ReleaseMouse(); event.Skip(); }
void Panel_Remaps::EvtKillFocus(wxFocusEvent& event ) { if( paletteCtrl->isChanged && curr_ind_remap >= 0 ) { //Make the user sure to abort his modifications int res = wxMessageBox( wxT("Change have been made in the current palette.\n" "If you don't save them now you can loose them\n" "Do the save ?") , wxT("Question"), wxYES_NO | wxICON_INFORMATION, this ); if( res == wxYES ) { if( mode8bit ) Save_8Bit_Remap(); else Save_16Bit_Remap(); } } paletteCtrl->isChanged = false; event.Skip(); }
//---------------------------------------------------------------------------- // Workaround for bug http://trac.wxwidgets.org/ticket/11630 void mmTransDialog::OnDpcKillFocus(wxFocusEvent& event) { if (wxGetKeyState(WXK_TAB) && wxGetKeyState(WXK_SHIFT)) itemButtonCancel_->SetFocus(); else if (wxGetKeyState(WXK_TAB)) choiceStatus_->SetFocus(); else if (wxGetKeyState(WXK_UP)) { wxCommandEvent evt(wxEVT_SPIN, wxID_ANY); evt.SetInt(1); this->GetEventHandler()->AddPendingEvent(evt); } else if (wxGetKeyState(WXK_DOWN)) { wxCommandEvent evt(wxEVT_SPIN, wxID_ANY); evt.SetInt(-1); this->GetEventHandler()->AddPendingEvent(evt); } else event.Skip(); }
void wxTimeSpinCtrl::OnKillFocus(wxFocusEvent &ev) { #ifdef __WXGTK__ ev.Skip(); #endif long time = GetTextTime(); if (time < 0) { m_txt->SetValue(wxEmptyString); spinValue = 0; m_spn->SetValue(0); } else { int tp = GetTimePart(); SetValue(wxTimeSpan(0, 0, time)); Highlight(tp); } }
void wxGridCellEditorEvtHandler::OnKillFocus(wxFocusEvent& event) { // We must let the native control have this event so in any case don't mark // it as handled, otherwise various weird problems can happen (see #11681). event.Skip(); // Don't disable the cell if we're just starting to edit it if (m_inSetFocus) return; // Tell the grid to dismiss the control but don't do it immediately as it // could result in the editor being destroyed right now and a crash in the // code searching for the next event handler, so post an event asking the // grid to do it slightly later instead. // FIXME-VC6: Once we drop support for VC6, we should use a simpler // m_grid->CallAfter(&wxGrid::DisableCellEditControl) and get // rid of wxEVT_GRID_HIDE_EDITOR entirely. m_grid->GetEventHandler()-> AddPendingEvent(wxCommandEvent(wxEVT_GRID_HIDE_EDITOR)); }
void SavvyEditor::AppFrame::OnFocusEditorWindow(wxFocusEvent& a_Event) { int eventId = a_Event.GetId(); if (eventId == ID_TextAreaConverted) { if (m_ConvertedTextArea) { m_LastSelectedTextCtrl = m_ConvertedTextArea; m_CurrFindPos = 0; } } else if (eventId == ID_TextAreaUser) { if (m_TextAreaUser) { m_LastSelectedTextCtrl = m_TextAreaUser; m_CurrFindPos = 0; } } a_Event.Skip(true); }
/** OnTextKillFocus * * Reverts whatever textbox to the proper text */ void ComplxFrame::OnTextKillFocus(wxFocusEvent& event) { wxTextCtrl* text = static_cast<wxTextCtrl*>(event.GetEventObject()); wxString name = text->GetName(); if (name == _("PC")) { UpdateRegister(text, state.pc, 8); } else if (name == _("CC")) { int cc = state.n ? -1 : (state.z ? 0 : 1); UpdateRegister(text, cc, 9); } else { int reg = name[1] - '0'; assert(reg <= 7); UpdateRegister(text, state.regs[reg], reg); } event.Skip(); }
void wxNumValidatorBase::OnKillFocus(wxFocusEvent& event) { wxTextEntry * const control = GetTextEntry(); if ( !control ) return; // When we change the control value below, its "modified" status is reset // so we need to explicitly keep it marked as modified if it was so in the // first place. // // Notice that only wxTextCtrl (and not wxTextEntry) has // IsModified()/MarkDirty() methods hence the need for dynamic cast. wxTextCtrl * const text = wxDynamicCast(m_validatorWindow, wxTextCtrl); const bool wasModified = text ? text->IsModified() : false; control->ChangeValue(NormalizeString(control->GetValue())); if ( wasModified ) text->MarkDirty(); event.Skip(); }
void LoginForm::onFocus(wxFocusEvent& event) { if (event.GetId() == m_tbUsername->GetId()) { gcString defaultText = Managers::GetString(L"#LF_USER"); if (m_tbUsername->GetValue() == defaultText) m_tbUsername->SetValue(""); } else if (event.GetId() == m_tbPasswordDisp->GetId()) { if (m_tbPasswordDisp->IsShown()) { m_tbPasswordDisp->Show(false); m_tbPassword->Show(); Layout(); m_tbPassword->SetFocus(); return; } } event.Skip(); }
void GSPanel::OnFocus( wxFocusEvent& evt ) { evt.Skip(); m_HasFocus = true; if( g_Conf->GSWindow.AlwaysHideMouse ) { SetCursor( wxCursor(wxCURSOR_BLANK) ); m_CursorShown = false; } else DoShowMouse(); #ifdef __POSIX__ // HACK2: In gsopen2 there is one event buffer read by both wx/gui and pad plugin. Wx deletes // the event before the pad see it. So you send key event directly to the pad. if( (PADWriteEvent != NULL) && (GSopen2 != NULL) ) { keyEvent event = {0, 9}; // X equivalent of FocusIn; PADWriteEvent(event); } #endif //Console.Warning("GS frame > focus set"); }
void EDA_DRAW_PANEL_GAL::onLostFocus( wxFocusEvent& aEvent ) { m_lostFocus = true; aEvent.Skip(); }
void SearchEvtHandler::OnFocusLost(wxFocusEvent& evt) { // We don't want to save partial searches during incremental search // so we only save when the ctrl loses focus. parent->UpdateSearchHistory(); evt.Skip(); }
void OnFocus(wxFocusEvent& event) { GetParent()->SetFocus(); event.Skip(); }
void IWnd_stc::OnFocus(wxFocusEvent& evt) { evt.Skip(); }
void SubsTextEditCtrl::OnLoseFocus(wxFocusEvent &event) { CallTipCancel(); event.Skip(); }
void SpinControl::OnTextKillFocus(wxFocusEvent& event) { if (SyncFromText()) DoSendEvent(); event.Skip(); }
void wxAnyButton::GTKOnFocus(wxFocusEvent& event) { event.Skip(); GTKUpdateBitmap(); }
void MutChild::OnGetFocus(wxFocusEvent& event) { SetCurrentBox(box); TRACEC; event.Skip(); }
void wxCheckBox::OnFocus(wxFocusEvent& event) { Refresh(); event.Skip(); }