本文整理汇总了C++中AwtComponent::SendMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ AwtComponent::SendMessage方法的具体用法?C++ AwtComponent::SendMessage怎么用?C++ AwtComponent::SendMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AwtComponent
的用法示例。
在下文中一共展示了AwtComponent::SendMessage方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PDATA
JNIEXPORT void JNICALL
Java_sun_awt_pocketpc_PPCTextComponentPeer_select (JNIEnv *env,
jobject thisObj,
jint start, jint end)
{
CHECK_PEER(thisObj);
AwtComponent* c = PDATA(AwtComponent, thisObj);
c->SendMessage(EM_SETSEL,
getWin32SelPos((AwtTextComponent*)c, start),
getWin32SelPos((AwtTextComponent*)c, end));
c->SendMessage(EM_SCROLLCARET);
}
示例2: GetObjectField
JNIEXPORT void JNICALL
Java_sun_awt_pocketpc_PPCCheckboxPeer_setState (JNIEnv *env, jobject thisObj,
jboolean state)
{
CHECK_PEER(thisObj);
AwtComponent* c = (AwtComponent*) env->GetIntField(thisObj,
WCachedIDs.PPCObjectPeer_pDataFID);
//when multifont and group checkbox receive setState native method,
//it must be redraw to display correct check mark
jobject target =
env -> GetObjectField(thisObj, WCachedIDs.PPCObjectPeer_targetFID);
if (env->CallObjectMethod(target, WCachedIDs.java_awt_Checkbox_getCheckboxGroupMID) != NULL) {
HWND hWnd = c->GetHWnd();
RECT rect;
VERIFY(::GetWindowRect(hWnd,&rect));
VERIFY(::ScreenToClient(hWnd, (LPPOINT)&rect));
VERIFY(::ScreenToClient(hWnd, ((LPPOINT)&rect)+1));
VERIFY(::InvalidateRect(hWnd,&rect,TRUE));
VERIFY(::UpdateWindow(hWnd));
} else {
c->SendMessage(BM_SETCHECK, (WPARAM)(state ? BST_CHECKED : BST_UNCHECKED));
VERIFY(::InvalidateRect(c->GetHWnd(), NULL, FALSE));
}
c->VerifyState();
}
示例3: VERIFY
/*
* Class: sun_awt_windows_WCheckboxPeer
* Method: setState
* Signature: (Z)V
*/
JNIEXPORT void JNICALL
Java_sun_awt_windows_WCheckboxPeer_setState(JNIEnv *env, jobject self,
jboolean state)
{
TRY;
PDATA pData;
JNI_CHECK_PEER_RETURN(self);
AwtComponent* c = (AwtComponent*)JNI_GET_PDATA(self);
/*
* when multifont and group checkbox receive setState native
* method, it must be redraw to display correct check mark
*/
jobject target = env->GetObjectField(self, AwtObject::targetID);
jobject group = env->GetObjectField(target, AwtCheckbox::groupID);
if (group != NULL) {
HWND hWnd = c->GetHWnd();
RECT rect;
VERIFY(::GetWindowRect(hWnd,&rect));
VERIFY(::ScreenToClient(hWnd, (LPPOINT)&rect));
VERIFY(::ScreenToClient(hWnd, ((LPPOINT)&rect)+1));
VERIFY(::InvalidateRect(hWnd,&rect,TRUE));
VERIFY(::UpdateWindow(hWnd));
} else {
c->SendMessage(BM_SETCHECK, (WPARAM)(state ? BST_CHECKED :
BST_UNCHECKED));
VERIFY(::InvalidateRect(c->GetHWnd(), NULL, FALSE));
}
c->VerifyState();
CATCH_BAD_ALLOC;
}
示例4: PDATA
JNIEXPORT void JNICALL
Java_sun_awt_pocketpc_PPCTextFieldPeer_setEchoCharacter (JNIEnv *env,
jobject self, jchar ch)
{
CHECK_PEER(self);
AwtComponent* c = PDATA(AwtComponent, self);
c->SendMessage(EM_SETPASSWORDCHAR, ch);
}
示例5:
long
Java_sun_awt_pocketpc_PPCCheckboxPeer_getState(JNIEnv * env, jobject self)
{
CHECK_PEER_RETURN(self);
AwtComponent* c = (AwtComponent*) env->GetIntField(self,
WCachedIDs.PPCObjectPeer_pDataFID);
c->VerifyState();
return c->SendMessage(BM_GETCHECK);
}
示例6: getJavaSelPos
JNIEXPORT jint JNICALL
Java_sun_awt_pocketpc_PPCTextComponentPeer_getSelectionEnd (JNIEnv *env,
jobject self)
{
CHECK_PEER_RETURN(self);
AwtComponent* c = PDATA(AwtComponent, self);
long end;
c->SendMessage(EM_GETSEL, 0, (LPARAM)&end);
return getJavaSelPos((AwtTextComponent*)c, end);
}
示例7: sizeof
/*
* Class: sun_awt_windows_WComponentPeer
* Method: handleEvent
* Signature: (Lsun/awt/windows/WComponentPeer;Ljava/awt/AWTEvent;)V
*/
JNIEXPORT void JNICALL
Java_sun_awt_windows_WInputMethod_handleNativeIMEEvent(JNIEnv *env, jobject self,
jobject peer, jobject event)
{
TRY;
PDATA pData;
JNI_CHECK_PEER_RETURN(peer);
AwtComponent* p = (AwtComponent *)pData;
JNI_CHECK_NULL_RETURN(event, "null AWTEvent");
if (env->EnsureLocalCapacity(1) < 0) {
return;
}
jbyteArray bdata = (jbyteArray)(env)->GetObjectField(event, AwtAWTEvent::bdataID);
if (bdata == 0) {
return;
}
MSG msg;
(env)->GetByteArrayRegion(bdata, 0, sizeof(MSG), (jbyte *)&msg);
(env)->DeleteLocalRef(bdata);
BOOL isConsumed =
(BOOL)(env)->GetBooleanField(event, AwtAWTEvent::consumedID);
int id = (env)->GetIntField(event, AwtAWTEvent::idID);
DASSERT(!safe_ExceptionOccurred(env));
if (isConsumed || p==NULL) return;
if (id >= java_awt_event_InputMethodEvent_INPUT_METHOD_FIRST &&
id <= java_awt_event_InputMethodEvent_INPUT_METHOD_LAST)
{
long modifiers = p->GetJavaModifiers();
if (msg.message==WM_CHAR || msg.message==WM_SYSCHAR) {
WCHAR unicodeChar = L'\0';
unicodeChar = (WCHAR)msg.wParam;
p->SendKeyEvent(java_awt_event_KeyEvent_KEY_TYPED,
0, //to be fixed nowMillis(),
java_awt_event_KeyEvent_CHAR_UNDEFINED,
unicodeChar,
modifiers,
java_awt_event_KeyEvent_KEY_LOCATION_UNKNOWN, (jlong)0,
&msg);
} else {
MSG* pCopiedMsg = new MSG;
*pCopiedMsg = msg;
p->SendMessage(WM_AWT_HANDLE_EVENT, (WPARAM) FALSE,
(LPARAM) pCopiedMsg);
}
(env)->SetBooleanField(event, AwtAWTEvent::consumedID, JNI_TRUE);
}
CATCH_BAD_ALLOC;
}
示例8: ASSERT
void
Java_sun_awt_pocketpc_PPCCheckboxPeer_setCheckboxGroup(JNIEnv *env,
jobject self,
jobject group)
{
CHECK_PEER(self);
#ifdef DEBUG
if (group != NULL) {
CHECK_OBJ(group);
jclass cls = env->FindClass("java/awt/CheckboxGroup");
ASSERT(env->IsInstanceOf(group, cls));
}
#endif
AwtComponent* c = (AwtComponent*) env->GetIntField(self,
WCachedIDs.PPCObjectPeer_pDataFID);
c->SendMessage(BM_SETSTYLE, (WPARAM)BS_OWNERDRAW, (LPARAM)TRUE);
c->VerifyState();
}
示例9: DASSERT
/*
* Class: sun_awt_windows_WCheckboxPeer
* Method: setCheckboxGroup
* Signature: (Ljava/awt/CheckboxGroup;)V
*/
JNIEXPORT void JNICALL
Java_sun_awt_windows_WCheckboxPeer_setCheckboxGroup(JNIEnv *env, jobject self,
jobject group)
{
TRY;
PDATA pData;
JNI_CHECK_PEER_RETURN(self);
/* REMIND
#ifdef DEBUG
if (group != NULL) {
DASSERT(IsInstanceOf((HObject*)group, "java/awt/CheckboxGroup"));
}
#endif
*/
AwtComponent* c = (AwtComponent*)JNI_GET_PDATA(self);
c->SendMessage(BM_SETSTYLE, (WPARAM)BS_OWNERDRAW, (LPARAM)TRUE);
c->VerifyState();
CATCH_BAD_ALLOC;
}