本文整理汇总了C++中AwtComponent::VerifyState方法的典型用法代码示例。如果您正苦于以下问题:C++ AwtComponent::VerifyState方法的具体用法?C++ AwtComponent::VerifyState怎么用?C++ AwtComponent::VerifyState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AwtComponent
的用法示例。
在下文中一共展示了AwtComponent::VerifyState方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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();
}
示例2: bad_alloc
/*
* Class: sun_awt_windows_WCheckboxPeer
* Method: setLabel
* Signature: (Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL
Java_sun_awt_windows_WCheckboxPeer_setLabel(JNIEnv *env, jobject self,
jstring label)
{
TRY;
PDATA pData;
JNI_CHECK_PEER_RETURN(self);
AwtComponent* c = (AwtComponent*)JNI_GET_PDATA(self);
LPCTSTR labelStr;
// Fix for 4378378: by convention null label means empty string
if (label == NULL) {
labelStr = TEXT("");
} else {
labelStr = JNU_GetStringPlatformChars(env, label, JNI_FALSE);
}
if (labelStr == NULL) {
throw std::bad_alloc();
}
c->SetText(labelStr);
c->VerifyState();
// Fix for 4378378: release StringPlatformChars only if label is not null
if (label != NULL) {
JNU_ReleaseStringPlatformChars(env, label, labelStr);
}
CATCH_BAD_ALLOC;
}
示例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:
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);
}
示例5: 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();
}
示例6: 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;
}