• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ wxWindow类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中wxWindow的典型用法代码示例。如果您正苦于以下问题:C++ wxWindow类的具体用法?C++ wxWindow怎么用?C++ wxWindow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了wxWindow类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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());
}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:25,代码来源:windowtest.cpp


示例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);
}
开发者ID:colindr,项目名称:calchart,代码行数:7,代码来源:show_ui.cpp


示例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);
}
开发者ID:mheinsen,项目名称:seec,代码行数:35,代码来源:ProcessMoveEvent.cpp


示例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();
    }
}
开发者ID:ruifig,项目名称:nutcracker,代码行数:15,代码来源:splitter.cpp


示例5:

void MvcController::ConditionallyEnableControl
    (std::string const& name
    ,wxWindow&          control
    )
{
    control.Enable(ModelReference<datum_base>(name).is_enabled());
}
开发者ID:vadz,项目名称:lmi,代码行数:7,代码来源:mvc_controller.cpp


示例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 ) );
}
开发者ID:madnessw,项目名称:thesnow,代码行数:12,代码来源:wxGuiTools.cpp


示例7: EvtSize

//----------------------------------------
void CXYPlotPanel::EvtSize(wxWindow& window, const wxSizeEventFunction& method, wxObject* userData, wxEvtHandler* eventSink)
{
  window.Connect(wxEVT_SIZE,
                 (wxObjectEventFunction)
                 (wxEventFunction)
                 method,
                 userData,
                 eventSink);

}
开发者ID:adakite,项目名称:main,代码行数:11,代码来源:XYPlotPanel.cpp


示例8: EvtCheckBox

//----------------------------------------
void CXYPlotPanel::EvtCheckBox(wxWindow& window, const wxCommandEventFunction& method, wxObject* userData, wxEvtHandler* eventSink)
{
  window.Connect(wxEVT_COMMAND_CHECKBOX_CLICKED,
                 (wxObjectEventFunction)
                 (wxEventFunction)
                 method,
                 userData,
                 eventSink);

}
开发者ID:adakite,项目名称:main,代码行数:11,代码来源:XYPlotPanel.cpp


示例9: AddChild

void wxDynamicSashWindowLeaf::AddChild(wxWindow *window)
{
    if (m_child)
        m_child->Destroy();

    m_child = window;

    wxDynamicSashReparentEvent event(this);
    AddPendingEvent(event);
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:10,代码来源:dynamicsash.cpp


示例10: pxTrySetFocus

static bool pxTrySetFocus( wxWindow& parent, wxWindowID id )
{
	if( wxWindow* found = parent.FindWindowById( id ) )
	{
		found->SetFocus();
		return true;
	}

	return false;
}
开发者ID:tsiru,项目名称:pcsx2,代码行数:10,代码来源:ConfirmationDialogs.cpp


示例11: EvtRadioButton

//----------------------------------------
void CXYPlotPanel::EvtRadioButton(wxWindow& window, const wxCommandEventFunction& method, wxObject* userData, wxEvtHandler* eventSink)
{
  window.Connect(wxEVT_COMMAND_RADIOBUTTON_SELECTED,
                 (wxObjectEventFunction)
                 (wxEventFunction)
                 method,
                 userData,
                 eventSink);

}
开发者ID:adakite,项目名称:main,代码行数:11,代码来源:XYPlotPanel.cpp


示例12: EvtUpdateMinSize

//----------------------------------------
void CZFXYPlotFrame::EvtUpdateMinSize(wxWindow& window, int32_t winId, const CZFXYUpdateMinSizeEventFunction& method,
                                wxObject* userData, wxEvtHandler* eventSink)
{
  window.Connect(winId,
                 wxEVT_ZFXY_UPDATE_MINSIZE,
                 (wxObjectEventFunction)
                 (wxEventFunction)
                 method,
                 userData,
                 eventSink);
}
开发者ID:adakite,项目名称:main,代码行数:12,代码来源:ZFXYPlotFrame.cpp


示例13: 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() );
}
开发者ID:AaronDP,项目名称:wxWidgets,代码行数:8,代码来源:setsize.cpp


示例14:

 ~WDO_ENABLE_DISABLE()
 {
     if( m_win )
     {
         m_win->Enable();
         m_win->SetFocus(); // let's focus back on the parent window
     }
 }
开发者ID:BTR1,项目名称:kicad-source-mirror,代码行数:8,代码来源:dialog_shim.cpp


示例15: 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 );
    }
开发者ID:hgwells,项目名称:tive,代码行数:8,代码来源:listbox.cpp


示例16: OnReparent

void wxDynamicSashWindowLeaf::OnReparent(wxEvent &WXUNUSED(event))
{
    if (m_child)
    {
        m_child->Reparent(m_viewport);
    }

    ResizeChild(m_viewport->GetSize());
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:9,代码来源:dynamicsash.cpp


示例17: 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());
}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:10,代码来源:windowtest.cpp


示例18: 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() );
}
开发者ID:AaronDP,项目名称:wxWidgets,代码行数:10,代码来源:setsize.cpp


示例19: 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);
    }
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:12,代码来源:dynamicsash.cpp


示例20: 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
}
开发者ID:ruifig,项目名称:nutcracker,代码行数:13,代码来源:splitter.cpp



注:本文中的wxWindow类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ wxWindowList类代码示例发布时间:2022-05-31
下一篇:
C++ wxWebViewEvent类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap