本文整理汇总了C++中CATextView类的典型用法代码示例。如果您正苦于以下问题:C++ CATextView类的具体用法?C++ CATextView怎么用?C++ CATextView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CATextView类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Java_org_CrossApp_lib_CrossAppTextView_keyBoardHeightReturn
//textView delegate
JNIEXPORT void JNICALL Java_org_CrossApp_lib_CrossAppTextView_keyBoardHeightReturn(JNIEnv *env, jclass cls, jint key, jint height)
{
CATextView* textView = s_map[(int)key];
if (textView->getDelegate())
{
textView->getDelegate()->keyBoardHeight(textView, (int)s_px_to_dip(height));
}
}
示例2: Java_org_CrossApp_lib_CrossAppTextView_resignFirstResponder
JNIEXPORT void JNICALL Java_org_CrossApp_lib_CrossAppTextView_resignFirstResponder(JNIEnv *env, jclass cls, jint key)
{
CATextView* textView = s_map[(int)key];
if (textView->isFirstResponder())
{
textView->resignFirstResponder();
}
}
示例3: CATextView
CATextView* CATextView::createWithCenter(const CCRect& rect)
{
CATextView *text = new CATextView();
if (text && text->initWithCenter(rect))
{
text->autorelease();
return text;
}
CC_SAFE_DELETE(text);
return NULL;
}
示例4: Java_org_CrossApp_lib_CrossAppTextView_keyBoardReturnCallBack
//return call back
JNIEXPORT void JNICALL Java_org_CrossApp_lib_CrossAppTextView_keyBoardReturnCallBack(JNIEnv *env, jclass cls, jint key, jint height)
{
CATextView* textView = s_map[(int)key];
textView->resignFirstResponder();
if (textView->getDelegate())
{
textView->getDelegate()->textViewShouldReturn(textView);
}
}
示例5: CATextView
CATextView* CATextView::createWithCenter(const CCRect& rect)
{
CATextView* pTextView = new CATextView();
if (pTextView && pTextView->initWithCenter(rect))
{
pTextView->autorelease();
return pTextView;
}
CC_SAFE_DELETE(pTextView);
return NULL;
}
示例6: CATextView
CATextView* CATextView::createWithLayout(const DLayout& layout)
{
CATextView* textView = new CATextView();
if (textView&&textView->initWithLayout(layout))
{
textView->autorelease();
return textView;
}
CC_SAFE_RELEASE_NULL(textView);
return NULL;
}
示例7: Java_org_CrossApp_lib_CrossAppTextView_text
JNIEXPORT void JNICALL Java_org_CrossApp_lib_CrossAppTextView_text(JNIEnv *env, jclass cls, jint key, jbyteArray textBuffer, int lenght)
{
char* buffer = (char*)malloc(sizeof(char) * lenght);
env->GetByteArrayRegion(textBuffer, 0, lenght, (jbyte *)buffer);
std::string text;
text.resize(lenght);
for (int i=0; i<lenght; i++)
{
text[i] = buffer[i];
}
s_lock = true;
CATextView* textView = s_map[(int)key];
textView->setText(text);
s_lock = false;
}
示例8: Java_org_CrossApp_lib_CrossAppTextView_textChange
JNIEXPORT bool JNICALL Java_org_CrossApp_lib_CrossAppTextView_textChange(JNIEnv *env, jclass cls, jint key, jstring before, jstring change, int arg0, int arg1)
{
const char* charBefore = env->GetStringUTFChars(before, NULL);
std::string strBefore = charBefore;
env->ReleaseStringUTFChars(before, charBefore);
const char* charChange = env->GetStringUTFChars(change, NULL);
std::string strChange = charChange;
env->ReleaseStringUTFChars(change, charChange);
CATextView* textView = s_map[(int)key];
if (textView->getDelegate())
{
return textView->getDelegate()->textViewShouldChangeCharacters(textView, arg0, arg1, strChange.c_str());
}
return true;
}