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


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

本文整理汇总了C++中CCEGLView::setIMECursorPos方法的典型用法代码示例。如果您正苦于以下问题:C++ CCEGLView::setIMECursorPos方法的具体用法?C++ CCEGLView::setIMECursorPos怎么用?C++ CCEGLView::setIMECursorPos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CCEGLView的用法示例。


在下文中一共展示了CCEGLView::setIMECursorPos方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: becomeFirstResponder

bool CATextField::becomeFirstResponder()
{
	bool result = CAView::becomeFirstResponder();
    if (result) 
	{
		attachWithIME();
        this->showCursorMark();
        if (m_nInputType == KEY_BOARD_INPUT_PASSWORD)
        {
            if (m_sText.empty())
            {
                m_pCursorMark->setCenterOrigin(CCPoint(getCursorX() + m_iHoriMargins, m_obContentSize.height / 2));
            }
        }
        calculateSelChars(CCPoint(this->getCursorX() + m_iHoriMargins, m_obContentSize.height / 2), m_iString_l_length, m_iString_r_length, m_iCurPos);
        
        m_pCursorMark->setCenterOrigin(CCPoint(getCursorX() + m_iHoriMargins, m_obContentSize.height / 2));

#if CC_TARGET_PLATFORM==CC_PLATFORM_ANDROID
        CCEGLView * pGlView = CAApplication::getApplication()->getOpenGLView();
        pGlView->setIMECursorPos(getCursorPos(), getContentText());
#endif
    }
    return result;
}
开发者ID:Super-Man,项目名称:CrossApp,代码行数:25,代码来源:CATextField.cpp

示例2: pasteFromClipboard

void CATextView::pasteFromClipboard()
{
	std::string cszText = CAClipboard::getText();
	insertText(cszText.c_str(), (int)cszText.size());

#if CC_TARGET_PLATFORM==CC_PLATFORM_ANDROID
	CCEGLView * pGlView = CAApplication::getApplication()->getOpenGLView();
	pGlView->setIMECursorPos(getCursorPos(), getContentText());
#endif
}
开发者ID:nightdomain,项目名称:CrossApp,代码行数:10,代码来源:CATextView.cpp

示例3: setText

void CATextView::setText(const std::string& var)
{
	CATextViewDelegate* pTemp = m_pTextViewDelegate;
	m_pTextViewDelegate = NULL;
	m_szText.clear();
	m_iCurPos = 0;
	m_vLinesTextView.clear();
	m_curSelCharRange = std::make_pair(0, 0);
	insertText(var.c_str(), (int)var.length());
	m_pTextViewDelegate = pTemp;
	m_bUpdateImage = true;
#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID
	CCEGLView * pGlView = CAApplication::getApplication()->getOpenGLView();
	pGlView->setIMECursorPos(getCursorPos(), getContentText());
#endif
}
开发者ID:nightdomain,项目名称:CrossApp,代码行数:16,代码来源:CATextView.cpp

示例4: ccTouchEnded

void CATextField::ccTouchEnded(CATouch *pTouch, CAEvent *pEvent)
{
    CCPoint point = this->convertTouchToNodeSpace(pTouch);
    
    if (this->getBounds().containsPoint(point))
    {
		becomeFirstResponder();
		if (isFirstResponder())
        {
            this->showCursorMark();
            if (m_nInputType == KEY_BOARD_INPUT_PASSWORD)
            {
                if (!m_sText.empty())
                {
                    m_iCurPos =(int)m_vTextFiledChars.size();
                    m_iString_l_length = m_cImageSize.width;
                }
                m_pCursorMark->setCenterOrigin(CCPoint(getCursorX() + m_iHoriMargins, m_obContentSize.height / 2));

                return;
            }
			calculateSelChars(point, m_iString_l_length, m_iString_r_length, m_iCurPos);
           
			m_pCursorMark->setCenterOrigin(CCPoint(getCursorX() + m_iHoriMargins, m_obContentSize.height / 2));
        }

#if CC_TARGET_PLATFORM==CC_PLATFORM_ANDROID
        CCEGLView * pGlView = CAApplication::getApplication()->getOpenGLView();
		pGlView->setIMECursorPos(getCursorPos(), getContentText());
#endif

    }
    else
    {
        hideCursorMark();
        
        if (resignFirstResponder())
        {
			this->updateImage();
        }
    }

	m_curSelCharRange = std::make_pair(m_iCurPos, m_iCurPos);
	execCurSelCharRange();
}
开发者ID:asmh1989,项目名称:CrossApp,代码行数:45,代码来源:CATextField.cpp

示例5: ccTouchEnded

void CATextView::ccTouchEnded(CATouch *pTouch, CAEvent *pEvent)
{
    if (CATextToolBarView::isTextToolBarShow())
		return;
	
	if (m_bMoved)
	{
		m_bMoved = false;
		return;
	}
    
	CCPoint point = this->convertTouchToNodeSpace(pTouch);

    if (this->getBounds().containsPoint(point))
    {
        if (canAttachWithIME() && !m_pTextSelView->isTextViewShow())
        {
            becomeFirstResponder();
            
            int iCurLine = 0; int iCurPosX = 0;
            calculateSelChars(point, iCurLine, iCurPosX, m_iCurPos);
            m_pCursorMark->setCenterOrigin(CCPoint(iCurPosX, m_iLineHeight*1.25f*iCurLine + m_iLineHeight / 2));
            
            CCPoint pt = m_pCursorMark->getCenterOrigin();
            m_pTextArrView->showTextArrView(CCPoint(pt.x, pt.y + m_iLineHeight*1.2f + m_pContainerView->getContentOffset().y));
            m_curSelCharRange = std::pair<int,int>(m_iCurPos, m_iCurPos);
            
#if CC_TARGET_PLATFORM==CC_PLATFORM_ANDROID
            CCEGLView * pGlView = CAApplication::getApplication()->getOpenGLView();
            pGlView->setIMECursorPos(getStringCharCount(m_szText), getContentText());
#endif
        }
    }
    else
    {
        if (canDetachWithIME())
        {
            resignFirstResponder();
        }
    }

	CATouchView::ccTouchEnded(pTouch, pEvent);
}
开发者ID:alliadt,项目名称:CrossApp,代码行数:43,代码来源:CATextView.cpp

示例6: ccTouchEnded

void CATextField::ccTouchEnded(CATouch *pTouch, CAEvent *pEvent)
{
	CATouchView::ccTouchEnded(pTouch, pEvent);

	if (CATextToolBarView::isTextToolBarShow())
		return;

    if (m_bMoved)
    {
        m_bMoved = false;
        return;
    }
    
    CCPoint point = this->convertTouchToNodeSpace(pTouch);
    
    if (this->getBounds().containsPoint(point))
    {
        if (canAttachWithIME())
        {
            becomeFirstResponder();
            
            calculateSelChars(point, m_iString_l_length, m_iString_r_length, m_iCurPos);
            
            m_pCursorMark->setCenterOrigin(CCPoint(getCursorX() + m_iHoriMargins, m_obContentSize.height / 2));
            
#if CC_TARGET_PLATFORM==CC_PLATFORM_ANDROID
            CCEGLView * pGlView = CAApplication::getApplication()->getOpenGLView();
            pGlView->setIMECursorPos(getCursorPos(), getContentText());
#endif
        }
    }
    else
    {
        if (canDetachWithIME())
        {
            resignFirstResponder();
        }
    }

	m_curSelCharRange = std::make_pair(m_iCurPos, m_iCurPos);
	execCurSelCharRange();
}
开发者ID:Super-Man,项目名称:CrossApp,代码行数:42,代码来源:CATextField.cpp

示例7: becomeFirstResponder

bool CATextField::becomeFirstResponder()
{
	resignAllResponder(this);
    
	bool result = CAView::becomeFirstResponder();
    if (result) 
	{
		result = attachWithIME();
        this->showCursorMark();

        calculateSelChars(CCPoint(this->getCursorX() + m_iHoriMargins, m_obContentSize.height / 2), m_iString_l_length, m_iString_r_length, m_iCurPos);
        setCursorPosition();

#if CC_TARGET_PLATFORM==CC_PLATFORM_ANDROID
        CCEGLView * pGlView = CAApplication::getApplication()->getOpenGLView();
        pGlView->setIMECursorPos(getCursorPos(), getContentText());
#endif
    }
    return result;
}
开发者ID:hawkchch,项目名称:CrossApp,代码行数:20,代码来源:CATextField.cpp

示例8: setText

void CATextField::setText(const std::string &var)
{
    CATextFieldDelegate* pTemp = m_pDelegate;
    m_pDelegate = NULL;
    m_sText.clear();
	m_iCurPos = 0;
	m_curSelCharRange = std::make_pair(0, 0);
	m_iString_o_length = 0;
	m_iString_l_length = 0;
	m_iString_r_length = 0;
	m_vTextFiledChars.clear();
    CCPoint p = CCPoint(this->getCursorX() + m_iHoriMargins, m_obContentSize.height / 2);
    m_pCursorMark->setCenterOrigin(p);
    insertText(var.c_str(), (int)var.length());
    m_pDelegate = pTemp;
#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID
	CCEGLView * pGlView = CAApplication::getApplication()->getOpenGLView();
	pGlView->setIMECursorPos(getCursorPos(), getContentText());
#endif
}
开发者ID:hawkchch,项目名称:CrossApp,代码行数:20,代码来源:CATextField.cpp


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