mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-12-02 03:58:33 +08:00
add Custom Soft Keyboard demo
This commit is contained in:
parent
e86c5fb087
commit
165cf687e2
@ -41,6 +41,7 @@
|
||||
#include "assets/inc/ui/linear_gradient.data"
|
||||
#include "assets/inc/ui/preload.data"
|
||||
#include "assets/inc/ui/images.data"
|
||||
#include "assets/inc/ui/soft_keyboard.data"
|
||||
#include "assets/inc/ui/edit.data"
|
||||
#include "assets/inc/ui/locale.data"
|
||||
#include "assets/inc/ui/kb_int.data"
|
||||
@ -402,6 +403,7 @@ ret_t assets_init(void) {
|
||||
assets_manager_add(rm, ui_linear_gradient);
|
||||
assets_manager_add(rm, ui_preload);
|
||||
assets_manager_add(rm, ui_images);
|
||||
assets_manager_add(rm, ui_soft_keyboard);
|
||||
assets_manager_add(rm, ui_edit);
|
||||
assets_manager_add(rm, ui_locale);
|
||||
assets_manager_add(rm, ui_kb_int);
|
||||
|
@ -1,5 +1,5 @@
|
||||
const unsigned char ui_main[] = {
|
||||
0x04,0x00,0x01,0x01,0x8d,0x0e,0x00,0x00,0x00,0x00,0x00,0x00,0x6d,0x61,0x69,0x6e,0x00,0x64,0x61,0x74,
|
||||
0x04,0x00,0x01,0x01,0xec,0x0e,0x00,0x00,0x00,0x00,0x00,0x00,0x6d,0x61,0x69,0x6e,0x00,0x64,0x61,0x74,
|
||||
0x61,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x12,0x12,0x22,0x11,0x77,0x69,0x6e,0x64,0x6f,0x77,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
@ -148,43 +148,48 @@ const unsigned char ui_main[] = {
|
||||
0x74,0x00,0x53,0x6c,0x69,0x64,0x65,0x20,0x4d,0x65,0x6e,0x75,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,
|
||||
0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6f,0x70,0x65,0x6e,0x3a,0x76,0x67,0x63,0x61,0x6e,0x76,0x61,
|
||||
0x73,0x00,0x74,0x65,0x78,0x74,0x00,0x56,0x47,0x20,0x43,0x61,0x6e,0x76,0x61,0x73,0x00,0x00,0x00,0x62,
|
||||
0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6f,0x70,0x65,0x6e,0x3a,0x73,0x6f,0x66,0x74,0x5f,0x6b,0x65,
|
||||
0x79,0x62,0x6f,0x61,0x72,0x64,0x00,0x74,0x65,0x78,0x74,0x00,0x43,0x75,0x73,0x74,0x6f,0x6d,0x20,0x4b,
|
||||
0x65,0x79,0x62,0x6f,0x61,0x72,0x64,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,
|
||||
0x6d,0x65,0x00,0x6f,0x70,0x65,0x6e,0x3a,0x76,0x67,0x63,0x61,0x6e,0x76,0x61,0x73,0x00,0x74,0x65,0x78,
|
||||
0x74,0x00,0x56,0x47,0x20,0x43,0x61,0x6e,0x76,0x61,0x73,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6f,0x70,0x65,0x6e,0x3a,0x6c,0x69,0x6e,0x65,0x61,0x72,0x5f,0x67,
|
||||
0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x00,0x74,0x65,0x78,0x74,0x00,0x4c,0x69,0x6e,0x65,0x61,0x72,0x20,
|
||||
0x47,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,
|
||||
0x61,0x6d,0x65,0x00,0x6f,0x70,0x65,0x6e,0x3a,0x72,0x61,0x64,0x69,0x61,0x6c,0x5f,0x67,0x72,0x61,0x64,
|
||||
0x69,0x65,0x6e,0x74,0x00,0x74,0x65,0x78,0x74,0x00,0x52,0x61,0x64,0x69,0x61,0x6c,0x20,0x47,0x72,0x61,
|
||||
0x64,0x69,0x65,0x6e,0x74,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,
|
||||
0x00,0x6f,0x70,0x65,0x6e,0x3a,0x73,0x74,0x72,0x6f,0x6b,0x65,0x5f,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,
|
||||
0x74,0x00,0x74,0x65,0x78,0x74,0x00,0x53,0x74,0x72,0x6f,0x6b,0x65,0x20,0x47,0x72,0x61,0x64,0x69,0x65,
|
||||
0x6e,0x74,0x00,0x00,0x00,0x00,0x76,0x69,0x65,0x77,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x73,0x65,0x6c,0x66,0x5f,0x6c,
|
||||
0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,0x30,0x2c,0x79,0x3d,
|
||||
0x30,0x2c,0x77,0x3d,0x31,0x30,0x30,0x25,0x2c,0x68,0x3d,0x31,0x30,0x30,0x25,0x29,0x00,0x63,0x68,0x69,
|
||||
0x6c,0x64,0x72,0x65,0x6e,0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,
|
||||
0x28,0x63,0x3d,0x31,0x2c,0x72,0x3d,0x38,0x2c,0x6d,0x3d,0x35,0x2c,0x73,0x3d,0x35,0x29,0x00,0x00,0x62,
|
||||
0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6f,0x70,0x65,0x6e,0x3a,0x6c,0x69,0x6e,
|
||||
0x65,0x61,0x72,0x5f,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x00,0x74,0x65,0x78,0x74,0x00,0x4c,0x69,
|
||||
0x6e,0x65,0x61,0x72,0x20,0x47,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x00,0x00,0x00,0x62,0x75,0x74,0x74,
|
||||
0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6f,0x70,0x65,0x6e,0x3a,0x6d,0x65,0x6d,
|
||||
0x74,0x65,0x73,0x74,0x00,0x74,0x65,0x78,0x74,0x00,0x4d,0x65,0x6d,0x54,0x65,0x73,0x74,0x00,0x00,0x00,
|
||||
0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6f,0x70,0x65,0x6e,0x3a,0x72,0x61,0x64,0x69,0x61,0x6c,
|
||||
0x5f,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x00,0x74,0x65,0x78,0x74,0x00,0x52,0x61,0x64,0x69,0x61,
|
||||
0x6c,0x20,0x47,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6f,0x70,0x65,0x6e,0x3a,0x63,0x61,
|
||||
0x6c,0x69,0x62,0x72,0x61,0x74,0x69,0x6f,0x6e,0x5f,0x77,0x69,0x6e,0x00,0x74,0x65,0x78,0x74,0x00,0x43,
|
||||
0x61,0x6c,0x69,0x62,0x72,0x61,0x74,0x69,0x6f,0x6e,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x6e,0x61,0x6d,0x65,0x00,0x6f,0x70,0x65,0x6e,0x3a,0x73,0x74,0x72,0x6f,0x6b,0x65,0x5f,0x67,0x72,
|
||||
0x61,0x64,0x69,0x65,0x6e,0x74,0x00,0x74,0x65,0x78,0x74,0x00,0x53,0x74,0x72,0x6f,0x6b,0x65,0x20,0x47,
|
||||
0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x00,0x00,0x00,0x00,0x76,0x69,0x65,0x77,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x6e,0x61,0x6d,0x65,0x00,0x73,0x68,0x6f,0x77,0x5f,0x66,0x70,0x73,0x00,0x74,0x65,0x78,0x74,0x00,
|
||||
0x53,0x68,0x6f,0x77,0x20,0x46,0x50,0x53,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x73,
|
||||
0x65,0x6c,0x66,0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,
|
||||
0x3d,0x30,0x2c,0x79,0x3d,0x30,0x2c,0x77,0x3d,0x31,0x30,0x30,0x25,0x2c,0x68,0x3d,0x31,0x30,0x30,0x25,
|
||||
0x29,0x00,0x63,0x68,0x69,0x6c,0x64,0x72,0x65,0x6e,0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,
|
||||
0x66,0x61,0x75,0x6c,0x74,0x28,0x63,0x3d,0x31,0x2c,0x72,0x3d,0x38,0x2c,0x6d,0x3d,0x35,0x2c,0x73,0x3d,
|
||||
0x35,0x29,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6f,0x70,0x65,
|
||||
0x6e,0x3a,0x6d,0x65,0x6d,0x74,0x65,0x73,0x74,0x00,0x74,0x65,0x78,0x74,0x00,0x4d,0x65,0x6d,0x54,0x65,
|
||||
0x73,0x74,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6f,0x70,
|
||||
0x65,0x6e,0x3a,0x63,0x61,0x6c,0x69,0x62,0x72,0x61,0x74,0x69,0x6f,0x6e,0x5f,0x77,0x69,0x6e,0x00,0x74,
|
||||
0x65,0x78,0x74,0x00,0x43,0x61,0x6c,0x69,0x62,0x72,0x61,0x74,0x69,0x6f,0x6e,0x00,0x00,0x00,0x62,0x75,
|
||||
0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x73,0x68,0x6f,0x77,0x5f,0x66,0x70,0x73,0x00,
|
||||
0x74,0x65,0x78,0x74,0x00,0x53,0x68,0x6f,0x77,0x20,0x46,0x50,0x53,0x00,0x00,0x00,0x62,0x75,0x74,0x74,
|
||||
0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x65,0x78,0x69,0x74,0x00,0x74,0x65,0x78,0x74,0x00,0x45,
|
||||
0x78,0x69,0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};/*3773*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,
|
||||
0x61,0x6d,0x65,0x00,0x65,0x78,0x69,0x74,0x00,0x74,0x65,0x78,0x74,0x00,0x45,0x78,0x69,0x74,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};/*3868*/
|
||||
|
63
demos/assets/inc/ui/soft_keyboard.data
Normal file
63
demos/assets/inc/ui/soft_keyboard.data
Normal file
@ -0,0 +1,63 @@
|
||||
const unsigned char ui_soft_keyboard[] = {
|
||||
0x04,0x00,0x01,0x01,0x98,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x6f,0x66,0x74,0x5f,0x6b,0x65,0x79,
|
||||
0x62,0x6f,0x61,0x72,0x64,0x00,0x64,0x61,0x74,0x61,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x12,0x12,0x22,0x11,0x77,0x69,0x6e,0x64,0x6f,0x77,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x74,0x65,0x78,0x74,
|
||||
0x00,0x43,0x75,0x73,0x74,0x6f,0x6d,0x20,0x53,0x6f,0x66,0x74,0x20,0x4b,0x65,0x79,0x62,0x6f,0x61,0x72,
|
||||
0x64,0x00,0x61,0x6e,0x69,0x6d,0x5f,0x68,0x69,0x6e,0x74,0x00,0x68,0x74,0x72,0x61,0x6e,0x73,0x6c,0x61,
|
||||
0x74,0x65,0x00,0x00,0x65,0x64,0x69,0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x0a,0x00,0x00,0x00,0x5a,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x73,0x65,0x6c,0x66,0x5f,0x6c,0x61,0x79,
|
||||
0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,0x63,0x2c,0x79,0x3d,0x31,0x30,
|
||||
0x2c,0x77,0x3d,0x39,0x30,0x25,0x2c,0x68,0x3d,0x33,0x30,0x29,0x00,0x69,0x6e,0x70,0x75,0x74,0x5f,0x74,
|
||||
0x79,0x70,0x65,0x00,0x63,0x75,0x73,0x74,0x6f,0x6d,0x00,0x66,0x6f,0x63,0x75,0x73,0x00,0x74,0x72,0x75,
|
||||
0x65,0x00,0x74,0x65,0x78,0x74,0x00,0x00,0x00,0x00,0x76,0x69,0x65,0x77,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x5a,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,0x73,0x65,
|
||||
0x6c,0x66,0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,
|
||||
0x63,0x2c,0x79,0x3d,0x36,0x30,0x2c,0x77,0x3d,0x39,0x30,0x25,0x2c,0x68,0x3d,0x2d,0x36,0x30,0x29,0x00,
|
||||
0x69,0x73,0x5f,0x6b,0x65,0x79,0x62,0x6f,0x61,0x72,0x64,0x00,0x74,0x72,0x75,0x65,0x00,0x63,0x68,0x69,
|
||||
0x6c,0x64,0x72,0x65,0x6e,0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,
|
||||
0x28,0x72,0x3d,0x34,0x2c,0x63,0x3d,0x34,0x2c,0x6d,0x3d,0x35,0x2c,0x73,0x3d,0x35,0x29,0x00,0x00,0x62,
|
||||
0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6b,0x65,0x79,0x00,0x74,0x65,0x78,0x74,
|
||||
0x00,0x30,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6b,0x65,
|
||||
0x79,0x00,0x74,0x65,0x78,0x74,0x00,0x31,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,
|
||||
0x61,0x6d,0x65,0x00,0x6b,0x65,0x79,0x00,0x74,0x65,0x78,0x74,0x00,0x32,0x00,0x00,0x00,0x62,0x75,0x74,
|
||||
0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6b,0x65,0x79,0x00,0x74,0x65,0x78,0x74,0x00,0x33,
|
||||
0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6b,0x65,0x79,0x00,
|
||||
0x74,0x65,0x78,0x74,0x00,0x34,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,
|
||||
0x65,0x00,0x6b,0x65,0x79,0x00,0x74,0x65,0x78,0x74,0x00,0x35,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,
|
||||
0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6b,0x65,0x79,0x00,0x74,0x65,0x78,0x74,0x00,0x36,0x00,0x00,
|
||||
0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6b,0x65,0x79,0x00,0x74,0x65,
|
||||
0x78,0x74,0x00,0x37,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,
|
||||
0x6b,0x65,0x79,0x00,0x74,0x65,0x78,0x74,0x00,0x38,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x6e,0x61,0x6d,0x65,0x00,0x6b,0x65,0x79,0x00,0x74,0x65,0x78,0x74,0x00,0x39,0x00,0x00,0x00,0x62,
|
||||
0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6b,0x65,0x79,0x00,0x74,0x65,0x78,0x74,
|
||||
0x00,0x23,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x62,0x61,
|
||||
0x63,0x6b,0x73,0x70,0x61,0x63,0x65,0x00,0x74,0x65,0x78,0x74,0x00,0x3c,0x3d,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,};/*1224*/
|
Binary file not shown.
@ -34,6 +34,7 @@
|
||||
<button name="open:label" text="Label"/>
|
||||
<button name="open:dialogs" text="Dialogs"/>
|
||||
<button name="open:slide_menu" text="Slide Menu"/>
|
||||
<button name="open:soft_keyboard" text="Custom Keyboard"/>
|
||||
<button name="open:vgcanvas" text="VG Canvas"/>
|
||||
<button name="open:linear_gradient" text="Linear Gradient"/>
|
||||
<button name="open:radial_gradient" text="Radial Gradient"/>
|
||||
|
BIN
demos/assets/raw/ui/soft_keyboard.bin
Normal file
BIN
demos/assets/raw/ui/soft_keyboard.bin
Normal file
Binary file not shown.
20
demos/assets/raw/ui/soft_keyboard.xml
Normal file
20
demos/assets/raw/ui/soft_keyboard.xml
Normal file
@ -0,0 +1,20 @@
|
||||
|
||||
<window text="Custom Soft Keyboard" anim_hint="htranslate" >
|
||||
<edit x="c" y="10" w="90%" h="30" focus="true" input_type="custom" text="" />
|
||||
|
||||
<view y="60" x="c" w="90%" h="-60" is_keyboard="true"
|
||||
children_layout="default(r=4,c=4,m=5,s=5)" >
|
||||
<button name="key" text="0" />
|
||||
<button name="key" text="1" />
|
||||
<button name="key" text="2" />
|
||||
<button name="key" text="3" />
|
||||
<button name="key" text="4" />
|
||||
<button name="key" text="5" />
|
||||
<button name="key" text="6" />
|
||||
<button name="key" text="7" />
|
||||
<button name="key" text="8" />
|
||||
<button name="key" text="9" />
|
||||
<button name="key" text="#" />
|
||||
<button name="backspace" text="<=" />
|
||||
</view>
|
||||
</window>
|
@ -272,13 +272,30 @@ static ret_t on_open_window(void* ctx, event_t* e) {
|
||||
}
|
||||
|
||||
static ret_t on_close(void* ctx, event_t* e) {
|
||||
widget_t* win = (widget_t*)ctx;
|
||||
widget_t* win = WIDGET(ctx);
|
||||
(void)e;
|
||||
return window_close(win);
|
||||
}
|
||||
|
||||
static ret_t on_send_key(void* ctx, event_t* e) {
|
||||
widget_t* button = WIDGET(e->target);
|
||||
char text[2];
|
||||
text[0] = (char)button->text.str[0];
|
||||
text[1] = '\0';
|
||||
|
||||
input_method_commit_text(input_method(), text);
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
static ret_t on_backspace(void* ctx, event_t* e) {
|
||||
input_method_dispatch_key(input_method(), TK_KEY_BACKSPACE);
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
static ret_t on_quit(void* ctx, event_t* e) {
|
||||
widget_t* dialog = (widget_t*)ctx;
|
||||
widget_t* dialog = WIDGET(ctx);
|
||||
|
||||
dialog_quit(dialog, 0);
|
||||
(void)e;
|
||||
@ -461,6 +478,10 @@ static ret_t install_one(void* ctx, const void* iter) {
|
||||
if (win) {
|
||||
widget_on(widget, EVT_CLICK, on_close, win);
|
||||
}
|
||||
} else if (tk_str_eq(name, "key")) {
|
||||
widget_on(widget, EVT_CLICK, on_send_key, NULL);
|
||||
} else if (tk_str_eq(name, "backspace")) {
|
||||
widget_on(widget, EVT_CLICK, on_backspace, NULL);
|
||||
} else if (tk_str_eq(name, "quit")) {
|
||||
widget_t* win = widget_get_window(widget);
|
||||
if (win) {
|
||||
|
@ -9512,6 +9512,14 @@
|
||||
{
|
||||
"desc": " 延迟时间(毫秒)\n\n",
|
||||
"name": "WIDGET_PROP_DELAY"
|
||||
},
|
||||
{
|
||||
"desc": " 是否为键盘。\n\n",
|
||||
"name": "WIDGET_PROP_IS_KEYBOARD"
|
||||
},
|
||||
{
|
||||
"desc": " 设置为输入焦点。\n\n",
|
||||
"name": "WIDGET_PROP_FOCUS"
|
||||
}
|
||||
],
|
||||
"header": "base/widget_consts.h",
|
||||
@ -11847,6 +11855,24 @@
|
||||
"desc": "返回RET_OK表示成功,否则表示失败。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"params": [
|
||||
{
|
||||
"type": "widget_t*",
|
||||
"name": "widget",
|
||||
"desc": "控件对象。"
|
||||
}
|
||||
],
|
||||
"annotation": {
|
||||
"private": true
|
||||
},
|
||||
"desc": " 判断当前控件是否是keyboard。\n\n> keyboard收到pointer事件时,不会让当前控件失去焦点。\n\n 在自定义软键盘时,将所有按钮放到一个容器当中,并设置为is_keyboard。\n\n ```c\n widget_set_prop_bool(group, WIDGET_PROP_IS_KEYBOARD, TRUE);\n ```\n\n\n\n",
|
||||
"name": "widget_is_keyboard",
|
||||
"return": {
|
||||
"type": "ret_t",
|
||||
"desc": "返回RET_OK表示成功,否则表示失败。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"params": [
|
||||
{
|
||||
@ -12753,6 +12779,14 @@
|
||||
"readable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "initializing",
|
||||
"desc": " 标识控件正在初始化。\n\n",
|
||||
"type": "bool_t",
|
||||
"annotation": {
|
||||
"readable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "destroying",
|
||||
"desc": " 标识控件正在被销毁。\n\n",
|
||||
@ -14461,7 +14495,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "day",
|
||||
"name": "wday",
|
||||
"desc": " 星期几(0-6, Sunday = 0)。\n\n",
|
||||
"type": "int32_t",
|
||||
"annotation": {
|
||||
@ -23112,12 +23146,9 @@
|
||||
"events": [],
|
||||
"properties": [],
|
||||
"header": "base/style_const.h",
|
||||
"desc": "\n 只读的style,从theme\\_t中获取数据。\n\n tools/theme_gen用于把XML的主题数据转换成常量数据。\n\n\n\n",
|
||||
"desc": "\n 只读的style,从theme\\_t中获取数据。\n\n tools/theme_gen用于把XML的主题数据转换成常量数据。\n\n\n",
|
||||
"name": "style_const_t",
|
||||
"parent": "style_t",
|
||||
"annotation": {
|
||||
"fake": true
|
||||
},
|
||||
"level": 2
|
||||
},
|
||||
{
|
||||
@ -23554,7 +23585,7 @@
|
||||
"annotation": {
|
||||
"private": true
|
||||
},
|
||||
"desc": " 强制立即关闭窗口。\r\n\r\n> 本函数不会执行窗口动画。 \r\n\r\n",
|
||||
"desc": " 强制立即关闭窗口。\r\n\r\n> 本函数不会执行窗口动画。\r\n\r\n",
|
||||
"name": "window_manager_close_window_force",
|
||||
"return": {
|
||||
"type": "ret_t",
|
||||
@ -23868,6 +23899,78 @@
|
||||
"desc": "返回object对象。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"params": [
|
||||
{
|
||||
"type": "object_t*",
|
||||
"name": "obj",
|
||||
"desc": "object对象。"
|
||||
}
|
||||
],
|
||||
"annotation": {
|
||||
"scriptable": true
|
||||
},
|
||||
"desc": " 获取对象的类型名称。\n\n\n\n",
|
||||
"name": "object_get_type",
|
||||
"return": {
|
||||
"type": "const char*",
|
||||
"desc": "返回对象的类型名称。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"params": [
|
||||
{
|
||||
"type": "object_t*",
|
||||
"name": "obj",
|
||||
"desc": "object对象。"
|
||||
}
|
||||
],
|
||||
"annotation": {
|
||||
"scriptable": true
|
||||
},
|
||||
"desc": " 获取对象的描述信息。\n\n\n\n",
|
||||
"name": "object_get_desc",
|
||||
"return": {
|
||||
"type": "const char*",
|
||||
"desc": "返回对象的描述信息。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"params": [
|
||||
{
|
||||
"type": "object_t*",
|
||||
"name": "obj",
|
||||
"desc": "object对象。"
|
||||
}
|
||||
],
|
||||
"annotation": {
|
||||
"scriptable": true
|
||||
},
|
||||
"desc": " 获取对象占用内存的大小。\n\n\n\n",
|
||||
"name": "object_get_size",
|
||||
"return": {
|
||||
"type": "uint32_t",
|
||||
"desc": "返回对象占用内存的大小。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"params": [
|
||||
{
|
||||
"type": "object_t*",
|
||||
"name": "obj",
|
||||
"desc": "object对象。"
|
||||
}
|
||||
],
|
||||
"annotation": {
|
||||
"scriptable": true
|
||||
},
|
||||
"desc": " 判断对象是否是集合。\n\n\n\n",
|
||||
"name": "object_is_collection",
|
||||
"return": {
|
||||
"type": "bool_t",
|
||||
"desc": "返回TRUE表示是集合,否则不是。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"params": [
|
||||
{
|
||||
@ -29136,6 +29239,29 @@
|
||||
"type": "ret_t",
|
||||
"desc": "返回RET_OK表示成功,否则表示失败。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"params": [
|
||||
{
|
||||
"type": "widget_t*",
|
||||
"name": "widget",
|
||||
"desc": "widget对象。"
|
||||
},
|
||||
{
|
||||
"type": "bool_t",
|
||||
"name": "focus",
|
||||
"desc": "是否为焦点。。"
|
||||
}
|
||||
],
|
||||
"annotation": {
|
||||
"scriptable": true
|
||||
},
|
||||
"desc": " 设置为焦点。\r\n\r\n",
|
||||
"name": "edit_set_focus",
|
||||
"return": {
|
||||
"type": "ret_t",
|
||||
"desc": "返回RET_OK表示成功,否则表示失败。"
|
||||
}
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
@ -29255,6 +29381,19 @@
|
||||
"scriptable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "focus",
|
||||
"desc": " 设置为焦点(通常用于在XML中缺省设置为焦点控件)。\r\n",
|
||||
"type": "char*",
|
||||
"annotation": {
|
||||
"set_prop": true,
|
||||
"get_prop": true,
|
||||
"readable": true,
|
||||
"persitent": true,
|
||||
"design": true,
|
||||
"scriptable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "input_type",
|
||||
"desc": " 输入类型。\r\n XXX:需要在min/max/step之前设置。\r\n",
|
||||
@ -30305,6 +30444,24 @@
|
||||
"desc": "返回object对象。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"params": [
|
||||
{
|
||||
"type": "object_default_t*",
|
||||
"name": "o",
|
||||
"desc": "被克隆的对象。"
|
||||
}
|
||||
],
|
||||
"annotation": {
|
||||
"constructor": true
|
||||
},
|
||||
"desc": "\n 克隆对象。\n\n\n\n\n",
|
||||
"name": "object_default_create",
|
||||
"return": {
|
||||
"type": "object_t*",
|
||||
"desc": "返回object对象。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"params": [
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user