コード例 #1
0
void EditBoxImplAndroid::openKeyboard()
{
    if (_delegate != NULL)
    {
        _delegate->editBoxEditingDidBegin(_editBox);
    }
    
#if CC_ENABLE_SCRIPT_BINDING
    EditBox* pEditBox = this->getEditBox();
    if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler())
    {        
        CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "began",pEditBox);
        ScriptEvent event(cocos2d::kCommonEvent,(void*)&data);
        ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);
    }
#endif
	
    showEditTextDialogJNI(  _placeHolder.c_str(),
						  _text.c_str(),
						  (int)_editBoxInputMode,
						  (int)_editBoxInputFlag,
						  (int)_keyboardReturnType,
						  _maxLength,
						  editBoxCallbackFunc,
						  (void*)this  );
	
}
コード例 #2
0
void PlayerStatus::pressedPair(CCObject * pSender, cocos2d::extension::CCControlEvent pCCControlEvent) {
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
    showEditTextDialogJNI("Enter pairing code", "", kEditBoxInputModeNumeric, kEditBoxInputFlagInitialCapsWord,
                                        kKeyboardReturnTypeDone, 4, editBoxCallbackFunc, (void*)this);
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
    openEditBox();
#endif
}
コード例 #3
0
ファイル: XWndEdit.cpp プロジェクト: xahgo/tama
	void DoModalEditBox( ID idEdit )
	{
		x_idEditField = idEdit;
		showEditTextDialogJNI(  "Input:",
							  x_szModalString,
							  kEditBoxInputModeSingleLine,
							  -1,
							  kKeyboardReturnTypeDefault,
							  100,
							  ModalEditBoxCallbackFunc,
							  (void*)0  );
		
	}
コード例 #4
0
void CCEditBoxImplAndroid::openKeyboard()
{
    if (m_pDelegate != NULL)
    {
        m_pDelegate->editBoxEditingDidBegin(m_pEditBox);
    }

    showEditTextDialogJNI(  m_strPlaceHolder.c_str(),
                            m_strText.c_str(),
                            m_eEditBoxInputMode,
                            m_eEditBoxInputFlag,
                            m_eKeyboardReturnType,
                            m_nMaxLength,
                            editBoxCallbackFunc,
                            (void*)this  );

}
コード例 #5
0
ファイル: XWndEdit.cpp プロジェクト: xahgo/tama
// LButtonDown이벤트로 하지 말것. 멀티터치관련해서 버그가 있어서 잘못된 좌표가 넘어온다
void XWndEdit::OnLButtonUp( float lx, float ly )
{    
	m_strTextOld = m_szString;
#ifdef WIN32
	if( XE::GetMain()->DoEditBox( m_szString ) ) {
		SetbUpdate( true );
		CallEventHandler( XWM_ENTER, (DWORD)m_szString );
		if( m_pDelegate )
			m_pDelegate->OnDelegateEnterEditBox( this, m_szString, m_strTextOld );
	}
/*
#ifndef _LIB
	// 라이브러리에 포함시키기가 애매함. 방법이 없나? 일단 델리게이트 형태로 위임시키는 형태로 하자.
	CDlgEnterName dlg;		// 이거 CIV전용이니까 일반화 시킬것
	if( dlg.DoModal() == IDOK )
	{
		_tcscpy_s( m_szString, dlg.m_strName );
		CallEventHandler( XWM_ENTER, (DWORD)m_szString );
	}
#endif
*/
#endif
#ifdef _VER_IOS
    XE::VEC2 vPos = GetPosFinal();
    XE::VEC2 vSize = GetSizeFinal();
    IOS::DoEditBox( vPos.x+4.f, vPos.y+4.f, vSize.w-8.f, vSize.h-8.f, this );	// iOS의 EditBox를 띄운다
#endif
#ifdef _VER_ANDROID
    showEditTextDialogJNI(  "Name:",
						  m_szString,
						  kEditBoxInputModeSingleLine,
						  -1,
						  kKeyboardReturnTypeDone,
						  100,
						  editBoxCallbackFunc,
						  (void*)this  );
#endif
}
コード例 #6
0
void EditBoxImplAndroid::openKeyboard()
{
    if (_delegate != NULL)
    {
        _delegate->editBoxEditingDidBegin(_editBox);
    }
    EditBox* pEditBox = this->getEditBox();
    if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler())
    {
        cocos2d::ScriptEngineProtocol* pEngine = cocos2d::ScriptEngineManager::sharedManager()->getScriptEngine();
        pEngine->executeEvent(pEditBox->getScriptEditBoxHandler(), "began",pEditBox);
    }
	
    showEditTextDialogJNI(  _placeHolder.c_str(),
						  _text.c_str(),
						  _editBoxInputMode,
						  _editBoxInputFlag,
						  _keyboardReturnType,
						  _maxLength,
						  editBoxCallbackFunc,
						  (void*)this  );
	
}
コード例 #7
0
void CCEditBoxImplAndroid::openKeyboard()
{
    if (m_pDelegate != NULL)
    {
        m_pDelegate->editBoxEditingDidBegin(m_pEditBox);
    }
    CCEditBox* pEditBox = this->getCCEditBox();
    if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler())
    {
        cocos2d::CCScriptEngineProtocol* pEngine = cocos2d::CCScriptEngineManager::sharedManager()->getScriptEngine();
        pEngine->executeEvent(pEditBox->getScriptEditBoxHandler(), "began",pEditBox);
    }
	
    showEditTextDialogJNI(  m_strPlaceHolder.c_str(),
						  m_strText.c_str(),
						  m_eEditBoxInputMode,
						  m_eEditBoxInputFlag,
						  m_eKeyboardReturnType,
						  m_nMaxLength,
						  editBoxCallbackFunc,
						  (void*)this  );
	
}