本文整理汇总了C++中CCEGLView::setIMEKeyboardNumber方法的典型用法代码示例。如果您正苦于以下问题:C++ CCEGLView::setIMEKeyboardNumber方法的具体用法?C++ CCEGLView::setIMEKeyboardNumber怎么用?C++ CCEGLView::setIMEKeyboardNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCEGLView
的用法示例。
在下文中一共展示了CCEGLView::setIMEKeyboardNumber方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: attachWithIME
bool CATextField::attachWithIME()
{
bool bRet = CAIMEDelegate::attachWithIME();
if (bRet)
{
// open keyboard
CCEGLView * pGlView = CAApplication::getApplication()->getOpenGLView();
if (pGlView)
{
#if(CC_TARGET_PLATFORM==CC_PLATFORM_ANDROID||CC_TARGET_PLATFORM==CC_PLATFORM_IOS)
if (getKeyboardType() ==KEY_BOARD_TYPE_NORMAL)
{
pGlView->setIMEKeyboardDefault();
}
else if (getKeyboardType() ==KEY_BOARD_TYPE_NUMBER)
{
pGlView->setIMEKeyboardNumber();
}
else if(getKeyboardType() ==KEY_BOARD_TYPE_ALPHABET)
{
pGlView->setIMEKeyboardAlphabet();
}
#endif
pGlView->setIMEKeyboardState(true);
}
}
return bRet;
}
示例2: attachWithIME
bool CATextField::attachWithIME()
{
bool bRet = CAIMEDelegate::attachWithIME();
if (bRet)
{
// open keyboard
CCEGLView * pGlView = CAApplication::getApplication()->getOpenGLView();
if (pGlView)
{
#if(CC_TARGET_PLATFORM==CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM==CC_PLATFORM_IOS)
if (getKeyboardType() ==KEY_BOARD_TYPE_NORMAL)
{
pGlView->setIMEKeyboardDefault();
}
else if (getKeyboardType() ==KEY_BOARD_TYPE_NUMBER)
{
pGlView->setIMEKeyboardNumber();
}
else if(getKeyboardType() ==KEY_BOARD_TYPE_ALPHABET)
{
pGlView->setIMEKeyboardAlphabet();
}
if (getKeyboardReturnType() ==KEY_BOARD_RETURN_SEND)
{
pGlView->setIMEKeyboardReturnSend();
}
else if (getKeyboardReturnType() ==KEY_BOARD_RETURN_SEARCH)
{
pGlView->setIMEKeyboardReturnSearch();
}
else if(getKeyboardReturnType() ==KEY_BOARD_RETURN_DONE)
{
pGlView->setIMEKeyboardReturnDone();
}
#endif
this->showCursorMark();
m_pCursorMark->setCenterOrigin(CCPoint(getCursorX() + m_iHoriMargins, m_obContentSize.height / 2));
pGlView->setIMEKeyboardState(true);
}
}
return bRet;
}
示例3: attachWithIME
bool CCTextFieldTTF::attachWithIME()
{
bool bRet = CCIMEDelegate::attachWithIME();
if (bRet)
{
// open keyboard
CCEGLView * pGlView = CCDirector::sharedDirector()->getOpenGLView();
if (pGlView)
{
if (getKeyboardType() ==KEY_BOARD_TYPE_NORMAL) {
pGlView->setIMEKeyboardDefault();
}
else if (getKeyboardType() ==KEY_BOARD_TYPE_NUMBER) {
pGlView->setIMEKeyboardNumber();
}
pGlView->setIMEKeyboardState(true);
}
}
return bRet;
}
示例4: createRLayer
CCLayer* RemindLayer::createRLayer(const char *tStr, int remindType){
CCLayer* layer = new CCLayer();
int tagOpen = 0;
int tagClose = 0;
bool typeOn;
switch (remindType) {
case EN_REMIND_ACTIVITY:
tagOpen = kActivityOnTag;
tagClose = kActivityOffTag;
typeOn = CGameData::Inst()->isActivityRemind;
break;
case EN_REMIND_TWOUP:
tagOpen = kTwoupOnTag;
tagClose = kTwoupOffTag;
typeOn = CGameData::Inst()->isTwoUpRemind;
break;
case EN_REMIND_CNTRYCD:
tagOpen = kCntryCdOnTag;
tagClose = kCntryCdOffTag;
typeOn = CGameData::Inst()->isCntryCdRemind;
break;
case EN_REMIND_POWER:{
tagOpen = kPowerOnTag;
tagClose = kPowerOffTag;
typeOn = CGameData::Inst()->intPowerRemind;
CCSprite* spMenu1 = CCSprite::spriteWithFile("pushConfig_tilizhi.png");
CCSprite* spMenu2 = CCSprite::spriteWithFile("pushConfig_tilizhi.png");
CCMenuItem* item = CCMenuItemImage::itemFromNormalSprite(spMenu1,spMenu2,
this, menu_selector(RemindLayer::MoveUpKeyboard));
item->setPosition(ccp(0,0));
item->setAnchorPoint(CCPointZero);
CCMenu *menu = CCMenu::menuWithItems (item, NULL);
menu->setPosition(ccp(-50,20));
layer->addChild(menu, 2);
char buf[100];
snprintf(buf, 99,"%d", CGameData::Inst()->intPowerRemind);
powerNumber = CCTextFieldTTF::textFieldWithPlaceHolder(buf,CCSizeMake(100, 200) ,CCTextAlignmentCenter,"huakangfont.ttf", 32);
powerNumber->setPosition(ccp(12, 40));
powerNumber->setColor(ccWHITE);
powerNumber->setDelegate(this);
layer->addChild(powerNumber,10);
CCEGLView * pGlView = CCDirector::sharedDirector()->getOpenGLView();
pGlView->setIMEKeyboardNumber();
break;
}
default:
tagOpen = kActivityOnTag;
tagClose = kActivityOffTag;
typeOn = CGameData::Inst()->isCntryCdRemind;
break;
}
CCSprite* spFrame = CCSprite::spriteWithFile("pushConfig_Bg.png");
spFrame->setPosition(CCPointMake(2, 0));
layer->addChild(spFrame);
TextNode *remindLabel = TextNode::textWithString(tStr, 32);
remindLabel->setColor(ccc3(255, 255, 255));
remindLabel->setShadowColor(ccc3(0, 0, 0));
remindLabel->setPosition(ccp(0,40));
layer->addChild(remindLabel);
CCSprite* spMenu1 = CCSprite::spriteWithSpriteFrameName("fr_open.png");
CCSprite* spMenu2 = CCSprite::spriteWithSpriteFrameName("fr_open.png");
CCSprite* spMenu3 = CCSprite::spriteWithSpriteFrameName("fr_open2.png");
CCMenuItem* item1 = CCMenuItemImage::itemFromNormalSprite(spMenu1,spMenu2,spMenu3,
this, menu_selector(RemindLayer::switchOnOff));
item1->setPosition(ccp(-170, -50));
item1->setAnchorPoint(ccp(0, 0));
item1->setTag(tagOpen);
spMenu1 = CCSprite::spriteWithSpriteFrameName("fr_close.png");
spMenu2 = CCSprite::spriteWithSpriteFrameName("fr_close.png");
spMenu3 = CCSprite::spriteWithSpriteFrameName("fr_close2.png");
CCMenuItem* item2 = CCMenuItemImage::itemFromNormalSprite(spMenu1,spMenu2,spMenu3,
this, menu_selector(RemindLayer::switchOnOff));
item2->setPosition(ccp(30, -50));
item2->setAnchorPoint(ccp(0, 0));
item2->setTag(tagClose);
item1->setIsEnabled(!typeOn);
item2->setIsEnabled(typeOn);
CCMenu *menu = CCMenu::menuWithItems (item1,item2,
NULL);
menu->setPosition(ccp(0, 0));
layer->addChild(menu);
return layer;
}