本文整理汇总了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();
}
}
示例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 );
}
}
}