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


C++ AwtComponent::SendMessage方法代码示例

本文整理汇总了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);    
}
开发者ID:AllBinary,项目名称:phoneme-components-cdc,代码行数:14,代码来源:PPCTextComponentPeer.cpp

示例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();
}
开发者ID:AllBinary,项目名称:phoneme-components-cdc,代码行数:28,代码来源:PPCCheckboxPeer.cpp

示例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;
}
开发者ID:,项目名称:,代码行数:38,代码来源:

示例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);
}
开发者ID:AllBinary,项目名称:phoneme-components-cdc,代码行数:8,代码来源:PPCTextFieldPeer.cpp

示例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);
}
开发者ID:AllBinary,项目名称:phoneme-components-cdc,代码行数:9,代码来源:PPCCheckboxPeer.cpp

示例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);    
}
开发者ID:AllBinary,项目名称:phoneme-components-cdc,代码行数:10,代码来源:PPCTextComponentPeer.cpp

示例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;
}
开发者ID:,项目名称:,代码行数:58,代码来源:

示例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();
}
开发者ID:AllBinary,项目名称:phoneme-components-cdc,代码行数:18,代码来源:PPCCheckboxPeer.cpp

示例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;
}
开发者ID:,项目名称:,代码行数:27,代码来源:


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