本文整理汇总了C++中wxWindow类的典型用法代码示例。如果您正苦于以下问题:C++ wxWindow类的具体用法?C++ wxWindow怎么用?C++ wxWindow使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了wxWindow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CPPUNIT_ASSERT_EQUAL
void WindowTestCase::Children()
{
CPPUNIT_ASSERT_EQUAL(0, m_window->GetChildren().GetCount());
wxWindow* child1 = new wxWindow(m_window, wxID_ANY);
CPPUNIT_ASSERT_EQUAL(1, m_window->GetChildren().GetCount());
m_window->RemoveChild(child1);
CPPUNIT_ASSERT_EQUAL(0, m_window->GetChildren().GetCount());
child1->SetId(wxID_HIGHEST + 1);
child1->SetName("child1");
m_window->AddChild(child1);
CPPUNIT_ASSERT_EQUAL(1, m_window->GetChildren().GetCount());
CPPUNIT_ASSERT_EQUAL(child1, m_window->FindWindow(wxID_HIGHEST + 1));
CPPUNIT_ASSERT_EQUAL(child1, m_window->FindWindow("child1"));
m_window->DestroyChildren();
CPPUNIT_ASSERT_EQUAL(0, m_window->GetChildren().GetCount());
}
示例2: EnableLetter
void
EnableLetter(wxWindow& window, bool letters)
{
// on first time, we need to set up values
window.FindWindow(ShowInfoReq_ID_POINTS_PER_LETTER)->Enable(letters);
window.FindWindow(ShowInfoReq_ID_LABEL_LETTERS)->Enable(letters);
}
示例3: raiseMovementEvent
void
raiseMovementEvent(
wxWindow &Control,
std::shared_ptr<StateAccessToken> &Access,
std::function<seec::cm::MovementResult (seec::cm::ProcessState &State)> Mover)
{
auto const Handler = Control.GetEventHandler();
if (!Handler) {
wxLogDebug("raiseMovementEvent: wxWindow does not have an event handler.");
return;
}
if (!Access) {
wxLogDebug("raiseMovementEvent: no access provided.");
return;
}
auto LockAccess = Access->getAccess();
if (!LockAccess) { // Token is out of date.
wxLogDebug("raiseMovementEvent: access token is outdated.");
return;
}
ProcessMoveEvent Ev {
SEEC_EV_PROCESS_MOVE,
Control.GetId(),
std::move(Mover)
};
Ev.SetEventObject(&Control);
LockAccess.release();
Handler->AddPendingEvent(Ev);
}
示例4: WXUNUSED
void MyFrame::OnReplace(wxCommandEvent& WXUNUSED(event) )
{
if (m_replacewindow == NULL) {
m_replacewindow = m_splitter->GetWindow2();
m_splitter->ReplaceWindow(m_replacewindow, new wxPanel(m_splitter, wxID_ANY));
m_replacewindow->Hide();
} else {
wxWindow *empty = m_splitter->GetWindow2();
wxASSERT(empty != m_replacewindow);
m_splitter->ReplaceWindow(empty, m_replacewindow);
m_replacewindow->Show();
m_replacewindow = NULL;
empty->Destroy();
}
}
示例5:
void MvcController::ConditionallyEnableControl
(std::string const& name
,wxWindow& control
)
{
control.Enable(ModelReference<datum_base>(name).is_enabled());
}
示例6: pxIsValidWindowPosition
// Returns FALSE if the window position is considered invalid, which means that it's title
// bar is most likely not easily grabble. Such a window should be moved to a valid or
// default position.
bool pxIsValidWindowPosition( const wxWindow& window, const wxPoint& windowPos )
{
// The height of the window is only revlevant to the height of a title bar, which is
// all we need visible for the user to be able to drag the window into view. But
// there's no way to get that info from wx, so we'll just have to guesstimate...
wxSize sizeMatters( window.GetSize().GetWidth(), 32 ); // if some gui has 32 pixels of undraggable title bar, the user deserves to suffer.
return wxGetDisplayArea().Contains( wxRect( windowPos, sizeMatters ) );
}
示例7: EvtSize
//----------------------------------------
void CXYPlotPanel::EvtSize(wxWindow& window, const wxSizeEventFunction& method, wxObject* userData, wxEvtHandler* eventSink)
{
window.Connect(wxEVT_SIZE,
(wxObjectEventFunction)
(wxEventFunction)
method,
userData,
eventSink);
}
示例8: SetSizeLessThanMinSize
void SetSizeTestCase::SetSizeLessThanMinSize()
{
m_win->SetMinSize(wxSize(100, 100));
const wxSize size(200, 50);
m_win->SetSize(size);
CPPUNIT_ASSERT_EQUAL( size, m_win->GetSize() );
}
示例9:
~WDO_ENABLE_DISABLE()
{
if( m_win )
{
m_win->Enable();
m_win->SetFocus(); // let's focus back on the parent window
}
}
示例10: Restore
void Restore()
{
int x, y;
m_w->GetSize( &x, &y );
if( x != m_x || y != m_y )
m_w->SetSize( -1, -1, m_x, m_y );
}
示例11: OnReparent
void wxDynamicSashWindowLeaf::OnReparent(wxEvent &WXUNUSED(event))
{
if (m_child)
{
m_child->Reparent(m_viewport);
}
ResizeChild(m_viewport->GetSize());
}
示例12: Help
void WindowTestCase::Help()
{
wxHelpProvider::Set(new wxSimpleHelpProvider());
CPPUNIT_ASSERT_EQUAL("", m_window->GetHelpText());
m_window->SetHelpText("helptext");
CPPUNIT_ASSERT_EQUAL("helptext", m_window->GetHelpText());
}
示例13: BestSize
void SetSizeTestCase::BestSize()
{
CPPUNIT_ASSERT_EQUAL( wxSize(50, 250), m_win->GetBestSize() );
m_win->SetMinSize(wxSize(100, 100));
CPPUNIT_ASSERT_EQUAL( wxSize(100, 250), m_win->GetBestSize() );
m_win->SetMaxSize(wxSize(200, 200));
CPPUNIT_ASSERT_EQUAL( wxSize(100, 200), m_win->GetBestSize() );
}
示例14: OnScroll
void wxDynamicSashWindowLeaf::OnScroll(wxScrollEvent &WXUNUSED(event))
{
int nx = -m_hscroll->GetThumbPosition();
int ny = -m_vscroll->GetThumbPosition();
if (m_child)
{
wxPoint pos = m_child->GetPosition();
m_viewport->ScrollWindow(nx - pos.x, ny - pos.y);
}
}
示例15: OnSplitVertical
void MyFrame::OnSplitVertical(wxCommandEvent& WXUNUSED(event) )
{
if ( m_splitter->IsSplit() )
m_splitter->Unsplit();
m_left->Show(true);
m_right->Show(true);
m_splitter->SplitVertically( m_left, m_right );
m_replacewindow = NULL;
#if wxUSE_STATUSBAR
SetStatusText(wxT("Splitter split vertically"), 1);
#endif // wxUSE_STATUSBAR
}