当前位置: 首页>>代码示例>>C++>>正文


C++ CCEGLView::setIMEKeyboardNumber方法代码示例

本文整理汇总了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;
}
开发者ID:JayCai,项目名称:CrossApp,代码行数:28,代码来源:CATextField.cpp

示例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;
}
开发者ID:Brian1900,项目名称:CrossApp,代码行数:43,代码来源:CATextField.cpp

示例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;
}
开发者ID:caoguoping,项目名称:warCraft,代码行数:20,代码来源:CCTextFieldTTF.cpp

示例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;
}
开发者ID:haoliumilan,项目名称:AgainstSango,代码行数:89,代码来源:RemindLayer.cpp


注:本文中的CCEGLView::setIMEKeyboardNumber方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。