本文整理汇总了C++中cegui::Combobox::setItemSelectState方法的典型用法代码示例。如果您正苦于以下问题:C++ Combobox::setItemSelectState方法的具体用法?C++ Combobox::setItemSelectState怎么用?C++ Combobox::setItemSelectState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cegui::Combobox
的用法示例。
在下文中一共展示了Combobox::setItemSelectState方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CEditBoxExit
CEditBoxExit(int id,
CEGUI::Window *pParent,
float fButtonSize,
const CEGUI::String &sTitle,
CExit &exit)
: CEditBoxBase(id, pParent, fButtonSize, sTitle),
m_Exit(exit),
m_BackupExit(exit) {
using namespace CEGUI;
Combobox *pComboBox = dynamic_cast<Combobox*>(m_pWindow->createChild("OgreTray/Combobox", "ExitSelect"));
m_pCombobox = pComboBox;
pComboBox->setPosition(UVector2(UDim(0, 0), UDim(0, 0)));
pComboBox->setSize(USize(UDim(1, 0), UDim(0, 3 * fButtonSize)));
pComboBox->addItem(new ListboxTextItem("Region"));
pComboBox->addItem(new ListboxTextItem("Enemy death"));
pComboBox->setAutoSizeListHeightToContent(true);
pComboBox->setReadOnly(true);
pComboBox->subscribeEvent(Combobox::EventListSelectionAccepted,
Event::Subscriber(&CEditBoxExit::onListSelectionChanged, this));
// id
m_pContentId = m_pWindow->createChild("DefaultWindow", "id");
m_pContentId->setPosition(UVector2(UDim(0, 0), UDim(0, fButtonSize)));
m_pContentId->setSize(USize(UDim(1, 0), UDim(0, 2 * fButtonSize)));
Window *pLabel = m_pContentId->createChild("OgreTray/Label", "Exitidlabel");
pLabel->setPosition(UVector2(UDim(0, 0), UDim(0, 0)));
pLabel->setSize(USize(UDim(0, fButtonSize), UDim(0, fButtonSize)));
pLabel->setText("id");
Window *pEditBox = m_pContentId->createChild("OgreTray/Editbox", "Exitid");
pEditBox->setPosition(UVector2(UDim(0, fButtonSize), UDim(0, 0)));
pEditBox->setSize(USize(UDim(1, -fButtonSize), UDim(0, fButtonSize)));
pEditBox->setText(m_Exit.getID());
m_pContentId->setVisible(m_Exit.getExitType() == EXIT_ENEMY_DEATH);
// region
m_pContentRegion = m_pWindow->createChild("DefaultWindow", "region");
m_pContentRegion->setPosition(UVector2(UDim(0, 0), UDim(0, fButtonSize)));
m_pContentRegion->setSize(USize(UDim(1, 0), UDim(0, 2 * fButtonSize)));
createVector(m_pContentRegion, "pos", m_Exit.getBoundingBox().getPosition().x, m_Exit.getBoundingBox().getPosition().y, fButtonSize, 0);
createVector(m_pContentRegion, "size", m_Exit.getBoundingBox().getSize().x, m_Exit.getBoundingBox().getSize().y, fButtonSize, fButtonSize);
m_pContentRegion->setVisible(m_Exit.getExitType() == EXIT_REGION);
// default selected exit type
m_pCombobox->setItemSelectState(m_Exit.getExitType(), true);
}