Example #1
0
void QuickFindBar::OnReceivingFocus(wxFocusEvent& event)
{
    event.Skip();
    if((event.GetEventObject() == m_findWhat) || (event.GetEventObject() == m_replaceWith)) {
        PostCommandEvent(this, wxStaticCast(event.GetEventObject(), wxWindow));
    }
}
Example #2
0
void wxDynamicSashWindowLeaf::OnFocus(wxFocusEvent &event)
{
    if ( event.GetEventObject() == m_hscroll ||
            event.GetEventObject() == m_vscroll )
    {
        m_child->SetFocus();
    }
}
Example #3
0
void SwitchView::OnFocus(wxFocusEvent& event) {
    wxScrollBar *hscroll = m_dyn_sash->GetHScrollBar(this);
    wxScrollBar *vscroll = m_dyn_sash->GetVScrollBar(this);

    if (event.GetEventObject() == hscroll || event.GetEventObject() == vscroll) {
        m_view->SetFocus();
    } else {
        event.Skip();
    }
}
Example #4
0
void VampEffectDialog::ControlSetFocus(wxFocusEvent &event)
{
   wxControl *c = (wxControl *) event.GetEventObject();
   wxScrolledWindow *p = (wxScrolledWindow *) c->GetParent();
   wxRect r = c->GetRect();
   wxRect rv = p->GetRect();
   rv.y = 0;

   event.Skip();

   int y;
   int yppu;
   p->GetScrollPixelsPerUnit(NULL, &yppu);

   if (r.y >= rv.y && r.GetBottom() <= rv.GetBottom()) {
      return;
   }

   if (r.y < rv.y) {
      p->CalcUnscrolledPosition(0, r.y, NULL, &r.y);
      y = r.y / yppu;
   }
   else {
      p->CalcUnscrolledPosition(0, r.y, NULL, &r.y);
      y = (r.GetBottom() - rv.GetBottom() + yppu) / yppu;
   }

   p->Scroll(-1, y);
};
Example #5
0
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();
}
void DIALOG_MOVE_EXACT::OnTextFocusLost( wxFocusEvent& event )
{
    wxTextCtrl* obj = static_cast<wxTextCtrl*>( event.GetEventObject() );

    if( obj->GetValue().IsEmpty() )
        obj->SetValue("0");

    event.Skip();
}
Example #7
0
// ----------------------------------------------------------------------------
void MMSapEvents::OnKillFocusEvent( wxFocusEvent& event )
// ----------------------------------------------------------------------------
{
    //For GTK, we copy the selected text to the PRIMARY clipboard
    // when we lose the focus

    #if not defined(__WXGTK__)
        event.Skip(); return;
    #endif

    // If selected text, copy to clipboard

    //remember event window pointer
    wxObject* pEvtObject = event.GetEventObject();

    cbStyledTextCtrl* pControl = 0;
    cbEditor* ed = 0;
    wxString selectedText = wxEmptyString;
    if ( ((wxWindow*)pEvtObject)->GetName().Lower() == _T("sciwindow") )
    {   ed = (cbEditor*)((wxWindow*)pEvtObject)->GetParent();
        pControl = (cbStyledTextCtrl*)pEvtObject;
    }

    if ( ed ) do
    {
        if ( not MouseSap::pMouseSap->IsAttachedTo( pControl ) )
            break;

        selectedText = pControl->GetSelectedText();
        if ( selectedText.IsEmpty() )
            break;

        #if defined(__WXGTK__)
            gtk_clipboard_set_text(
                gtk_clipboard_get(GDK_SELECTION_PRIMARY),
                selectedText.mb_str(wxConvUTF8),
                selectedText.Length() );
        #else //__WXMSW__ //testing
                if (wxTheClipboard->Open())
                {
                    wxTheClipboard->AddData(new wxTextDataObject(selectedText));
                    wxTheClipboard->Close();
                }
        #endif

        #if defined(LOGGING)
            DumpClipboard();
            if (ed && pControl && (not selectedText.IsEmpty()))
            LOGIT( _T("OnKillFocus[%s][%s]"), ed->GetTitle().c_str(),selectedText.c_str());
        #endif
    }while(false);

    event.Skip();

} // end of OnGPM
Example #8
0
void AGE_Frame::OnKillFocus_Terrains(wxFocusEvent &Event)
{
	if(!((AGETextCtrl*)Event.GetEventObject())->SaveEdits()) return;
	if(Event.GetId() == Terrains_Name->GetId())
	{
		ListTerrains();
	}
	else if(Event.GetId() == Terrains_Name2->GetId())
	{
		wxCommandEvent E;
		OnTerrainsSelect(E);
	}
	Event.Skip();
}
Example #9
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();
}
Example #10
0
File: Sounds.cpp Project: mic-e/AGE
void AGE_Frame::OnKillFocus_Sounds(wxFocusEvent &Event)
{
	if(((AGETextCtrl*)Event.GetEventObject())->SaveEdits() != 0) return;
	ListSoundItems();
	Event.Skip();
}