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


C++ TopWindow::resize方法代码示例

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


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

示例1: resize

void GenericLayout::resize( int width, int height )
{
    // Update the window size
    m_width = width;
    m_height = height;

    // Recreate a new image
    if( m_pImage )
    {
        delete m_pImage;
        OSFactory *pOsFactory = OSFactory::instance( getIntf() );
        m_pImage = pOsFactory->createOSGraphics( width, height );
    }

    // Notify all the controls that the size has changed and redraw them
    list<LayeredControl>::const_iterator iter;
    for( iter = m_controlList.begin(); iter != m_controlList.end(); iter++ )
    {
        iter->m_pControl->onResize();
    }

    // Resize and refresh the associated window
    TopWindow *pWindow = getWindow();
    if( pWindow )
    {
        // Resize the window
        pWindow->resize( width, height );
        refreshAll();
        // Change the shape of the window and redraw it
        pWindow->updateShape();
        refreshAll();
    }
}
开发者ID:,项目名称:,代码行数:33,代码来源:

示例2: resize

void WindowManager::resize( GenericLayout &rLayout,
                            int width, int height ) const
{
    // TODO: handle anchored windows
    // Compute the real resizing offset
    int xOffset = width - rLayout.getWidth();
    int yOffset = height - rLayout.getHeight();

    // Check anchoring; this can change the values of xOffset and yOffset
    checkAnchors( rLayout.getWindow(), xOffset, yOffset );
    if( m_direction == kResizeS )
        xOffset = 0;
    if( m_direction == kResizeE )
        yOffset = 0;

    int newWidth = rLayout.getWidth() + xOffset;
    int newHeight = rLayout.getHeight() + yOffset;

    // Check boundaries
    if( newWidth < rLayout.getMinWidth() )
    {
        newWidth = rLayout.getMinWidth();
    }
    if( newWidth > rLayout.getMaxWidth() )
    {
        newWidth = rLayout.getMaxWidth();
    }
    if( newHeight < rLayout.getMinHeight() )
    {
        newHeight = rLayout.getMinHeight();
    }
    if( newHeight > rLayout.getMaxHeight() )
    {
        newHeight = rLayout.getMaxHeight();
    }

    if( newWidth == rLayout.getWidth() && newHeight == rLayout.getHeight() )
    {
        return;
    }

    // New offset, after the last corrections
    int xNewOffset = newWidth - rLayout.getWidth();
    int yNewOffset = newHeight - rLayout.getHeight();

    // Resize the window
    TopWindow *pWindow = rLayout.getWindow();
    pWindow->resize( newWidth, newHeight );

    // Do the actual resizing
    rLayout.resize( newWidth, newHeight );

    // refresh content
    rLayout.refreshAll();

    // Move all the anchored windows
    WinSet_t::const_iterator it;
    if( m_direction == kResizeE ||
        m_direction == kResizeSE )
    {
        for( it = m_resizeMovingE.begin(); it != m_resizeMovingE.end(); ++it )
        {
            (*it)->move( (*it)->getLeft() + xNewOffset,
                         (*it)->getTop() );
        }
    }
    if( m_direction == kResizeS ||
        m_direction == kResizeSE )
    {
        for( it = m_resizeMovingS.begin(); it != m_resizeMovingS.end(); ++it )
        {
            (*it)->move( (*it)->getLeft(),
                         (*it)->getTop( )+ yNewOffset );
        }
    }
    if( m_direction == kResizeE ||
        m_direction == kResizeS ||
        m_direction == kResizeSE )
    {
        for( it = m_resizeMovingSE.begin(); it != m_resizeMovingSE.end(); ++it )
        {
            (*it)->move( (*it)->getLeft() + xNewOffset,
                         (*it)->getTop() + yNewOffset );
        }
    }
}
开发者ID:371816210,项目名称:vlc_vlc,代码行数:86,代码来源:window_manager.cpp


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