comparison android/dw.cpp @ 2607:3b9bbd69bb9c

Android: Implement dw_menu_popup() ... still need to implement the context events.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Fri, 16 Jul 2021 02:58:43 +0000
parents 60ec91d23746
children a11522c30345
comparison
equal deleted inserted replaced
2606:6c30fcc79402 2607:3b9bbd69bb9c
4649 * x: X coordinate. 4649 * x: X coordinate.
4650 * y: Y coordinate. 4650 * y: Y coordinate.
4651 */ 4651 */
4652 void API dw_menu_popup(HMENUI *menu, HWND parent, int x, int y) 4652 void API dw_menu_popup(HMENUI *menu, HWND parent, int x, int y)
4653 { 4653 {
4654 JNIEnv *env;
4655
4656 if(menu && *menu && parent && (env = (JNIEnv *)pthread_getspecific(_dw_env_key)))
4657 {
4658 // First get the class that contains the method you need to call
4659 jclass clazz = _dw_find_class(env, DW_CLASS_NAME);
4660 // Get the method that you want to call
4661 jmethodID menuPopup = env->GetMethodID(clazz, "menuPopup",
4662 "(Lorg/dbsoft/dwindows/DWMenu;Landroid/view/View;II)V");
4663 // Call the method on the object
4664 env->CallVoidMethod(_dw_obj, menuPopup, *menu, parent, x, y);
4665 _dw_jni_check_exception(env);
4666 *menu = nullptr;
4667 }
4654 } 4668 }
4655 4669
4656 char _dw_removetilde(char *dest, const char *src) 4670 char _dw_removetilde(char *dest, const char *src)
4657 { 4671 {
4658 int z, cur=0; 4672 int z, cur=0;