Exemplo n.º 1
0
	void OnFocus(wxChildFocusEvent& evt)
	{
		CmdProc* p1=wm.cmdptr.GetData();
		CmdProc* p2=m_pActiveView? &m_pActiveView->Target:NULL;
		if(p1!=p2)
		{
			wm.cmdptr.SetData(p2);
			wm.wup.gp_add("CmdProc");
		}
		evt.Skip(true);
	}
Exemplo n.º 2
0
void MvcController::UponChildFocus(wxChildFocusEvent& event)
{
    event.Skip();

    wxWindow* new_focused_window = FindFocus();

    // A wxChildFocusEvent is sent for every window in the hierarchy,
    // from new_focused_window up to this MvcController. Ignore all
    // but the "deepest" one--see:
    //   http://lists.nongnu.org/archive/html/lmi/2009-01/msg00001.html
    if(event.GetWindow() != new_focused_window)
        {
        return;
        }

    // Do nothing if focus hasn't changed. This case arises when
    // another application is activated, and then this application
    // is reactivated.
    if(last_focused_window_ == new_focused_window)
        {
        return;
        }

    if
        (  wxID_CANCEL == new_focused_window->GetId()
        || wxID_HELP   == new_focused_window->GetId()
        )
        {
        return;
        }

    if(Validate())
        {
        if(new_focused_window)
            {
            last_focused_window_ = new_focused_window;
            }
        else
            {
            warning() << "Keyboard focus was lost." << LMI_FLUSH;
            RefocusLastFocusedWindow();
            }
        }
    else
        {
        LMI_ASSERT(!unit_test_refocus_event_pending_);
        if(!unit_test_under_way_)
            {
            wxCommandEvent event0(wxEVT_REFOCUS_INVALID_CONTROL);
            wxPostEvent(this, event0);
            }
        unit_test_refocus_event_pending_ = true;
        }
}
Exemplo n.º 3
0
	void OnFocus(wxChildFocusEvent& evt)
	{
		CmdProc* p1=WndManager::current().cmdptr.GetData();
		CmdProc* p2=NULL;
		if(p1!=p2)
		{
			WndManager::current().cmdptr.SetData(p2);
			WndUpdator::current().gp_add("CmdProc");
		}
		evt.Skip(true);
	}
Exemplo n.º 4
0
void mmStockDialog::onFocusChange(wxChildFocusEvent& event)
{
    updateControls();
    event.Skip();
}
Exemplo n.º 5
0
void DialogStyleEditor::OnChildFocus(wxChildFocusEvent &event) {
	UpdateWorkStyle();
	SubsPreview->SetStyle(*work);
	event.Skip();
}
Exemplo n.º 6
0
void myTextCtrl::OnSetChildFocus(wxChildFocusEvent& event)
{
	VRenderFrame *vrf = (VRenderFrame *)m_frame;
	if (vrf) vrf->SetKeyLock(true);
	event.Skip();
}
Exemplo n.º 7
0
void mmTransDialog::onFocusChange(wxChildFocusEvent& event)
{
    wxWindow *w = event.GetWindow();
    if (w)
        object_in_focus_ = w->GetId();

    m_currency = Model_Currency::GetBaseCurrency();
    wxString accountName = cbAccount_->GetValue();
    wxString toAccountName = cbPayee_->GetValue();
    for (const auto& acc : Model_Account::instance().all_checking_account_names()){
        if (acc.CmpNoCase(accountName) == 0) accountName = acc;
        if (acc.CmpNoCase(toAccountName) == 0) toAccountName = acc;
    }

    const Model_Account::Data* account = Model_Account::instance().get(accountName);
    if (account)
    {
        m_currency = Model_Account::currency(account);
        cbAccount_->SetValue(account->ACCOUNTNAME);
        m_trx_data.ACCOUNTID = account->ACCOUNTID;
    }

    if (!m_transfer)
    {
        Model_Payee::Data * payee = Model_Payee::instance().get(cbPayee_->GetValue());
        if (payee) 
        {
            cbPayee_->ChangeValue(payee->PAYEENAME);
            setCategoryForPayee(payee);
        }
        toTextAmount_->ChangeValue("");
    }
    else
    {
        const Model_Account::Data* to_account = Model_Account::instance().get(toAccountName);
        if (to_account)
        {
            m_to_currency = Model_Account::currency(to_account);
            cbPayee_->ChangeValue(to_account->ACCOUNTNAME);
            m_trx_data.TOACCOUNTID = to_account->ACCOUNTID;
        }
    }

    if (object_in_focus_ == textAmount_->GetId())
        textAmount_->SelectAll();
    else 
    {
        if (textAmount_->Calculate()) 
            textAmount_->GetDouble(m_trx_data.TRANSAMOUNT);
        skip_amount_init_ = false;
    }

    if (m_advanced && object_in_focus_ == toTextAmount_->GetId())
        toTextAmount_->SelectAll();
    else 
    {
        if (toTextAmount_->Calculate())
            toTextAmount_->GetDouble(m_trx_data.TOTRANSAMOUNT);
    }

    dataToControls();
    event.Skip();
}