95 m_freeId = FALSE;
96 m_isCheckbox = FALSE;
97 }
98
99 AwtMenuItem::~AwtMenuItem()
100 {
101 }
102
103 void AwtMenuItem::RemoveCmdID()
104 {
105 if (m_freeId) {
106 AwtToolkit::GetInstance().RemoveCmdID( GetID() );
107 }
108 }
109 void AwtMenuItem::Dispose()
110 {
111 RemoveCmdID();
112
113 JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
114 if (m_peerObject != NULL) {
115 JNI_SET_PDATA(m_peerObject, NULL);
116 env->DeleteGlobalRef(m_peerObject);
117 m_peerObject = NULL;
118 }
119
120 AwtObject::Dispose();
121 }
122
123 LPCTSTR AwtMenuItem::GetClassName() {
124 return TEXT("SunAwtMenuItem");
125 }
126 // Convert Language ID to CodePage
127 UINT AwtMenuItem::LangToCodePage(LANGID idLang)
128 {
129 TCHAR strCodePage[MAX_ACP_STR_LEN];
130 // use the LANGID to create a LCID
131 LCID idLocale = MAKELCID(idLang, SORT_DEFAULT);
132 // get the ANSI code page associated with this locale
133 if (GetLocaleInfo(idLocale, LOCALE_IDEFAULTANSICODEPAGE, strCodePage, sizeof(strCodePage)/sizeof(TCHAR)) > 0 )
134 return _ttoi(strCodePage);
|
95 m_freeId = FALSE;
96 m_isCheckbox = FALSE;
97 }
98
99 AwtMenuItem::~AwtMenuItem()
100 {
101 }
102
103 void AwtMenuItem::RemoveCmdID()
104 {
105 if (m_freeId) {
106 AwtToolkit::GetInstance().RemoveCmdID( GetID() );
107 }
108 }
109 void AwtMenuItem::Dispose()
110 {
111 RemoveCmdID();
112
113 JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
114 if (m_peerObject != NULL) {
115 JNI_SET_DESTROYED(m_peerObject);
116 JNI_SET_PDATA(m_peerObject, NULL);
117 env->DeleteGlobalRef(m_peerObject);
118 m_peerObject = NULL;
119 }
120
121 AwtObject::Dispose();
122 }
123
124 LPCTSTR AwtMenuItem::GetClassName() {
125 return TEXT("SunAwtMenuItem");
126 }
127 // Convert Language ID to CodePage
128 UINT AwtMenuItem::LangToCodePage(LANGID idLang)
129 {
130 TCHAR strCodePage[MAX_ACP_STR_LEN];
131 // use the LANGID to create a LCID
132 LCID idLocale = MAKELCID(idLang, SORT_DEFAULT);
133 // get the ANSI code page associated with this locale
134 if (GetLocaleInfo(idLocale, LOCALE_IDEFAULTANSICODEPAGE, strCodePage, sizeof(strCodePage)/sizeof(TCHAR)) > 0 )
135 return _ttoi(strCodePage);
|