本文整理汇总了C++中wxWindow::SetFocus方法的典型用法代码示例。如果您正苦于以下问题:C++ wxWindow::SetFocus方法的具体用法?C++ wxWindow::SetFocus怎么用?C++ wxWindow::SetFocus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxWindow
的用法示例。
在下文中一共展示了wxWindow::SetFocus方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnFocus
void wxDynamicSashWindowLeaf::OnFocus(wxFocusEvent &event)
{
if ( event.GetEventObject() == m_hscroll ||
event.GetEventObject() == m_vscroll )
{
m_child->SetFocus();
}
}
示例2:
~WDO_ENABLE_DISABLE()
{
if( m_win )
{
m_win->Enable();
m_win->SetFocus(); // let's focus back on the parent window
}
}
示例3: OnFocus
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();
}
}
示例4: FocusEvent
void WindowTestCase::FocusEvent()
{
#ifndef __WXOSX__
EventCounter setfocus(m_window, wxEVT_SET_FOCUS);
EventCounter killfocus(m_window, wxEVT_KILL_FOCUS);
m_window->SetFocus();
CPPUNIT_ASSERT_EQUAL(1, setfocus.GetCount());
CPPUNIT_ASSERT(m_window->HasFocus());
wxButton* button = new wxButton(wxTheApp->GetTopWindow(), wxID_ANY);
wxYield();
button->SetFocus();
CPPUNIT_ASSERT_EQUAL(1, killfocus.GetCount());
CPPUNIT_ASSERT(!m_window->HasFocus());
#endif
}
示例5: Focus
void WindowTestCase::Focus()
{
#ifndef __WXOSX__
CPPUNIT_ASSERT(!m_window->HasFocus());
if ( m_window->AcceptsFocus() )
{
m_window->SetFocus();
CPPUNIT_ASSERT(m_window->HasFocus());
}
//Set the focus back to the main window
wxTheApp->GetTopWindow()->SetFocus();
if ( m_window->AcceptsFocusFromKeyboard() )
{
m_window->SetFocusFromKbd();
CPPUNIT_ASSERT(m_window->HasFocus());
}
#endif
}
示例6: KeyEvent
void WindowTestCase::KeyEvent()
{
#if wxUSE_UIACTIONSIMULATOR
EventCounter keydown(m_window, wxEVT_KEY_DOWN);
EventCounter keyup(m_window, wxEVT_KEY_UP);
EventCounter keychar(m_window, wxEVT_CHAR);
wxUIActionSimulator sim;
m_window->SetFocus();
wxYield();
sim.Text("text");
sim.Char(WXK_SHIFT);
wxYield();
CPPUNIT_ASSERT_EQUAL(5, keydown.GetCount());
CPPUNIT_ASSERT_EQUAL(5, keyup.GetCount());
CPPUNIT_ASSERT_EQUAL(4, keychar.GetCount());
#endif
}