本文整理汇总了C++中cegui::Editbox::setMaxTextLength方法的典型用法代码示例。如果您正苦于以下问题:C++ Editbox::setMaxTextLength方法的具体用法?C++ Editbox::setMaxTextLength怎么用?C++ Editbox::setMaxTextLength使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cegui::Editbox
的用法示例。
在下文中一共展示了Editbox::setMaxTextLength方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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 );
}
示例2: 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("");
////////////////////////////////////////////////////
//.........这里部分代码省略.........