本文整理汇总了C++中cegui::Editbox::setValidationString方法的典型用法代码示例。如果您正苦于以下问题:C++ Editbox::setValidationString方法的具体用法?C++ Editbox::setValidationString怎么用?C++ Editbox::setValidationString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cegui::Editbox
的用法示例。
在下文中一共展示了Editbox::setValidationString方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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();
}
示例3:
void cLayer_Line_Point_Start :: Editor_Activate( void )
{
// get window manager
CEGUI::WindowManager &wmgr = CEGUI::WindowManager::getSingleton();
// origin
CEGUI::Editbox *editbox = static_cast<CEGUI::Editbox *>(wmgr.createWindow( "TaharezLook/Editbox", "layer_line_origin" ));
Editor_Add( UTF8_("Waypoint origin"), UTF8_("Waypoint origin"), editbox, 100 );
editbox->setValidationString( "^[+]?\\d*$" );
editbox->setText( int_to_string( m_origin ) );
editbox->subscribeEvent( CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber( &cLayer_Line_Point_Start::Editor_Origin_Text_Changed, this ) );
// init
Editor_Init();
}
示例4: showHighScoreEntryDialog
void GameState::showHighScoreEntryDialog()
{
CEGUI::WindowManager& winMgr = CEGUI::WindowManager::getSingleton();
_highScoreEntryDialog = winMgr.loadWindowLayout( "highScoreEntry.layout" );
CEGUI::Window* text = static_cast<CEGUI::Window*>(winMgr.getWindow("StaticText"));
CEGUI::PushButton* btnOk = static_cast<CEGUI::PushButton*>(winMgr.getWindow("btnOk"));
CEGUI::PushButton* btnCancel = static_cast<CEGUI::PushButton*>(winMgr.getWindow("btnCancel"));
CEGUI::Editbox* editbox = static_cast<CEGUI::Editbox*>(winMgr.getWindow("Editbox"));
text->setText(std::string("New HighScore!\n")+boost::lexical_cast<std::string,int>((int)_playerScore));
btnOk->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GameState::enterHighScore,this) );
btnCancel->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GameState::skipHighScore,this) );
editbox->setText("Unknown");
editbox->setMaxTextLength(7);
editbox->setValidationString("^\\w*$");
CEGUI::System::getSingleton().setGUISheet( _highScoreEntryDialog );
}
示例5: Editor_Activate
void cRandom_Sound::Editor_Activate(void)
{
CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
// filename
CEGUI::Editbox* editbox = static_cast<CEGUI::Editbox*>(wmgr.createWindow("TaharezLook/Editbox", "editor_sound_filename"));
Editor_Add(UTF8_("Filename"), UTF8_("Sound filename"), editbox, 200);
editbox->setText(m_filename.c_str());
editbox->subscribeEvent(CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber(&cRandom_Sound::Editor_Filename_Text_Changed, this));
// continuous
CEGUI::Checkbox* checkbox = static_cast<CEGUI::Checkbox*>(wmgr.createWindow("TaharezLook/Checkbox", "editor_sound_continuous"));
Editor_Add(UTF8_("Continuous"), UTF8_("Check if the sound should be played continuously instead of randomly"), checkbox, 50);
checkbox->setSelected(m_continuous);
checkbox->subscribeEvent(CEGUI::Checkbox::EventCheckStateChanged, CEGUI::Event::Subscriber(&cRandom_Sound::Editor_Continuous_Changed, this));
// delay min
editbox = static_cast<CEGUI::Editbox*>(wmgr.createWindow("TaharezLook/Editbox", "editor_sound_delay_min"));
Editor_Add(UTF8_("Delay Minimum"), UTF8_("Minimal delay until played again"), editbox, 90);
editbox->setValidationString("^[+]?\\d*$");
editbox->setText(int_to_string(m_delay_min));
editbox->subscribeEvent(CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber(&cRandom_Sound::Editor_Delay_Min_Text_Changed, this));
// delay max
editbox = static_cast<CEGUI::Editbox*>(wmgr.createWindow("TaharezLook/Editbox", "editor_sound_delay_max"));
Editor_Add(UTF8_("Maximum"), UTF8_("Maximal delay until played again"), editbox, 90, 28, 0);
editbox->setValidationString("^[+]?\\d*$");
editbox->setText(int_to_string(m_delay_max));
editbox->subscribeEvent(CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber(&cRandom_Sound::Editor_Delay_Max_Text_Changed, this));
// volume min
editbox = static_cast<CEGUI::Editbox*>(wmgr.createWindow("TaharezLook/Editbox", "editor_sound_volume_min"));
Editor_Add(UTF8_("Volume Minimum"), UTF8_("Minimal random volume for each play"), editbox, 90);
editbox->setValidationString("^[+]?\\d*$");
editbox->setText(int_to_string(static_cast<int>(m_volume_min)));
editbox->subscribeEvent(CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber(&cRandom_Sound::Editor_Volume_Min_Text_Changed, this));
// volume max
editbox = static_cast<CEGUI::Editbox*>(wmgr.createWindow("TaharezLook/Editbox", "editor_sound_volume_max"));
Editor_Add(UTF8_("Maximum"), UTF8_("Maximal random volume for each play"), editbox, 90, 28, 0);
editbox->setValidationString("^[+]?\\d*$");
editbox->setText(int_to_string(static_cast<int>(m_volume_max)));
editbox->subscribeEvent(CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber(&cRandom_Sound::Editor_Volume_Max_Text_Changed, this));
// volume reduction begin
editbox = static_cast<CEGUI::Editbox*>(wmgr.createWindow("TaharezLook/Editbox", "editor_sound_volume_reduction_begin"));
Editor_Add(UTF8_("Volume Reduction Begin"), UTF8_("Volume reduction begins gradually at this distance"), editbox, 90);
editbox->setValidationString("^[+]?\\d*$");
editbox->setText(int_to_string(static_cast<int>(m_volume_reduction_begin)));
editbox->subscribeEvent(CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber(&cRandom_Sound::Editor_Volume_Reduction_Begin_Text_Changed, this));
// volume reduction end
editbox = static_cast<CEGUI::Editbox*>(wmgr.createWindow("TaharezLook/Editbox", "editor_sound_volume_reduction_end"));
Editor_Add(UTF8_("End"), UTF8_("Volume reduction ends at this distance. Sound is not played beyond this."), editbox, 90, 28, 0);
editbox->setValidationString("^[+]?\\d*$");
editbox->setText(int_to_string(static_cast<int>(m_volume_reduction_end)));
editbox->subscribeEvent(CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber(&cRandom_Sound::Editor_Volume_Reduction_End_Text_Changed, this));
// init
Editor_Init();
}
示例6: 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();
}
示例7: SetInitializedAHUIProperty
void SetInitializedAHUIProperty(CEGUI::Window* pageWnd)
{
//第一次打开窗口,默认可见
pageWnd->setVisible(false);
CEGUI::Window* tab1 = pageWnd->getChildRecursive("Auction/Tab/BuySale");
tab1->setVisible(true);//默认Tab1可见
CEGUI::Editbox* editbox = WEditBox(pageWnd->getChildRecursive("Auction/Pickup/EditGold"));//金币提取编辑框只能为数字
editbox->setText("");
editbox->setReadOnly(true);
//editbox->setMaxTextLength(10);
//只能输入数字
editbox->setValidationString("[0-9]*");
editbox = WEditBox(pageWnd->getChildRecursive("Auction/Pickup/EditWeimian"));//位面提取编辑框只能为数字
editbox->setText("");
editbox->setReadOnly(true);
editbox->setValidationString("[0-9]*");
//editbox->setMaxTextLength(10);
CEGUI::MultiColumnList* mcl = WMCL(pageWnd->getChildRecursive("Auction/Tab/BuySale/SaleMCL"));
mcl->setUserColumnDraggingEnabled(false);//列不可拖动
mcl->setUserSortControlEnabled(false);//列不可排序
mcl->setUserColumnSizingEnabled(false);//列不可调整宽度
mcl = WMCL(pageWnd->getChildRecursive("Auction/Tab/BuySale/BuyMCL"));
mcl->setUserColumnDraggingEnabled(false);//列不可拖动
mcl->setUserSortControlEnabled(false);//列不可排序
mcl->setUserColumnSizingEnabled(false);//列不可调整宽度
CEGUI::Window* wnd = pageWnd->getChildRecursive("Auction/SaleWnd");
wnd->setVisible(false);//出售界面默认不可见
editbox = WEditBox(pageWnd->getChildRecursive("Auction/SaleWnd/saleNum"));//出售界面编辑框只能输入数字
editbox->setText("");
editbox->setMaxTextLength(10);
//editbox->setReadOnly(false);
editbox->setValidationString("[0-9]*");
editbox = WEditBox(pageWnd->getChildRecursive("Auction/SaleWnd/Text6"));//出售界面交易文本提示
editbox->setText("");
editbox = WEditBox(pageWnd->getChildRecursive("Auction/SaleWnd/Text61"));//
editbox->setText("");
wnd = pageWnd->getChildRecursive("Auction/BuyWnd");
wnd->setVisible(false);//购买界面默认不可见
editbox = WEditBox(pageWnd->getChildRecursive("Auction/Buy/buyNum"));//购买界面编辑框只能输入数字
editbox->setText("");
//editbox->setReadOnly(false);
editbox->setValidationString("[0-9]*");
editbox->setMaxTextLength(4);
editbox = WEditBox(pageWnd->getChildRecursive("Auction/Buy/Text6"));//购买界面交易文本提示
editbox->setText("");
editbox = WEditBox(pageWnd->getChildRecursive("Auction/Buy/Text61"));
editbox->setText("");
mcl = WMCL(pageWnd->getChildRecursive("Auction/Tab/Query/MCL"));//个人查询MCL属性
mcl->setUserColumnDraggingEnabled(false);//列不可拖动
mcl->setUserSortControlEnabled(false);//列不可排序
mcl->setUserColumnSizingEnabled(false);//列不可调整宽度
editbox = WEditBox(pageWnd->getChildRecursive("Auction/Tab/Agent/sale/EditNum"));//编辑框只能输入数字
editbox->setText("");
//editbox->setReadOnly(false);
editbox->setValidationString("[0-9]*");
editbox->setMaxTextLength(5);
editbox = WEditBox(pageWnd->getChildRecursive("Auction/Tab/Agent/sale/EditPrice"));//编辑框只能输入数字
editbox->setText("");
//editbox->setReadOnly(false);
editbox->setValidationString("[0-9]*");
editbox->setMaxTextLength(5);
editbox = WEditBox(pageWnd->getChildRecursive("Auction/Tab/Agent/Buy/EditNum"));//编辑框只能输入数字
editbox->setText("");
//editbox->setReadOnly(false);
editbox->setValidationString("[0-9]*");
editbox->setMaxTextLength(5);
editbox = WEditBox(pageWnd->getChildRecursive("Auction/Tab/Agent/Buy/EditPrice"));//编辑框只能输入数字
editbox->setText("");
//editbox->setReadOnly(false);
editbox->setValidationString("[0-9]*");
editbox->setMaxTextLength(5);
//////////////////////////////////////////////////
//委托页面支付提示
wnd = pageWnd->getChildRecursive("Auction/Tab/Agent/sale/subNum");//
wnd->setText("");
wnd = pageWnd->getChildRecursive("Auction/Tab/Agent/sale/subGold");//
wnd->setText("");
wnd = pageWnd->getChildRecursive("Auction/Tab/Agent/Buy/subNum");
wnd->setText("");
wnd = pageWnd->getChildRecursive("Auction/Tab/Agent/Buy/subGold");
wnd->setText("");
wnd = pageWnd->getChildRecursive("Auction/Tab/Agent/Buy/Text");
wnd->setText("");
////////////////////////////////////////////////////
//.........这里部分代码省略.........