Ejemplo n.º 1
0
void TimeTextCtrl::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);
}
Ejemplo n.º 2
0
void wxWebView::OnKillFocus(wxFocusEvent& event)
{
    WebCore::Frame* frame = 0;
    if (m_mainFrame)
        frame = m_mainFrame->GetFrame();
        
    if (frame) {
        m_impl->page->focusController()->setActive(false);
        frame->selection()->setFocused(false);
    }
    event.Skip();
}
Ejemplo n.º 3
0
void WebView::OnSetFocus(wxFocusEvent& event)
{
    if (m_impl && m_impl->page && m_impl->page->focusController()) {
        m_impl->page->focusController()->setFocused(true);
        m_impl->page->focusController()->setActive(true);

        if (!m_impl->page->focusController()->focusedFrame() && m_mainFrame)
            m_impl->page->focusController()->setFocusedFrame(m_mainFrame->GetFrame());
    }
    
    event.Skip();
}
Ejemplo n.º 4
0
void SearchControl::onFocus(wxFocusEvent& event)
{
	gcString txt((wchar_t*)m_tbSearchBox->GetValue().wchar_str());

	if (txt == m_szDefaultText)
		m_tbSearchBox->SetValue(L"");
	else
		onSearchEvent(txt);

	m_tbSearchBox->SetForegroundColour(m_NormalCol);
	event.Skip();
}
Ejemplo n.º 5
0
//
// Handle the wxEVT_KILL_FOCUS event
//
void
KeyView::OnKillFocus(wxFocusEvent & event)
{
   // Allow further processing
   event.Skip();

   // Refresh the selected line to adjust visual highlighting.
   if (GetSelection() != wxNOT_FOUND)
   {
      RefreshLine(GetSelection());
   }
}
Ejemplo n.º 6
0
void wxWebView::OnSetFocus(wxFocusEvent& event)
{
    WebCore::Frame* frame = 0;
    if (m_mainFrame)
        frame = m_mainFrame->GetFrame();
        
    if (frame) {
        frame->selection()->setFocused(true);
    }

    event.Skip();
}
Ejemplo n.º 7
0
void FontFaceCtrl::OnSetFocus(wxFocusEvent & evt)
{
    evt.Skip();
    // Set the combobox list contents
    wxCriticalSectionLocker lock(s_fontCS);
    wxString value = GetValue();
    Set(s_facenames);
    AutoComplete(s_facenames);
    wxComboBox::SetValue(value);
    if (s_threadComplete)
        Unbind(wxEVT_SET_FOCUS, &FontFaceCtrl::OnSetFocus, this);
}
Ejemplo n.º 8
0
/** 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();
}
Ejemplo n.º 9
0
void DisassemblyTextCtrl::OnKillFocus(wxFocusEvent& event)
{
    // cancel auto-completion list when losing focus
    if (AutoCompActive())
    {
        AutoCompCancel();
    }
    if (CallTipActive())
    {
        CallTipCancel();
    }
    event.Skip();
} // end of OnKillFocus
Ejemplo n.º 10
0
void wxPopupFocusHandler::OnKillFocus(wxFocusEvent& event)
{
    // when we lose focus we always disappear - unless it goes to the popup (in
    // which case we don't really lose it)
    wxWindow *win = event.GetWindow();
    while ( win )
    {
        if ( win == m_popup )
            return;
        win = win->GetParent();
    }

    m_popup->DismissAndNotify();
}
Ejemplo n.º 11
0
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();
}
Ejemplo n.º 12
0
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");
}
Ejemplo n.º 13
0
void wxNumberEditCtrl::OnKillFocus(wxFocusEvent& event)
{
	if(!GetValue().IsNumber())
	{
		Clear();
		*this << *m_pValue;
	}
	else
	{
		GetValue().ToLong(m_pValue);
		m_pParent->OnNumberEditCtrlChanged();
	}

	event.Skip();
}
Ejemplo n.º 14
0
void cbStyledTextCtrl::OnKillFocus(wxFocusEvent& event)
{
    // cancel auto-completion list when losing focus
    if (AutoCompActive())
    {
        AutoCompCancel();
    }

    if (CallTipActive())
    {
        CallTipCancel();
    }

    event.Skip();
}
Ejemplo n.º 15
0
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
Ejemplo n.º 16
0
/* 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();
}
Ejemplo n.º 17
0
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();
}
Ejemplo n.º 18
0
void wxRibbonPanel::OnKillFocus(wxFocusEvent& evt)
{
    if(m_expanded_dummy)
    {
        wxWindow *receiver = evt.GetWindow();
        if(IsAncestorOf(this, receiver))
        {
            m_child_with_focus = receiver;
            receiver->Connect(wxEVT_KILL_FOCUS,
                wxFocusEventHandler(wxRibbonPanel::OnChildKillFocus),
                NULL, this);
        }
        else if(receiver == NULL || receiver != m_expanded_dummy)
        {
            HideExpanded();
        }
    }
}
Ejemplo n.º 19
0
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
}
Ejemplo n.º 20
0
//
// 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
}
Ejemplo n.º 21
0
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();
}
Ejemplo n.º 22
0
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();
}
Ejemplo n.º 23
0
//----------------------------------------------------------------------------
// 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();
}
Ejemplo n.º 24
0
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));
}
Ejemplo n.º 25
0
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);
	}
}
Ejemplo n.º 26
0
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();
}
Ejemplo n.º 27
0
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");
}
Ejemplo n.º 28
0
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();
}
Ejemplo n.º 29
0
 void OnFocus(wxFocusEvent& event) {
     GetParent()->SetFocus();
     event.Skip();
 }
Ejemplo n.º 30
0
void IWnd_stc::OnFocus(wxFocusEvent& evt)
{
	evt.Skip();
}