当前位置: 首页>>代码示例>>C++>>正文


C++ wxWindow::SetSize方法代码示例

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


在下文中一共展示了wxWindow::SetSize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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

示例2: 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

示例3: ResizeChild

void wxDynamicSashWindowLeaf::ResizeChild(const wxSize& size)
{
    if (m_child)
    {
        if (m_impl->m_window->HasFlag(wxDS_MANAGE_SCROLLBARS))
        {
            wxSize best_size = m_child->GetBestSize();
            if (best_size.GetWidth() < size.GetWidth())
                best_size.SetWidth(size.GetWidth());
            if (best_size.GetHeight() < size.GetHeight())
                best_size.SetHeight(size.GetHeight());
            m_child->SetSize(best_size);

            int hpos = m_hscroll->GetThumbPosition();
            int vpos = m_vscroll->GetThumbPosition();

            if (hpos < 0)
                hpos = 0;
            if (vpos < 0)
                vpos = 0;
            if (hpos > best_size.GetWidth() - size.GetWidth())
                hpos = best_size.GetWidth() - size.GetWidth();
            if (vpos > best_size.GetHeight() - size.GetHeight())
                vpos = best_size.GetHeight() - size.GetHeight();

            m_hscroll->SetScrollbar(hpos, size.GetWidth(),
                                    best_size.GetWidth(), size.GetWidth());
            m_vscroll->SetScrollbar(vpos, size.GetHeight(),
                                    best_size.GetHeight(), size.GetHeight());

            //  Umm, the scrollbars are doing something insane under GTK+ and subtracting
            //  one from the position I pass in.  This works around that.
            m_hscroll->SetThumbPosition(hpos + hpos - m_hscroll->GetThumbPosition());
            m_vscroll->SetThumbPosition(vpos + vpos - m_vscroll->GetThumbPosition());

            wxPoint pos = m_child->GetPosition();
            m_viewport->ScrollWindow(-hpos - pos.x, -vpos - pos.y);
        }
        else // !wxDS_MANAGE_SCROLLBARS
        {
            m_child->SetSize(size);
        }
    }
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:44,代码来源:dynamicsash.cpp

示例4: SetSize

void SetSizeTestCase::SetSize()
{
    const wxSize size(127, 35);
    m_win->SetSize(size);
    CPPUNIT_ASSERT_EQUAL( size, m_win->GetSize() );
}
开发者ID:AaronDP,项目名称:wxWidgets,代码行数:6,代码来源:setsize.cpp


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