add INPUT_CUSTOM and format code

This commit is contained in:
xianjimli 2019-01-15 11:12:49 +08:00
parent 17698fa57b
commit f39839dea7
10 changed files with 31 additions and 11 deletions

View File

@ -3,6 +3,7 @@
* 整理API文档progress\_circle/rich\_text/slide\_menu * 整理API文档progress\_circle/rich\_text/slide\_menu
* 增加progress\_circle c语言demo。 * 增加progress\_circle c语言demo。
* 增加slide\_menu c语言demo。 * 增加slide\_menu c语言demo。
* 增加INPUT\_CUSTOM用于关闭系统缺省软键盘。
* 2019/01/14 * 2019/01/14
* 完善脚本绑定(增加函数和注释)。 * 完善脚本绑定(增加函数和注释)。

View File

@ -37,6 +37,7 @@ static const key_type_value_t input_type_name_value[] = {
{"int", 0, INPUT_INT}, {"float", 0, INPUT_FLOAT}, {"uint", 0, INPUT_UINT}, {"int", 0, INPUT_INT}, {"float", 0, INPUT_FLOAT}, {"uint", 0, INPUT_UINT},
{"ufloat", 0, INPUT_UFLOAT}, {"text", 0, INPUT_TEXT}, {"password", 0, INPUT_PASSWORD}, {"ufloat", 0, INPUT_UFLOAT}, {"text", 0, INPUT_TEXT}, {"password", 0, INPUT_PASSWORD},
{"hex", 0, INPUT_HEX}, {"email", 0, INPUT_EMAIL}, {"phone", 0, INPUT_PHONE}, {"hex", 0, INPUT_HEX}, {"email", 0, INPUT_EMAIL}, {"phone", 0, INPUT_PHONE},
{"custom", 0, INPUT_CUSTOM},
}; };
static const key_type_value_t align_h_name_value[] = { static const key_type_value_t align_h_name_value[] = {

View File

@ -85,7 +85,12 @@ typedef enum _input_type_t {
* @const INPUT_PHONE * @const INPUT_PHONE
* *
*/ */
INPUT_PHONE INPUT_PHONE,
/**
* @const INPUT_CUSTOM
* 使()
*/
INPUT_CUSTOM
} input_type_t; } input_type_t;
/** /**

View File

@ -84,7 +84,7 @@ BEGIN_C_DECLS
* *
* > * >
* [canvas demo](https://github.com/zlgopen/awtk-c-demos/blob/master/demos/canvas.c) * [canvas demo](https://github.com/zlgopen/awtk-c-demos/blob/master/demos/canvas.c)
* *
* *
* *
* * [canvas接口描述](canvas_t.md) * * [canvas接口描述](canvas_t.md)

View File

@ -54,7 +54,8 @@ BEGIN_C_DECLS
* ``` * ```
* *
* > * >
* [image_animation demo](https://github.com/zlgopen/awtk-c-demos/blob/master/demos/image_animation.c) * [image_animation
* demo](https://github.com/zlgopen/awtk-c-demos/blob/master/demos/image_animation.c)
* *
* style来设置控件的显示风格 * style来设置控件的显示风格
* *

View File

@ -31,7 +31,7 @@ BEGIN_C_DECLS
* @parent widget_t * @parent widget_t
* *
* *
* *
* *
* *
* *
@ -47,7 +47,8 @@ BEGIN_C_DECLS
*| INPUT\_HEX | kb\_hex.xml | *| INPUT\_HEX | kb\_hex.xml |
*| INPUT\_EMAIL | kb\_ascii.xml | *| INPUT\_EMAIL | kb\_ascii.xml |
*| INPUT\_PASSWORD | kb\_ascii.xml | *| INPUT\_PASSWORD | kb\_ascii.xml |
*| | kb\_default.xml | *| INPUT\_CUSTOM | 使 |
*| | kb\_default.xml |
* *
* keyboard中按钮子控件的名称有些特殊要求 * keyboard中按钮子控件的名称有些特殊要求
* *

View File

@ -52,7 +52,8 @@ BEGIN_C_DECLS
* ``` * ```
* *
* > * >
* [progress_circle demo](https://github.com/zlgopen/awtk-c-demos/blob/master/demos/progress_circle.c) * [progress_circle
* demo](https://github.com/zlgopen/awtk-c-demos/blob/master/demos/progress_circle.c)
* *
* style来设置控件的显示风格 * style来设置控件的显示风格
* *
@ -63,7 +64,8 @@ BEGIN_C_DECLS
* ``` * ```
* *
* > * >
* [theme default](https://github.com/zlgopen/awtk/blob/master/demos/assets/raw/styles/default.xml#L467) * [theme
* default](https://github.com/zlgopen/awtk/blob/master/demos/assets/raw/styles/default.xml#L467)
* *
*/ */
typedef struct _progress_circle_t { typedef struct _progress_circle_t {

View File

@ -38,10 +38,10 @@ BEGIN_C_DECLS
* xml中使用"rich\_text" * xml中使用"rich\_text"
* *
* ```xml * ```xml
* <rich_text x="0" y="0" w="100%" h="60" * <rich_text x="0" y="0" w="100%" h="60"
* text="<image name=&quota;bricks&quota;/><font align_v=&quota;middle&quota;>hello awtk!</font>" /> * text="<image name=&quota;bricks&quota;/><font align_v=&quota;middle&quota;>hello awtk!</font>" />
* ``` * ```
* > * >
* *
* > * >
* [rich_text.xml](https://github.com/zlgopen/awtk/blob/master/demos/assets/raw/ui/rich_text.xml) * [rich_text.xml](https://github.com/zlgopen/awtk/blob/master/demos/assets/raw/ui/rich_text.xml)

View File

@ -72,7 +72,7 @@ BEGIN_C_DECLS
* ```c * ```c
* widget_on(slide_menu, EVT_VALUE_CHANGED, on_current_changed, slide_menu); * widget_on(slide_menu, EVT_VALUE_CHANGED, on_current_changed, slide_menu);
* ``` * ```
* *
* *
* ```c * ```c
@ -91,7 +91,8 @@ BEGIN_C_DECLS
* ``` * ```
* *
* > * >
* [theme default](https://github.com/zlgopen/awtk/blob/master/demos/assets/raw/styles/default.xml#L493) * [theme
default](https://github.com/zlgopen/awtk/blob/master/demos/assets/raw/styles/default.xml#L493)
* *
*/ */
typedef struct _slide_menu_t { typedef struct _slide_menu_t {

View File

@ -56,6 +56,10 @@ static const char* input_type_to_keyboard_name(int32_t input_type) {
keyboard = "kb_hex"; keyboard = "kb_hex";
break; break;
} }
case INPUT_CUSTOM: {
log_debug("custom keyboard\n");
break;
}
case INPUT_EMAIL: case INPUT_EMAIL:
case INPUT_PASSWORD: { case INPUT_PASSWORD: {
keyboard = "kb_ascii"; keyboard = "kb_ascii";
@ -114,6 +118,10 @@ static ret_t input_type_open_keyboard(input_method_t* im, int32_t input_type, bo
const char* open_anim_hint = open_anim ? close_anim_hint : ""; const char* open_anim_hint = open_anim ? close_anim_hint : "";
const char* keyboard = input_type_to_keyboard_name(input_type); const char* keyboard = input_type_to_keyboard_name(input_type);
if (keyboard == NULL) {
return RET_OK;
}
widget_to_screen(widget, &p); widget_to_screen(widget, &p);
im->keyboard = window_open(keyboard); im->keyboard = window_open(keyboard);
if (im->keyboard == NULL) { if (im->keyboard == NULL) {