本文整理汇总了C++中cegui::Window::getHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ Window::getHeight方法的具体用法?C++ Window::getHeight怎么用?C++ Window::getHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cegui::Window
的用法示例。
在下文中一共展示了Window::getHeight方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AlignSelection
//------------------------------------------------------------------------
void SelectionMover::AlignSelection(const Alignment alignment)
{
// Validations
wxASSERT_MSG(m_selection != NULL, wxT("Selection member is NULL"));
if(m_selection->Size() <= 1)
{
// Should not happen because of the disabled menu/toolbar item in this case
LogWarning(wxT("You must select more than one window to align!"));
return;
}
// The first selected window is the one to match. This is for example how Visual Studio's
// dialog editor works as well.
Selection::Boxes::iterator boxIt = m_selection->GetMoveableBoxes().begin();
CEGUI::Window *current = boxIt->GetWindow();
const CEGUI::URect rect = current->getArea();
++boxIt;
for(; boxIt != m_selection->GetMoveableBoxes().end(); ++boxIt) {
// Deny when it is blocked
if (boxIt->IsLocked())
continue;
current = boxIt->GetWindow();
switch(alignment)
{
case AlignLeft:
current->setPosition(CEGUI::UVector2(rect.d_min.d_x, current->getPosition().d_y));
break;
case AlignRight:
current->setPosition(CEGUI::UVector2(rect.d_max.d_x - current->getWidth(), current->getPosition().d_y));
break;
case AlignTop:
current->setPosition(CEGUI::UVector2(current->getPosition().d_x, rect.d_min.d_y));
break;
case AlignBottom:
current->setPosition(CEGUI::UVector2(current->getPosition().d_x, rect.d_max.d_y - current->getHeight()));
break;
case AlignWidth:
// The svn diff for this block will be big; no clue what the previous code
// was doing there..
current->setWidth(rect.getWidth());
break;
case AlignHeight:
// The svn diff for this block will be big; no clue what the previous code
// was doing there..
current->setHeight(rect.getHeight());
break;
default:
LogError(wxT("SelectionMover::AlignSelection - Unrecognized align option (%d)"), alignment);
return;
}
}
// Request for a repaint
wxGetApp().GetMainFrame()->Refresh();
}