本文整理汇总了C++中cegui::Listbox::setSize方法的典型用法代码示例。如果您正苦于以下问题:C++ Listbox::setSize方法的具体用法?C++ Listbox::setSize怎么用?C++ Listbox::setSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cegui::Listbox
的用法示例。
在下文中一共展示了Listbox::setSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: listDir
void
MenuState::createGUI()
{
//Limpiar interfaz del estado anterior-------------------
CEGUI::Window* sheet=CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow();
//-------------------------------------------------------
CEGUI::Window* sheetBG = CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/StaticImage","backgroundMenu");
sheetBG->setPosition(CEGUI::UVector2(cegui_reldim(0),cegui_reldim(0)));
sheetBG->setSize( CEGUI::USize(cegui_reldim(1),cegui_reldim(1)));
sheetBG->setProperty("Image","BackgroundImageMenu");
sheetBG->setProperty("FrameEnabled","False");
sheetBG->setProperty("BackgroundEnabled", "False");
CEGUI::ListboxTextItem* itm;
CEGUI::Listbox* editBox = static_cast<CEGUI::Listbox*> (CEGUI::WindowManager::getSingleton().createWindow("OgreTray/Listbox","listbox"));
editBox->setSize(CEGUI::USize(CEGUI::UDim(0.6,0),CEGUI::UDim(0.6,0)));
editBox->setPosition(CEGUI::UVector2(CEGUI::UDim(0.20, 0),CEGUI::UDim(0.10, 0)));
const CEGUI::Image* sel_img = &CEGUI::ImageManager::getSingleton().get("TaharezLook/MultiListSelectionBrush");
std::vector<string> files = listDir("./data/Levels/*"); // ./Para directorio actual ./Carpeta/* para otra carpeta
for(unsigned int i=0;i<files.size();i++){
string aux=files[i];
if(Ogre::StringUtil::endsWith(aux,".txt")){
cout << "================ File: " << aux <<"================"<< endl;
_recorridos.push_back(aux);
string file=Ogre::StringUtil::split(aux,"/")[3];
cout<<"File: " << file << endl;
file=Ogre::StringUtil::replaceAll(file,".txt","");
cout<<"File: " << file << endl;
itm = new CEGUI::ListboxTextItem(file,0);
itm->setFont("DickVanDyke-28");
itm->setTextColours(CEGUI::Colour(0.0,0.8,0.5));
itm->setSelectionBrushImage(sel_img);
editBox->addItem(itm);
}
}
//---------------------------------------------------
CEGUI::Window* playButton = CEGUI::WindowManager::getSingleton().createWindow("OgreTray/Button","playButton");
playButton->setText("[font='DickVanDyke'] Start");
playButton->setSize(CEGUI::USize(CEGUI::UDim(0.25,0),CEGUI::UDim(0.07,0)));
playButton->setPosition(CEGUI::UVector2(CEGUI::UDim(0.4,0),CEGUI::UDim(0.8,0)));
playButton->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(&MenuState::playB,this));
sheetBG->addChild(playButton);
sheetBG->addChild(editBox);
sheet->addChild(sheetBG);
}
示例2: USize
bool
IntroState::options(const CEGUI::EventArgs &e)
{
CEGUI::Window* sheet=CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow();
_credits=false;
_options=true;
_info=false;
//Sheet Records
Window* sheetBG = WindowManager::getSingleton().createWindow("TaharezLook/StaticImage","background_options");
sheetBG->setPosition( UVector2(cegui_reldim(0),cegui_reldim(0)));
sheetBG->setSize( USize(cegui_reldim(1),cegui_reldim(1)));
sheetBG->setProperty("Image","BackgroundImageOptions");
sheetBG->setProperty("FrameEnabled","False");
sheetBG->setProperty("BackgroundEnabled", "False");
CEGUI::Window* backButton = CEGUI::WindowManager::getSingleton().createWindow("OgreTray/Button","back");
backButton->setText("[font='DickVanDyke'] Back ");
backButton->setSize(CEGUI::USize(CEGUI::UDim(0.23,0),CEGUI::UDim(0.07,0)));
backButton->setXPosition(UDim(0.66f, 0.0f));
backButton->setYPosition(UDim(0.85f, 0.0f));
backButton->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(&IntroState::back,this));
CEGUI::Window* applyButton = CEGUI::WindowManager::getSingleton().createWindow("OgreTray/Button","apply");
applyButton->setText("[font='DickVanDyke'] apply ");
applyButton->setSize(CEGUI::USize(CEGUI::UDim(0.23,0),CEGUI::UDim(0.07,0)));
applyButton->setXPosition(UDim(0.66f, 0.0f));
applyButton->setYPosition(UDim(0.77f, 0.0f));
applyButton->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(&IntroState::apply,this));
CEGUI::Window* text = CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/StaticText","text");
text->setText("[font='DickVanDyke'] Mouse Speed");
text->setSize(CEGUI::USize(CEGUI::UDim(0.15,0),CEGUI::UDim(0.1,0)));
text->setPosition(CEGUI::UVector2(CEGUI::UDim(0.12,0),CEGUI::UDim(0.32,0)));
text->setProperty("FrameEnabled","False");
text->setProperty("BackgroundEnabled", "False");
text->setProperty("HorzFormatting", "RightAligned");
CEGUI::Slider* sb = static_cast<CEGUI::Slider*> (CEGUI::WindowManager::getSingleton().createWindow("OgreTray/Slider","SliderSpeed"));
sb->setPosition(CEGUI::UVector2(CEGUI::UDim(0.15,0),CEGUI::UDim(0.4,0)));
sb->setMaxValue(40.0f);
sb->setClickStep(1.0f);
sb->setCurrentValue(20.0f);
sb->subscribeEvent(Slider::EventValueChanged, Event::Subscriber(&IntroState::onSliderValueChanged, this));
CEGUI::Window* sbText = CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/StaticText","textSliderSpeed");
sbText->setText("[font='DickVanDyke']20");
sbText->setSize(CEGUI::USize(CEGUI::UDim(0.05,0),CEGUI::UDim(0.08,0)));
sbText->setPosition(CEGUI::UVector2(CEGUI::UDim(0.36,0),CEGUI::UDim(0.38,0)));
sbText->setProperty("FrameEnabled","False");
sbText->setProperty("BackgroundEnabled", "False");
sbText->setProperty("HorzFormatting", "RightAligned");
CEGUI::Window* text2 = CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/StaticText","text2");
text2->setText("[font='DickVanDyke'] Auto-Reload Arrows");
text2->setSize(CEGUI::USize(CEGUI::UDim(0.25,0),CEGUI::UDim(0.06,0)));
text2->setPosition(CEGUI::UVector2(CEGUI::UDim(0.15,0),CEGUI::UDim(0.46,0)));
text2->setProperty("FrameEnabled","False");
text2->setProperty("BackgroundEnabled", "False");
text2->setProperty("HorzFormatting", "LeftAligned");
CEGUI::ToggleButton* cb = static_cast<CEGUI::ToggleButton*> (CEGUI::WindowManager::getSingleton().createWindow("OgreTray/Checkbox","CBAutoReload"));
cb->setPosition(CEGUI::UVector2(CEGUI::UDim(0.08,0),CEGUI::UDim(0.52,0)));
CEGUI::Window* resetButton = CEGUI::WindowManager::getSingleton().createWindow("OgreTray/Button","resetButton");
resetButton->setText("[font='DickVanDyke'] Reset Records ");
resetButton->setSize(CEGUI::USize(CEGUI::UDim(0.23,0),CEGUI::UDim(0.07,0)));
resetButton->setXPosition(UDim(0.40f, 0.0f));
resetButton->setYPosition(UDim(0.85f, 0.0f));
resetButton->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(&IntroState::resetRecords,this));
CEGUI::Window* configButton = CEGUI::WindowManager::getSingleton().createWindow("OgreTray/Button","configButton");
configButton->setText("[font='DickVanDyke'] Restore Config ");
configButton->setSize(CEGUI::USize(CEGUI::UDim(0.23,0),CEGUI::UDim(0.07,0)));
configButton->setXPosition(UDim(0.40f, 0.0f));
configButton->setYPosition(UDim(0.77f, 0.0f));
configButton->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(&IntroState::resetConfig,this));
CEGUI::Window* text3 = CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/StaticText","FullscreenText");
text3->setText("[font='DickVanDyke'] Fullscreen");
text3->setSize(CEGUI::USize(CEGUI::UDim(0.25,0),CEGUI::UDim(0.06,0)));
text3->setPosition(CEGUI::UVector2(CEGUI::UDim(0.15,0),CEGUI::UDim(0.57,0)));
text3->setProperty("FrameEnabled","False");
text3->setProperty("BackgroundEnabled", "False");
text3->setProperty("HorzFormatting", "LeftAligned");
CEGUI::ToggleButton* cbFullscreen = static_cast<CEGUI::ToggleButton*> (CEGUI::WindowManager::getSingleton().createWindow("OgreTray/Checkbox","CBFullscreen"));
cbFullscreen->setPosition(CEGUI::UVector2(CEGUI::UDim(0.08,0),CEGUI::UDim(0.62,0)));
cbFullscreen->subscribeEvent(CEGUI::ToggleButton::EventSelectStateChanged,CEGUI::Event::Subscriber(&IntroState::tbFullscreenChanged,this));
CEGUI::Window* text4 = CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/StaticText","ResolutionText");
text4->setText("[font='DickVanDyke'] Resolution");
text4->setSize(CEGUI::USize(CEGUI::UDim(0.25,0),CEGUI::UDim(0.06,0)));
text4->setPosition(CEGUI::UVector2(CEGUI::UDim(0.5,0),CEGUI::UDim(0.35,0)));
text4->setProperty("FrameEnabled","False");
text4->setProperty("BackgroundEnabled", "False");
text4->setProperty("HorzFormatting", "LeftAligned");
//.........这里部分代码省略.........