Mercurial > dwindows
comparison android/dw.cpp @ 2702:4f12dc8e8f18
Android: Implement dw_mle_set_auto_complete() in the same way as iOS.
DW_MLE_COMPLETE_TEXT will enable auto correction on an MLE.
Disable dictionary suggestions on most edit/entry fields.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Wed, 17 Nov 2021 11:19:06 +0000 |
parents | 9df2c11f020f |
children | 4e9eba7f7226 |
comparison
equal
deleted
inserted
replaced
2701:9df2c11f020f | 2702:4f12dc8e8f18 |
---|---|
2731 * handle: Handle to the MLE. | 2731 * handle: Handle to the MLE. |
2732 * state: Bitwise combination of DW_MLE_COMPLETE_TEXT/DASH/QUOTE | 2732 * state: Bitwise combination of DW_MLE_COMPLETE_TEXT/DASH/QUOTE |
2733 */ | 2733 */ |
2734 void API dw_mle_set_auto_complete(HWND handle, int state) | 2734 void API dw_mle_set_auto_complete(HWND handle, int state) |
2735 { | 2735 { |
2736 JNIEnv *env; | |
2737 | |
2738 if((env = (JNIEnv *)pthread_getspecific(_dw_env_key))) | |
2739 { | |
2740 // First get the class that contains the method you need to call | |
2741 jclass clazz = _dw_find_class(env, DW_CLASS_NAME); | |
2742 // Get the method that you want to call | |
2743 jmethodID mleSetAutoComplete = env->GetMethodID(clazz, "mleSetAutoComplete", | |
2744 "(Landroid/widget/EditText;I)V"); | |
2745 // Call the method on the object | |
2746 env->CallVoidMethod(_dw_obj, mleSetAutoComplete, handle, state); | |
2747 _dw_jni_check_exception(env); | |
2748 } | |
2736 } | 2749 } |
2737 | 2750 |
2738 /* | 2751 /* |
2739 * Finds text in an MLE box. | 2752 * Finds text in an MLE box. |
2740 * Parameters: | 2753 * Parameters: |