本文整理汇总了C++中cegui::Combobox::setText方法的典型用法代码示例。如果您正苦于以下问题:C++ Combobox::setText方法的具体用法?C++ Combobox::setText怎么用?C++ Combobox::setText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cegui::Combobox
的用法示例。
在下文中一共展示了Combobox::setText方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Editor_Activate
void cRokko::Editor_Activate(void)
{
CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
// direction
CEGUI::Combobox* combobox = static_cast<CEGUI::Combobox*>(wmgr.createWindow("TaharezLook/Combobox", "editor_rokko_direction"));
Editor_Add(UTF8_("Direction"), UTF8_("Direction it moves into."), combobox, 100, 110);
combobox->addItem(new CEGUI::ListboxTextItem("left"));
combobox->addItem(new CEGUI::ListboxTextItem("right"));
combobox->addItem(new CEGUI::ListboxTextItem("up"));
combobox->addItem(new CEGUI::ListboxTextItem("down"));
combobox->setText(Get_Direction_Name(m_start_direction));
combobox->subscribeEvent(CEGUI::Combobox::EventListSelectionAccepted, CEGUI::Event::Subscriber(&cRokko::Editor_Direction_Select, this));
// speed
CEGUI::Editbox* editbox = static_cast<CEGUI::Editbox*>(wmgr.createWindow("TaharezLook/Editbox", "editor_rokko_speed"));
Editor_Add(UTF8_("Speed"), UTF8_("Speed when activated"), editbox, 120);
editbox->setValidationString("[+]?[0-9]*\\.?[0-9]*");
editbox->setText(float_to_string(m_speed, 6, 0));
editbox->subscribeEvent(CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber(&cRokko::Editor_Speed_Text_Changed, this));
// init
Editor_Init();
}
示例2:
void cSpikeball :: Editor_Activate( void )
{
// get window manager
CEGUI::WindowManager &wmgr = CEGUI::WindowManager::getSingleton();
// direction
CEGUI::Combobox *combobox = static_cast<CEGUI::Combobox *>(wmgr.createWindow( "TaharezLook/Combobox", "editor_spikeball_direction" ));
Editor_Add( UTF8_("Direction"), UTF8_("Starting direction."), combobox, 100, 75 );
combobox->addItem( new CEGUI::ListboxTextItem( "left" ) );
combobox->addItem( new CEGUI::ListboxTextItem( "right" ) );
combobox->setText( Get_Direction_Name( m_start_direction ) );
combobox->subscribeEvent( CEGUI::Combobox::EventListSelectionAccepted, CEGUI::Event::Subscriber( &cSpikeball::Editor_Direction_Select, this ) );
// init
Editor_Init();
}
示例3: Editor_Activate
void cFlyon::Editor_Activate(void)
{
// get window manager
CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
// direction
CEGUI::Combobox* combobox = static_cast<CEGUI::Combobox*>(wmgr.createWindow("TaharezLook/Combobox", "editor_flyon_direction"));
Editor_Add(UTF8_("Direction"), UTF8_("Direction it moves into."), combobox, 100, 110);
combobox->addItem(new CEGUI::ListboxTextItem("up"));
combobox->addItem(new CEGUI::ListboxTextItem("down"));
combobox->addItem(new CEGUI::ListboxTextItem("left"));
combobox->addItem(new CEGUI::ListboxTextItem("right"));
combobox->setText(Get_Direction_Name(m_start_direction));
combobox->subscribeEvent(CEGUI::Combobox::EventListSelectionAccepted, CEGUI::Event::Subscriber(&cFlyon::Editor_Direction_Select, this));
// image dir
CEGUI::Editbox* editbox = static_cast<CEGUI::Editbox*>(wmgr.createWindow("TaharezLook/Editbox", "editor_flyon_image_dir"));
Editor_Add(UTF8_("Image directory"), UTF8_("Directory containing the images"), editbox, 200);
editbox->setText(path_to_utf8(m_img_dir).c_str());
editbox->subscribeEvent(CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber(&cFlyon::Editor_Image_Dir_Text_Changed, this));
// max distance
editbox = static_cast<CEGUI::Editbox*>(wmgr.createWindow("TaharezLook/Editbox", "editor_flyon_max_distance"));
Editor_Add(UTF8_("Distance"), _("Movable Distance into its direction"), editbox, 90);
editbox->setValidationString("^[+]?\\d*$");
editbox->setText(int_to_string(static_cast<int>(m_max_distance)));
editbox->subscribeEvent(CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber(&cFlyon::Editor_Max_Distance_Text_Changed, this));
// speed
editbox = static_cast<CEGUI::Editbox*>(wmgr.createWindow("TaharezLook/Editbox", "editor_flyon_speed"));
Editor_Add(UTF8_("Speed"), UTF8_("Initial speed when jumping out"), editbox, 120);
editbox->setValidationString("[+]?[0-9]*\\.?[0-9]*");
editbox->setText(float_to_string(m_speed, 6, 0));
editbox->subscribeEvent(CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber(&cFlyon::Editor_Speed_Text_Changed, this));
// init
Editor_Init();
}
示例4: Ice
void cStaticEnemy :: Editor_Activate( void )
{
// get window manager
CEGUI::WindowManager &wmgr = CEGUI::WindowManager::getSingleton();
// image
CEGUI::Editbox *editbox = static_cast<CEGUI::Editbox *>(wmgr.createWindow( "TaharezLook/Editbox", "editor_static_enemy_image" ));
Editor_Add( UTF8_("Image"), UTF8_("Image filename"), editbox, 200 );
editbox->setText( m_img_filename.c_str() );
editbox->subscribeEvent( CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber( &cStaticEnemy::Editor_Image_Text_Changed, this ) );
// rotation speed
editbox = static_cast<CEGUI::Editbox *>(wmgr.createWindow( "TaharezLook/Editbox", "editor_static_enemy_rotation_speed" ));
Editor_Add( UTF8_("Rotation Speed"), UTF8_("Rotation Speed"), editbox, 120 );
editbox->setValidationString( "[-+]?[0-9]*\\.?[0-9]*" );
editbox->setText( float_to_string( m_rotation_speed ) );
editbox->subscribeEvent( CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber( &cStaticEnemy::Editor_Rotation_Speed_Text_Changed, this ) );
// path
editbox = static_cast<CEGUI::Editbox *>(wmgr.createWindow( "TaharezLook/Editbox", "editor_static_enemy_path_identifier" ));
Editor_Add( UTF8_("Path Identifier"), UTF8_("Name of the Path to move along."), editbox, 120 );
editbox->setText( m_path_state.m_path_identifier.c_str() );
editbox->subscribeEvent( CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber( &cStaticEnemy::Editor_Path_Identifier_Text_Changed, this ) );
// speed
editbox = static_cast<CEGUI::Editbox *>(wmgr.createWindow( "TaharezLook/Editbox", "editor_static_enemy_speed" ));
Editor_Add( UTF8_("Speed"), UTF8_("Maximum speed"), editbox, 120 );
editbox->setValidationString( "[-+]?[0-9]*\\.?[0-9]*" );
editbox->setText( float_to_string( m_speed ) );
editbox->subscribeEvent( CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber( &cStaticEnemy::Editor_Speed_Text_Changed, this ) );
// fire resistant
CEGUI::Combobox *combobox = static_cast<CEGUI::Combobox *>(wmgr.createWindow( "TaharezLook/Combobox", "editor_static_enemy_fire_resistant" ));
Editor_Add( UTF8_("Fire Resistant"), UTF8_("If it is resistant against fire"), combobox, 120, 80 );
combobox->addItem( new CEGUI::ListboxTextItem( UTF8_("Enabled") ) );
combobox->addItem( new CEGUI::ListboxTextItem( UTF8_("Disabled") ) );
if( m_fire_resistant )
{
combobox->setText( UTF8_("Enabled") );
}
else
{
combobox->setText( UTF8_("Disabled") );
}
combobox->subscribeEvent( CEGUI::Combobox::EventListSelectionAccepted, CEGUI::Event::Subscriber( &cStaticEnemy::Editor_Fire_Resistant_Select, this ) );
// ice resistance
editbox = static_cast<CEGUI::Editbox *>(wmgr.createWindow( "TaharezLook/Editbox", "editor_static_enemy_ice_resistance" ));
Editor_Add( UTF8_("Ice Resistance"), UTF8_("Resistance against Ice (0.0-1.0)"), editbox, 120 );
editbox->setValidationString( "[+]?[0-9]*\\.?[0-9]*" );
editbox->setText( float_to_string( m_ice_resistance ) );
editbox->subscribeEvent( CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber( &cStaticEnemy::Editor_Ice_Resistance_Text_Changed, this ) );
// init
Editor_Init();
}
示例5: Editor_Activate
void cBonusBox::Editor_Activate(void)
{
// BaseBox Settings first
cBaseBox::Editor_Activate();
// get window manager
CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
// Animation
CEGUI::Combobox* combobox = static_cast<CEGUI::Combobox*>(wmgr.createWindow("TaharezLook/Combobox", "editor_bonusbox_animation"));
Editor_Add(UTF8_("Animation"), UTF8_("Use the Power animation if the box has a good or needed item for this level"), combobox, 120, 100);
combobox->addItem(new CEGUI::ListboxTextItem("Default"));
combobox->addItem(new CEGUI::ListboxTextItem("Bonus"));
combobox->addItem(new CEGUI::ListboxTextItem("Power"));
combobox->setText(reinterpret_cast<const CEGUI::utf8*>(m_anim_type.c_str()));
combobox->subscribeEvent(CEGUI::Combobox::EventListSelectionAccepted, CEGUI::Event::Subscriber(&cBonusBox::Editor_Animation_Select, this));
// Item
combobox = static_cast<CEGUI::Combobox*>(wmgr.createWindow("TaharezLook/Combobox", "editor_bonusbox_item"));
Editor_Add(UTF8_("Item"), UTF8_("The item that gets spawned"), combobox, 160, 140);
combobox->addItem(new CEGUI::ListboxTextItem(UTF8_("Empty")));
combobox->addItem(new CEGUI::ListboxTextItem(UTF8_("Random")));
combobox->addItem(new CEGUI::ListboxTextItem(UTF8_("Berry")));
combobox->addItem(new CEGUI::ListboxTextItem(UTF8_("Fire berry")));
combobox->addItem(new CEGUI::ListboxTextItem(UTF8_("Ice berry")));
combobox->addItem(new CEGUI::ListboxTextItem(UTF8_("Ghost berry")));
combobox->addItem(new CEGUI::ListboxTextItem(UTF8_("1-UP berry")));
combobox->addItem(new CEGUI::ListboxTextItem(UTF8_("Lemon")));
combobox->addItem(new CEGUI::ListboxTextItem(UTF8_("Jewel")));
combobox->addItem(new CEGUI::ListboxTextItem(UTF8_("Poisonous berry")));
if (box_type == TYPE_MUSHROOM_DEFAULT) {
combobox->setText(UTF8_("Berry"));
}
else if (box_type == TYPE_FIREPLANT) {
combobox->setText(UTF8_("Fire berry"));
}
else if (box_type == TYPE_MUSHROOM_BLUE) {
combobox->setText(UTF8_("Ice berry"));
}
else if (box_type == TYPE_MUSHROOM_GHOST) {
combobox->setText(UTF8_("Ghost berry"));
}
else if (box_type == TYPE_MUSHROOM_LIVE_1) {
combobox->setText(UTF8_("1-UP berry"));
}
else if (box_type == TYPE_STAR) {
combobox->setText(UTF8_("Lemon"));
}
else if (box_type == TYPE_GOLDPIECE) {
combobox->setText(UTF8_("Jewel"));
}
else if (box_type == TYPE_MUSHROOM_POISON) {
combobox->setText(UTF8_("Poisonous berry"));
}
else if (box_type == TYPE_POWERUP) {
combobox->setText(UTF8_("Random"));
}
else {
combobox->setText(UTF8_("Empty"));
}
combobox->subscribeEvent(CEGUI::Combobox::EventListSelectionAccepted, CEGUI::Event::Subscriber(&cBonusBox::Editor_Item_Select, this));
// Force best item
combobox = static_cast<CEGUI::Combobox*>(wmgr.createWindow("TaharezLook/Combobox", "editor_bonusbox_force_best_item"));
Editor_Add(UTF8_("Force item"), UTF8_("Force best available item when activated"), combobox, 120, 80);
combobox->addItem(new CEGUI::ListboxTextItem(UTF8_("Enabled")));
combobox->addItem(new CEGUI::ListboxTextItem(UTF8_("Disabled")));
if (m_force_best_item) {
combobox->setText(UTF8_("Enabled"));
}
else {
combobox->setText(UTF8_("Disabled"));
}
combobox->subscribeEvent(CEGUI::Combobox::EventListSelectionAccepted, CEGUI::Event::Subscriber(&cBonusBox::Editor_Force_best_item_Select, this));
// gold color
combobox = static_cast<CEGUI::Combobox*>(wmgr.createWindow("TaharezLook/Combobox", "editor_bonusbox_gold_color"));
Editor_Add(UTF8_("Jewel color"), UTF8_("Jewel color if the item is a jewel"), combobox, 100, 80);
combobox->addItem(new CEGUI::ListboxTextItem("yellow"));
combobox->addItem(new CEGUI::ListboxTextItem("red"));
combobox->setText(Get_Color_Name(m_gold_color));
combobox->subscribeEvent(CEGUI::Combobox::EventListSelectionAccepted, CEGUI::Event::Subscriber(&cBonusBox::Editor_Gold_Color_Select, this));
// init
Editor_Init();
}