本文整理汇总了C++中AwtTextComponent::SendMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ AwtTextComponent::SendMessage方法的具体用法?C++ AwtTextComponent::SendMessage怎么用?C++ AwtTextComponent::SendMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AwtTextComponent
的用法示例。
在下文中一共展示了AwtTextComponent::SendMessage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PDATA
JNIEXPORT void JNICALL
Java_sun_awt_pocketpc_PPCTextComponentPeer_enableEditing (JNIEnv *env,
jobject thisObj,
jboolean editable)
{
CHECK_PEER(thisObj);
AwtTextComponent* c = PDATA(AwtTextComponent, thisObj);
c->SendMessage(EM_SETREADONLY, !editable);
}
示例2: _EnableEditing
void AwtTextComponent::_EnableEditing(void *param)
{
JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
EnableEditingStruct *ees = (EnableEditingStruct *)param;
jobject self = ees->textcomponent;
jboolean on = ees->on;
AwtTextComponent *c = NULL;
PDATA pData;
JNI_CHECK_PEER_GOTO(self, ret);
c = (AwtTextComponent *)pData;
if (::IsWindow(c->GetHWnd()))
{
c->SendMessage(EM_SETREADONLY, !on);
}
ret:
env->DeleteGlobalRef(self);
delete ees;
}
示例3: _GetSelectionEnd
jint AwtTextComponent::_GetSelectionEnd(void *param)
{
JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
jobject self = (jobject)param;
jint result = 0;
AwtTextComponent *c = NULL;
PDATA pData;
JNI_CHECK_PEER_GOTO(self, ret);
c = (AwtTextComponent *)pData;
if (::IsWindow(c->GetHWnd()))
{
long end;
c->SendMessage(EM_GETSEL, 0, (LPARAM)&end);
result = c->getJavaSelPos(end);
}
ret:
env->DeleteGlobalRef(self);
return result;
}
示例4: _Select
void AwtTextComponent::_Select(void *param)
{
JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
SelectStruct *ss = (SelectStruct *)param;
jobject self = ss->textcomponent;
jint start = ss->start;
jint end = ss->end;
AwtTextComponent *c = NULL;
PDATA pData;
JNI_CHECK_PEER_GOTO(self, ret);
c = (AwtTextComponent *)pData;
if (::IsWindow(c->GetHWnd()))
{
c->SetSelRange(start, end);
c->SendMessage(EM_SCROLLCARET);
}
ret:
env->DeleteGlobalRef(self);
delete ss;
}
示例5: Create
/* Create a new AwtTextArea or AwtTextField object and window. */
AwtTextComponent* AwtTextComponent::Create(jobject peer, jobject parent, BOOL isMultiline)
{
JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
jobject target = NULL;
AwtTextComponent* c = NULL;
try {
if (env->EnsureLocalCapacity(1) < 0) {
return NULL;
}
PDATA pData;
AwtCanvas* awtParent;
JNI_CHECK_PEER_GOTO(parent, done);
awtParent = (AwtCanvas*)pData;
JNI_CHECK_NULL_GOTO(awtParent, "null awtParent", done);
target = env->GetObjectField(peer, AwtObject::targetID);
JNI_CHECK_NULL_GOTO(target, "null target", done);
if(isMultiline) {
c = new AwtTextArea();
} else {
c = new AwtTextField();
}
{
/* Adjust style for scrollbar visibility and word wrap */
DWORD scroll_style;
if(isMultiline) {
jint scrollbarVisibility =
env->GetIntField(target, AwtTextArea::scrollbarVisibilityID);
switch (scrollbarVisibility) {
case java_awt_TextArea_SCROLLBARS_NONE:
scroll_style = ES_AUTOVSCROLL;
break;
case java_awt_TextArea_SCROLLBARS_VERTICAL_ONLY:
scroll_style = WS_VSCROLL | ES_AUTOVSCROLL;
break;
case java_awt_TextArea_SCROLLBARS_HORIZONTAL_ONLY:
scroll_style = WS_HSCROLL | ES_AUTOHSCROLL | ES_AUTOVSCROLL;
break;
case java_awt_TextArea_SCROLLBARS_BOTH:
scroll_style = WS_VSCROLL | WS_HSCROLL |
ES_AUTOVSCROLL | ES_AUTOHSCROLL;
break;
}
}
DWORD style = WS_CHILD | WS_CLIPSIBLINGS | ES_LEFT;
/*
* Specify ES_DISABLENOSCROLL - RichEdit control style to disable
* scrollbars instead of hiding them when not needed.
*/
style |= isMultiline ? ES_MULTILINE | ES_WANTRETURN | scroll_style
| ES_DISABLENOSCROLL : ES_AUTOHSCROLL;
DWORD exStyle = WS_EX_CLIENTEDGE;
if (GetRTL()) {
exStyle |= WS_EX_RIGHT | WS_EX_LEFTSCROLLBAR;
if (GetRTLReadingOrder())
exStyle |= WS_EX_RTLREADING;
}
jint x = env->GetIntField(target, AwtComponent::xID);
jint y = env->GetIntField(target, AwtComponent::yID);
jint width = env->GetIntField(target, AwtComponent::widthID);
jint height = env->GetIntField(target, AwtComponent::heightID);
c->CreateHWnd(env, L"", style, exStyle,
x, y, width, height,
awtParent->GetHWnd(),
reinterpret_cast<HMENU>(static_cast<INT_PTR>(
awtParent->CreateControlID())),
::GetSysColor(COLOR_WINDOWTEXT),
::GetSysColor(COLOR_WINDOW),
peer);
// Fix for 4753116.
// If it is not win95 (we are using Richedit 2.0)
// we set plain text mode, in which the control is
// similar to a standard edit control:
// - The text in a plain text control can have only
// one format.
// - The user cannot paste rich text formats, such as RTF
// or embedded objects into a plain text control.
// - Rich text mode controls always have a default
// end-of-document marker or carriage return,
// to format paragraphs.
// [email protected]
c->SendMessage(EM_SETTEXTMODE, TM_PLAINTEXT, 0);
//.........这里部分代码省略.........