Mercurial > dwindows
diff android/dw.cpp @ 2708:3a7dcc0ae08b
Android: Implement dw_mle_search(). Also revert lowercase() change.
Another system is telling me lowercase() is experimental.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Fri, 19 Nov 2021 18:48:41 +0000 |
parents | a3f6ca621453 |
children | 3cb5aa73dace |
line wrap: on
line diff
--- a/android/dw.cpp Fri Nov 19 02:49:53 2021 +0000 +++ b/android/dw.cpp Fri Nov 19 18:48:41 2021 +0000 @@ -2803,7 +2803,24 @@ */ int API dw_mle_search(HWND handle, const char *text, int point, unsigned long flags) { - return DW_ERROR_UNKNOWN; + JNIEnv *env; + int retval = DW_ERROR_UNKNOWN; + + if((env = (JNIEnv *)pthread_getspecific(_dw_env_key))) + { + // Construct a String + jstring jstr = env->NewStringUTF(text); + // First get the class that contains the method you need to call + jclass clazz = _dw_find_class(env, DW_CLASS_NAME); + // Get the method that you want to call + jmethodID mleSearch = env->GetMethodID(clazz, "mleSearch", + "(Landroid/widget/EditText;Ljava/lang/String;II)I"); + // Call the method on the object + retval = env->CallIntMethod(_dw_obj, mleSearch, handle, jstr, point, (jint)flags); + if(_dw_jni_check_exception(env)) + retval = DW_ERROR_UNKNOWN; + } + return retval; } /*