mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-12-02 03:58:33 +08:00
add draggable
This commit is contained in:
parent
aeefc503d5
commit
24f816dec9
1252
demos/assets.c
1252
demos/assets.c
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
TK_CONST_DATA_ALIGN(const unsigned char ui_dialog1[]) = {
|
||||
0x04,0x00,0x01,0x01,0xda,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x69,0x61,0x6c,0x6f,0x67,0x31,0x00,
|
||||
0x04,0x00,0x01,0x01,0x1d,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x69,0x61,0x6c,0x6f,0x67,0x31,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,0x12,0x12,0x22,0x11,0x64,0x69,0x61,0x6c,0x6f,0x67,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
@ -16,38 +16,42 @@ TK_CONST_DATA_ALIGN(const unsigned char ui_dialog1[]) = {
|
||||
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,
|
||||
0x33,0x30,0x29,0x00,0x74,0x65,0x78,0x74,0x00,0x48,0x65,0x6c,0x6c,0x6f,0x20,0x41,0x57,0x54,0x4b,0x00,
|
||||
0x00,0x00,0x64,0x69,0x61,0x6c,0x6f,0x67,0x5f,0x63,0x6c,0x69,0x65,0x6e,0x74,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x64,0x72,0x61,0x67,0x67,0x61,0x62,0x6c,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,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,0xe2,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,0x30,0x2c,0x79,0x3d,0x62,0x6f,0x74,0x74,
|
||||
0x6f,0x6d,0x2c,0x77,0x3d,0x31,0x30,0x30,0x25,0x2c,0x68,0x3d,0x2d,0x33,0x30,0x29,0x00,0x00,0x63,0x6f,
|
||||
0x6d,0x62,0x6f,0x5f,0x62,0x6f,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x50,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,0x65,0x6e,0x74,0x65,0x72,0x2c,0x79,0x3d,0x35,0x2c,0x77,
|
||||
0x3d,0x38,0x30,0x25,0x2c,0x68,0x3d,0x33,0x30,0x29,0x00,0x6f,0x70,0x74,0x69,0x6f,0x6e,0x73,0x00,0x6c,
|
||||
0x65,0x66,0x74,0x3b,0x63,0x65,0x6e,0x74,0x65,0x72,0x3b,0x72,0x69,0x67,0x68,0x74,0x3b,0x00,0x6c,0x65,
|
||||
0x66,0x74,0x5f,0x6d,0x61,0x72,0x67,0x69,0x6e,0x00,0x36,0x00,0x72,0x65,0x61,0x64,0x6f,0x6e,0x6c,0x79,
|
||||
0x00,0x74,0x72,0x75,0x65,0x00,0x74,0x65,0x78,0x74,0x00,0x6c,0x65,0x66,0x74,0x00,0x66,0x6f,0x63,0x75,
|
||||
0x73,0x61,0x62,0x6c,0x65,0x00,0x74,0x72,0x75,0x65,0x00,0x00,0x00,0x6c,0x61,0x62,0x65,0x6c,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x72,0x61,0x67,0x5f,0x77,0x69,0x6e,0x64,0x6f,0x77,
|
||||
0x00,0x74,0x72,0x75,0x65,0x00,0x00,0x00,0x00,0x64,0x69,0x61,0x6c,0x6f,0x67,0x5f,0x63,0x6c,0x69,0x65,
|
||||
0x6e,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,0x64,0x00,0x00,0x00,0xe2,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,0x30,
|
||||
0x2c,0x79,0x3d,0x62,0x6f,0x74,0x74,0x6f,0x6d,0x2c,0x77,0x3d,0x31,0x30,0x30,0x25,0x2c,0x68,0x3d,0x2d,
|
||||
0x33,0x30,0x29,0x00,0x00,0x63,0x6f,0x6d,0x62,0x6f,0x5f,0x62,0x6f,0x78,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc8,0x00,0x00,0x00,0x1e,0x00,0x00,
|
||||
0x00,0x05,0x00,0x00,0x00,0x50,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,0x65,0x6e,0x74,0x65,
|
||||
0x72,0x2c,0x79,0x3d,0x35,0x2c,0x77,0x3d,0x38,0x30,0x25,0x2c,0x68,0x3d,0x33,0x30,0x29,0x00,0x6f,0x70,
|
||||
0x74,0x69,0x6f,0x6e,0x73,0x00,0x6c,0x65,0x66,0x74,0x3b,0x63,0x65,0x6e,0x74,0x65,0x72,0x3b,0x72,0x69,
|
||||
0x67,0x68,0x74,0x3b,0x00,0x6c,0x65,0x66,0x74,0x5f,0x6d,0x61,0x72,0x67,0x69,0x6e,0x00,0x36,0x00,0x72,
|
||||
0x65,0x61,0x64,0x6f,0x6e,0x6c,0x79,0x00,0x74,0x72,0x75,0x65,0x00,0x74,0x65,0x78,0x74,0x00,0x6c,0x65,
|
||||
0x66,0x74,0x00,0x66,0x6f,0x63,0x75,0x73,0x61,0x62,0x6c,0x65,0x00,0x74,0x72,0x75,0x65,0x00,0x00,0x00,
|
||||
0x6c,0x61,0x62,0x65,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0xc8,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,0x65,0x6e,0x74,0x65,0x72,0x2c,0x79,0x3d,0x6d,
|
||||
0x69,0x64,0x64,0x6c,0x65,0x3a,0x2d,0x32,0x30,0x2c,0x77,0x3d,0x32,0x30,0x30,0x2c,0x68,0x3d,0x33,0x30,
|
||||
0x29,0x00,0x6e,0x61,0x6d,0x65,0x00,0x00,0x74,0x65,0x78,0x74,0x00,0x42,0x61,0x63,0x6b,0x20,0x74,0x6f,
|
||||
0x20,0x68,0x6f,0x6d,0x65,0x3f,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,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x28,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,0x31,
|
||||
0x30,0x2c,0x79,0x3d,0x62,0x6f,0x74,0x74,0x6f,0x6d,0x3a,0x31,0x30,0x2c,0x77,0x3d,0x34,0x30,0x25,0x2c,
|
||||
0x68,0x3d,0x33,0x30,0x29,0x00,0x6e,0x61,0x6d,0x65,0x00,0x62,0x61,0x63,0x6b,0x5f,0x74,0x6f,0x5f,0x68,
|
||||
0x6f,0x6d,0x65,0x00,0x74,0x65,0x78,0x74,0x00,0xe7,0xa1,0xae,0xe5,0xae,0x9a,0x00,0x66,0x6f,0x63,0x75,
|
||||
0x73,0x61,0x62,0x6c,0x65,0x00,0x74,0x72,0x75,0x65,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,0x28,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,0x65,0x6e,0x74,0x65,0x72,0x2c,0x79,0x3d,0x6d,0x69,0x64,0x64,0x6c,0x65,0x3a,0x2d,
|
||||
0x32,0x30,0x2c,0x77,0x3d,0x32,0x30,0x30,0x2c,0x68,0x3d,0x33,0x30,0x29,0x00,0x6e,0x61,0x6d,0x65,0x00,
|
||||
0x00,0x74,0x65,0x78,0x74,0x00,0x42,0x61,0x63,0x6b,0x20,0x74,0x6f,0x20,0x68,0x6f,0x6d,0x65,0x3f,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,0x0a,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x28,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,0x31,0x30,0x2c,0x79,0x3d,0x62,0x6f,0x74,
|
||||
0x74,0x6f,0x6d,0x3a,0x31,0x30,0x2c,0x77,0x3d,0x34,0x30,0x25,0x2c,0x68,0x3d,0x33,0x30,0x29,0x00,0x6e,
|
||||
0x61,0x6d,0x65,0x00,0x62,0x61,0x63,0x6b,0x5f,0x74,0x6f,0x5f,0x68,0x6f,0x6d,0x65,0x00,0x74,0x65,0x78,
|
||||
0x74,0x00,0xe7,0xa1,0xae,0xe5,0xae,0x9a,0x00,0x66,0x6f,0x63,0x75,0x73,0x61,0x62,0x6c,0x65,0x00,0x74,
|
||||
0x72,0x75,0x65,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,0x28,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,0x72,0x69,0x67,0x68,
|
||||
0x74,0x3a,0x31,0x30,0x2c,0x79,0x3d,0x62,0x6f,0x74,0x74,0x6f,0x6d,0x3a,0x31,0x30,0x2c,0x77,0x3d,0x34,
|
||||
0x30,0x25,0x2c,0x68,0x3d,0x33,0x30,0x29,0x00,0x6e,0x61,0x6d,0x65,0x00,0x71,0x75,0x69,0x74,0x00,0x74,
|
||||
0x65,0x78,0x74,0x00,0xe5,0x8f,0x96,0xe6,0xb6,0x88,0x00,0x66,0x6f,0x63,0x75,0x73,0x61,0x62,0x6c,0x65,
|
||||
0x00,0x74,0x72,0x75,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};/*1034*/
|
||||
0x28,0x78,0x3d,0x72,0x69,0x67,0x68,0x74,0x3a,0x31,0x30,0x2c,0x79,0x3d,0x62,0x6f,0x74,0x74,0x6f,0x6d,
|
||||
0x3a,0x31,0x30,0x2c,0x77,0x3d,0x34,0x30,0x25,0x2c,0x68,0x3d,0x33,0x30,0x29,0x00,0x6e,0x61,0x6d,0x65,
|
||||
0x00,0x71,0x75,0x69,0x74,0x00,0x74,0x65,0x78,0x74,0x00,0xe5,0x8f,0x96,0xe6,0xb6,0x88,0x00,0x66,0x6f,
|
||||
0x63,0x75,0x73,0x61,0x62,0x6c,0x65,0x00,0x74,0x72,0x75,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,};/*1101*/
|
||||
|
@ -1,5 +1,5 @@
|
||||
TK_CONST_DATA_ALIGN(const unsigned char ui_dialog2[]) = {
|
||||
0x04,0x00,0x01,0x01,0x9c,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x69,0x61,0x6c,0x6f,0x67,0x32,0x00,
|
||||
0x04,0x00,0x01,0x01,0xdf,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x69,0x61,0x6c,0x6f,0x67,0x32,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,0x12,0x12,0x22,0x11,0x64,0x69,0x61,0x6c,0x6f,0x67,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
@ -14,37 +14,40 @@ TK_CONST_DATA_ALIGN(const unsigned char ui_dialog2[]) = {
|
||||
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,0x33,0x30,0x29,
|
||||
0x00,0x73,0x74,0x79,0x6c,0x65,0x00,0x63,0x75,0x73,0x74,0x6f,0x6d,0x00,0x74,0x65,0x78,0x74,0x00,0x48,
|
||||
0x65,0x6c,0x6c,0x6f,0x20,0x41,0x57,0x54,0x4b,0x00,0x00,0x00,0x64,0x69,0x61,0x6c,0x6f,0x67,0x5f,0x63,
|
||||
0x6c,0x69,0x65,0x6e,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,0x64,0x00,0x00,0x00,0xe2,0xff,0xff,0xff,
|
||||
0x65,0x6c,0x6c,0x6f,0x20,0x41,0x57,0x54,0x4b,0x00,0x00,0x64,0x72,0x61,0x67,0x67,0x61,0x62,0x6c,0x65,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,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,
|
||||
0x72,0x61,0x67,0x5f,0x77,0x69,0x6e,0x64,0x6f,0x77,0x00,0x74,0x72,0x75,0x65,0x00,0x00,0x00,0x00,0x64,
|
||||
0x69,0x61,0x6c,0x6f,0x67,0x5f,0x63,0x6c,0x69,0x65,0x6e,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,0x64,
|
||||
0x00,0x00,0x00,0xe2,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,0x30,0x2c,0x79,0x3d,0x62,0x6f,0x74,0x74,0x6f,0x6d,0x2c,
|
||||
0x77,0x3d,0x31,0x30,0x30,0x25,0x2c,0x68,0x3d,0x2d,0x33,0x30,0x29,0x00,0x73,0x74,0x79,0x6c,0x65,0x00,
|
||||
0x63,0x75,0x73,0x74,0x6f,0x6d,0x00,0x00,0x6c,0x61,0x62,0x65,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc8,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,0x65,
|
||||
0x6e,0x74,0x65,0x72,0x2c,0x79,0x3d,0x6d,0x69,0x64,0x64,0x6c,0x65,0x3a,0x2d,0x32,0x30,0x2c,0x77,0x3d,
|
||||
0x32,0x30,0x30,0x2c,0x68,0x3d,0x33,0x30,0x29,0x00,0x74,0x65,0x78,0x74,0x00,0x41,0x57,0x54,0x4b,0x20,
|
||||
0x69,0x73,0x20,0x63,0x6f,0x6f,0x6c,0x21,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,0x50,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,0x65,0x6e,0x74,0x65,0x72,0x2c,0x79,0x3d,0x6d,0x69,0x64,0x64,0x6c,0x65,0x3a,0x32,0x30,0x2c,
|
||||
0x77,0x3d,0x38,0x30,0x25,0x2c,0x68,0x3d,0x33,0x30,0x29,0x00,0x6e,0x61,0x6d,0x65,0x00,0x72,0x65,0x6c,
|
||||
0x6f,0x61,0x64,0x5f,0x74,0x68,0x65,0x6d,0x65,0x00,0x74,0x65,0x78,0x74,0x00,0x54,0x65,0x73,0x74,0x20,
|
||||
0x43,0x68,0x61,0x6e,0x67,0x65,0x20,0x54,0x68,0x65,0x6d,0x65,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,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x28,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,0x31,0x30,0x2c,0x79,0x3d,0x62,0x6f,0x74,0x74,0x6f,0x6d,0x3a,0x31,0x30,0x2c,
|
||||
0x77,0x3d,0x34,0x30,0x25,0x2c,0x68,0x3d,0x33,0x30,0x29,0x00,0x73,0x74,0x79,0x6c,0x65,0x00,0x67,0x72,
|
||||
0x65,0x65,0x6e,0x5f,0x62,0x74,0x6e,0x00,0x6e,0x61,0x6d,0x65,0x00,0x71,0x75,0x69,0x74,0x00,0x74,0x65,
|
||||
0x78,0x74,0x00,0xe7,0xa1,0xae,0xe5,0xae,0x9a,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,0x28,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,0x30,0x2c,0x79,0x3d,0x62,0x6f,0x74,0x74,0x6f,0x6d,0x2c,0x77,0x3d,0x31,0x30,0x30,0x25,0x2c,
|
||||
0x68,0x3d,0x2d,0x33,0x30,0x29,0x00,0x73,0x74,0x79,0x6c,0x65,0x00,0x63,0x75,0x73,0x74,0x6f,0x6d,0x00,
|
||||
0x00,0x6c,0x61,0x62,0x65,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0xc8,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,0x65,0x6e,0x74,0x65,0x72,0x2c,0x79,0x3d,
|
||||
0x6d,0x69,0x64,0x64,0x6c,0x65,0x3a,0x2d,0x32,0x30,0x2c,0x77,0x3d,0x32,0x30,0x30,0x2c,0x68,0x3d,0x33,
|
||||
0x30,0x29,0x00,0x74,0x65,0x78,0x74,0x00,0x41,0x57,0x54,0x4b,0x20,0x69,0x73,0x20,0x63,0x6f,0x6f,0x6c,
|
||||
0x21,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,0x50,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,0x65,0x6e,0x74,0x65,0x72,
|
||||
0x2c,0x79,0x3d,0x6d,0x69,0x64,0x64,0x6c,0x65,0x3a,0x32,0x30,0x2c,0x77,0x3d,0x38,0x30,0x25,0x2c,0x68,
|
||||
0x3d,0x33,0x30,0x29,0x00,0x6e,0x61,0x6d,0x65,0x00,0x72,0x65,0x6c,0x6f,0x61,0x64,0x5f,0x74,0x68,0x65,
|
||||
0x6d,0x65,0x00,0x74,0x65,0x78,0x74,0x00,0x54,0x65,0x73,0x74,0x20,0x43,0x68,0x61,0x6e,0x67,0x65,0x20,
|
||||
0x54,0x68,0x65,0x6d,0x65,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,
|
||||
0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x28,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,0x31,0x30,
|
||||
0x2c,0x79,0x3d,0x62,0x6f,0x74,0x74,0x6f,0x6d,0x3a,0x31,0x30,0x2c,0x77,0x3d,0x34,0x30,0x25,0x2c,0x68,
|
||||
0x3d,0x33,0x30,0x29,0x00,0x73,0x74,0x79,0x6c,0x65,0x00,0x67,0x72,0x65,0x65,0x6e,0x5f,0x62,0x74,0x6e,
|
||||
0x00,0x6e,0x61,0x6d,0x65,0x00,0x71,0x75,0x69,0x74,0x00,0x74,0x65,0x78,0x74,0x00,0xe7,0xa1,0xae,0xe5,
|
||||
0xae,0x9a,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,0x28,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,0x72,0x69,0x67,0x68,0x74,
|
||||
0x3a,0x31,0x30,0x2c,0x79,0x3d,0x62,0x6f,0x74,0x74,0x6f,0x6d,0x3a,0x31,0x30,0x2c,0x77,0x3d,0x34,0x30,
|
||||
0x25,0x2c,0x68,0x3d,0x33,0x30,0x29,0x00,0x73,0x74,0x79,0x6c,0x65,0x00,0x72,0x65,0x64,0x5f,0x62,0x74,
|
||||
0x6e,0x00,0x6e,0x61,0x6d,0x65,0x00,0x71,0x75,0x69,0x74,0x00,0x74,0x65,0x78,0x74,0x00,0xe5,0x8f,0x96,
|
||||
0xe6,0xb6,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};/*972*/
|
||||
0x78,0x3d,0x72,0x69,0x67,0x68,0x74,0x3a,0x31,0x30,0x2c,0x79,0x3d,0x62,0x6f,0x74,0x74,0x6f,0x6d,0x3a,
|
||||
0x31,0x30,0x2c,0x77,0x3d,0x34,0x30,0x25,0x2c,0x68,0x3d,0x33,0x30,0x29,0x00,0x73,0x74,0x79,0x6c,0x65,
|
||||
0x00,0x72,0x65,0x64,0x5f,0x62,0x74,0x6e,0x00,0x6e,0x61,0x6d,0x65,0x00,0x71,0x75,0x69,0x74,0x00,0x74,
|
||||
0x65,0x78,0x74,0x00,0xe5,0x8f,0x96,0xe6,0xb6,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};/*1039*/
|
||||
|
35
demos/assets/default/inc/ui/draggable.data
Normal file
35
demos/assets/default/inc/ui/draggable.data
Normal file
@ -0,0 +1,35 @@
|
||||
TK_CONST_DATA_ALIGN(const unsigned char ui_draggable[]) = {
|
||||
0x04,0x00,0x01,0x01,0x68,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x72,0x61,0x67,0x67,0x61,0x62,0x6c,
|
||||
0x65,0x00,0x64,0x61,0x74,0x61,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,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x6e,0x69,0x6d,
|
||||
0x5f,0x68,0x69,0x6e,0x74,0x00,0x68,0x74,0x72,0x61,0x6e,0x73,0x6c,0x61,0x74,0x65,0x00,0x74,0x65,0x78,
|
||||
0x74,0x00,0x44,0x72,0x61,0x67,0x67,0x61,0x62,0x6c,0x65,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,0x0a,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x50,0x00,0x00,0x00,0x28,0x00,0x00,
|
||||
0x00,0x74,0x65,0x78,0x74,0x00,0x44,0x72,0x61,0x67,0x20,0x4d,0x65,0x00,0x00,0x64,0x72,0x61,0x67,0x67,
|
||||
0x61,0x62,0x6c,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,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,0x64,0x00,
|
||||
0x00,0x00,0x0a,0x00,0x00,0x00,0x50,0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x74,0x65,0x78,0x74,0x00,0x44,
|
||||
0x72,0x61,0x67,0x20,0x56,0x00,0x00,0x64,0x72,0x61,0x67,0x67,0x61,0x62,0x6c,0x65,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x76,0x65,0x72,0x74,0x69,
|
||||
0x63,0x61,0x6c,0x5f,0x6f,0x6e,0x6c,0x79,0x00,0x74,0x72,0x75,0x65,0x00,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,0x0a,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x50,0x00,0x00,
|
||||
0x00,0x28,0x00,0x00,0x00,0x74,0x65,0x78,0x74,0x00,0x44,0x72,0x61,0x67,0x20,0x48,0x00,0x00,0x64,0x72,
|
||||
0x61,0x67,0x67,0x61,0x62,0x6c,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x68,0x6f,0x72,0x69,0x7a,0x6f,0x6e,0x74,0x61,0x6c,0x5f,0x6f,0x6e,0x6c,
|
||||
0x79,0x00,0x74,0x72,0x75,0x65,0x00,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,0x0a,0x00,0x00,0x00,0xc8,0x00,0x00,0x00,0x50,0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x74,0x65,
|
||||
0x78,0x74,0x00,0x44,0x72,0x61,0x67,0x20,0x52,0x00,0x00,0x64,0x72,0x61,0x67,0x67,0x61,0x62,0x6c,0x65,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6c,
|
||||
0x65,0x66,0x74,0x00,0x31,0x30,0x00,0x72,0x69,0x67,0x68,0x74,0x00,0x32,0x30,0x30,0x00,0x74,0x6f,0x70,
|
||||
0x00,0x31,0x35,0x30,0x00,0x62,0x6f,0x74,0x74,0x6f,0x6d,0x00,0x33,0x30,0x30,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,};/*664*/
|
@ -1,5 +1,5 @@
|
||||
TK_CONST_DATA_ALIGN(const unsigned char ui_main[]) = {
|
||||
0x04,0x00,0x01,0x01,0x04,0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x6d,0x61,0x69,0x6e,0x00,0x64,0x61,0x74,
|
||||
0x04,0x00,0x01,0x01,0xdf,0x11,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,
|
||||
@ -192,31 +192,42 @@ TK_CONST_DATA_ALIGN(const unsigned char ui_main[]) = {
|
||||
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,
|
||||
0x75,0x6c,0x74,0x28,0x63,0x3d,0x32,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,
|
||||
0x64,0x72,0x61,0x67,0x67,0x61,0x62,0x6c,0x65,0x00,0x74,0x65,0x78,0x74,0x00,0x44,0x72,0x61,0x67,0x67,
|
||||
0x61,0x62,0x6c,0x65,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,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,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,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,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,0x00,0x6e,0x61,0x6d,0x65,0x00,0x72,0x65,0x6c,0x6f,0x61,0x64,0x5f,0x74,0x68,0x65,0x6d,0x65,0x00,
|
||||
0x74,0x65,0x78,0x74,0x00,0x54,0x65,0x73,0x74,0x20,0x43,0x68,0x61,0x6e,0x67,0x65,0x20,0x54,0x68,0x65,
|
||||
0x6d,0x65,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x6e,0x61,0x6d,0x65,0x00,0x72,0x65,0x6c,0x6f,0x61,0x64,0x5f,0x74,0x68,0x65,0x6d,0x65,0x00,0x74,
|
||||
0x65,0x78,0x74,0x00,0x54,0x65,0x73,0x74,0x20,0x43,0x68,0x61,0x6e,0x67,0x65,0x20,0x54,0x68,0x65,0x6d,
|
||||
0x65,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,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,0x73,0x6c,0x69,
|
||||
0x64,0x65,0x5f,0x69,0x6e,0x64,0x69,0x63,0x61,0x74,0x6f,0x72,0x00,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,0x14,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,0x62,0x2c,0x77,0x3d,0x31,0x30,0x30,0x25,0x2c,
|
||||
0x68,0x3d,0x32,0x30,0x29,0x00,0x73,0x74,0x79,0x6c,0x65,0x00,0x62,0x6c,0x75,0x65,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,};/*4404*/
|
||||
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,0x73,0x6c,0x69,0x64,
|
||||
0x65,0x5f,0x69,0x6e,0x64,0x69,0x63,0x61,0x74,0x6f,0x72,0x00,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,
|
||||
0x14,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,0x62,0x2c,0x77,0x3d,0x31,0x30,0x30,0x25,0x2c,0x68,
|
||||
0x3d,0x32,0x30,0x29,0x00,0x73,0x74,0x79,0x6c,0x65,0x00,0x62,0x6c,0x75,0x65,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,};/*4623*/
|
||||
|
Binary file not shown.
@ -1,5 +1,8 @@
|
||||
<dialog anim_hint="center_scale(duration=300)" x="c" y="m" w="80%" h="160" text="Dialog" move_focus_prev_key="up" move_focus_next_key="down">
|
||||
<dialog_title x="0" y="0" w="100%" h="30" text="Hello AWTK" />
|
||||
<dialog_title x="0" y="0" w="100%" h="30" text="Hello AWTK" >
|
||||
<draggable drag_window="true"/>
|
||||
</dialog_title>
|
||||
|
||||
<dialog_client x="0" y="bottom" w="100%" h="-30">
|
||||
<combo_box left_margin="6" readonly="true" x="center" y="5" w="80%" h="30" text="left" options="left;center;right;" focusable="true"/>
|
||||
<label name="" x="center" y="middle:-20" w="200" h="30" text="Back to home?"/>
|
||||
|
Binary file not shown.
@ -1,6 +1,8 @@
|
||||
<dialog theme="dialog" style="custom" highlight="default(alpha=40)"
|
||||
x="c" y="m" w="80%" h="220">
|
||||
<dialog_title style="custom" x="0" y="0" w="100%" h="30" text="Hello AWTK" />
|
||||
<dialog_title style="custom" x="0" y="0" w="100%" h="30" text="Hello AWTK" >
|
||||
<draggable drag_window="true"/>
|
||||
</dialog_title>
|
||||
<dialog_client style="custom" x="0" y="bottom" w="100%" h="-30">
|
||||
<label x="center" y="middle:-20" w="200" h="30" text="AWTK is cool!"/>
|
||||
<button name="reload_theme" x="center" y="middle:20" w="80%" h="30" text="Test Change Theme"/>
|
||||
|
BIN
demos/assets/default/raw/ui/draggable.bin
Normal file
BIN
demos/assets/default/raw/ui/draggable.bin
Normal file
Binary file not shown.
17
demos/assets/default/raw/ui/draggable.xml
Normal file
17
demos/assets/default/raw/ui/draggable.xml
Normal file
@ -0,0 +1,17 @@
|
||||
<window anim_hint="htranslate" text="Draggable">
|
||||
<button text="Drag Me" w="80" h="40" x="10" y="10">
|
||||
<draggable />
|
||||
</button>
|
||||
|
||||
<button text="Drag V" w="80" h="40" x="100" y="10">
|
||||
<draggable vertical_only="true"/>
|
||||
</button>
|
||||
|
||||
<button text="Drag H" w="80" h="40" x="10" y="100">
|
||||
<draggable horizontal_only="true"/>
|
||||
</button>
|
||||
|
||||
<button text="Drag R" w="80" h="40" x="10" y="200">
|
||||
<draggable left="10" right="200" top="150" bottom="300"/>
|
||||
</button>
|
||||
</window>
|
Binary file not shown.
@ -44,6 +44,9 @@
|
||||
<button name="open:hscroll_label" text="HScroll Label"/>
|
||||
<button name="open:menu" text="ContextMenu"/>
|
||||
</view>
|
||||
<view x="0" y="0" w="100%" h="100%" children_layout="default(c=2,r=8,m=5,s=5)">
|
||||
<button name="open:draggable" text="Draggable"/>
|
||||
</view>
|
||||
<view x="0" y="0" w="100%" h="100%" children_layout="default(c=1,r=8,m=5,s=5)">
|
||||
<button name="open:memtest" text="MemTest"/>
|
||||
<button name="open:calibration_win" text="Calibration"/>
|
||||
|
@ -1,5 +1,9 @@
|
||||
# 最新动态
|
||||
|
||||
* 2019/10/25
|
||||
* widget\_off\_by_\ctx/on\_detach\_parent/on\_attach\_parent
|
||||
* 增加draggable控件。
|
||||
|
||||
* 2019/10/24
|
||||
* 优化fragment frame buffer,在STM32F103等低端平台,内存不足以实现framebuffer时,性能大幅提高(感谢智明提供补丁)。
|
||||
* 修改文档中的错误(感谢俊杰提供补丁)。
|
||||
|
@ -51,6 +51,7 @@
|
||||
#include "combo_box_ex/combo_box_ex.h"
|
||||
#include "mledit/line_number.h"
|
||||
#include "mledit/mledit.h"
|
||||
#include "features/draggable.h"
|
||||
|
||||
#include "ext_widgets/ext_widgets.h"
|
||||
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "switch/switch.h"
|
||||
#include "guage/guage.h"
|
||||
#include "mledit/mledit.h"
|
||||
#include "features/draggable.h"
|
||||
#include "mledit/line_number.h"
|
||||
#include "guage/guage_pointer.h"
|
||||
#include "gif_image/gif_image.h"
|
||||
@ -99,6 +100,7 @@ ret_t tk_ext_widgets_init() {
|
||||
widget_factory_register(f, WIDGET_TYPE_LINE_NUMBER, line_number_create);
|
||||
widget_factory_register(f, WIDGET_TYPE_HSCROLL_LABEL, hscroll_label_create);
|
||||
widget_factory_register(f, WIDGET_TYPE_COMBO_BOX_EX, combo_box_ex_create);
|
||||
widget_factory_register(f, WIDGET_TYPE_DRAGGABLE, draggable_create);
|
||||
|
||||
children_layouter_register_ext_builtins();
|
||||
|
||||
|
4
src/ext_widgets/features/README.md
Normal file
4
src/ext_widgets/features/README.md
Normal file
@ -0,0 +1,4 @@
|
||||
# 特性类控件
|
||||
|
||||
特性类控件一般是给所在的容器控件加上指定的特性。比如可拖动、可点击、可选择、可调整大小和上下文帮助等。
|
||||
|
337
src/ext_widgets/features/draggable.c
Normal file
337
src/ext_widgets/features/draggable.c
Normal file
@ -0,0 +1,337 @@
|
||||
/**
|
||||
* File: draggable.c
|
||||
* Author: AWTK Develop Team
|
||||
* Brief: make parent widget or window draggable
|
||||
*
|
||||
* Copyright (c) 2019 - 2019 Guangzhou ZHIYUAN Electronics Co.,Ltd.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* License file for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* History:
|
||||
* ================================================================
|
||||
* 2019-10-25 Li XianJing <xianjimli@hotmail.com> created
|
||||
*
|
||||
*/
|
||||
|
||||
#include "tkc/mem.h"
|
||||
#include "tkc/utils.h"
|
||||
#include "draggable.h"
|
||||
|
||||
ret_t draggable_set_top(widget_t* widget, int32_t top) {
|
||||
draggable_t* draggable = DRAGGABLE(widget);
|
||||
return_value_if_fail(draggable != NULL, RET_BAD_PARAMS);
|
||||
|
||||
draggable->top = top;
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
ret_t draggable_set_bottom(widget_t* widget, int32_t bottom) {
|
||||
draggable_t* draggable = DRAGGABLE(widget);
|
||||
return_value_if_fail(draggable != NULL, RET_BAD_PARAMS);
|
||||
|
||||
draggable->bottom = bottom;
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
ret_t draggable_set_left(widget_t* widget, int32_t left) {
|
||||
draggable_t* draggable = DRAGGABLE(widget);
|
||||
return_value_if_fail(draggable != NULL, RET_BAD_PARAMS);
|
||||
|
||||
draggable->left = left;
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
ret_t draggable_set_right(widget_t* widget, int32_t right) {
|
||||
draggable_t* draggable = DRAGGABLE(widget);
|
||||
return_value_if_fail(draggable != NULL, RET_BAD_PARAMS);
|
||||
|
||||
draggable->right = right;
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
ret_t draggable_set_vertical_only(widget_t* widget, bool_t vertical_only) {
|
||||
draggable_t* draggable = DRAGGABLE(widget);
|
||||
return_value_if_fail(draggable != NULL, RET_BAD_PARAMS);
|
||||
|
||||
draggable->vertical_only = vertical_only;
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
ret_t draggable_set_horizontal_only(widget_t* widget, bool_t horizontal_only) {
|
||||
draggable_t* draggable = DRAGGABLE(widget);
|
||||
return_value_if_fail(draggable != NULL, RET_BAD_PARAMS);
|
||||
|
||||
draggable->horizontal_only = horizontal_only;
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
ret_t draggable_set_drag_window(widget_t* widget, bool_t drag_window) {
|
||||
draggable_t* draggable = DRAGGABLE(widget);
|
||||
return_value_if_fail(draggable != NULL, RET_BAD_PARAMS);
|
||||
|
||||
draggable->drag_window = drag_window;
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
ret_t draggable_set_inertia(widget_t* widget, bool_t inertia) {
|
||||
draggable_t* draggable = DRAGGABLE(widget);
|
||||
return_value_if_fail(draggable != NULL, RET_BAD_PARAMS);
|
||||
|
||||
draggable->inertia = inertia;
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
ret_t draggable_set_go_or_back(widget_t* widget, bool_t go_or_back) {
|
||||
draggable_t* draggable = DRAGGABLE(widget);
|
||||
return_value_if_fail(draggable != NULL, RET_BAD_PARAMS);
|
||||
|
||||
draggable->go_or_back = go_or_back;
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
static ret_t draggable_get_prop(widget_t* widget, const char* name, value_t* v) {
|
||||
draggable_t* draggable = DRAGGABLE(widget);
|
||||
return_value_if_fail(draggable != NULL && name != NULL && v != NULL, RET_BAD_PARAMS);
|
||||
|
||||
if (tk_str_eq(DRAGGABLE_PROP_TOP, name)) {
|
||||
value_set_int32(v, draggable->top);
|
||||
return RET_OK;
|
||||
} else if (tk_str_eq(DRAGGABLE_PROP_BOTTOM, name)) {
|
||||
value_set_int32(v, draggable->bottom);
|
||||
return RET_OK;
|
||||
} else if (tk_str_eq(DRAGGABLE_PROP_LEFT, name)) {
|
||||
value_set_int32(v, draggable->left);
|
||||
return RET_OK;
|
||||
} else if (tk_str_eq(DRAGGABLE_PROP_RIGHT, name)) {
|
||||
value_set_int32(v, draggable->right);
|
||||
return RET_OK;
|
||||
} else if (tk_str_eq(DRAGGABLE_PROP_VERTICAL_ONLY, name)) {
|
||||
value_set_bool(v, draggable->vertical_only);
|
||||
return RET_OK;
|
||||
} else if (tk_str_eq(DRAGGABLE_PROP_HORIZONTAL_ONLY, name)) {
|
||||
value_set_bool(v, draggable->horizontal_only);
|
||||
return RET_OK;
|
||||
} else if (tk_str_eq(DRAGGABLE_PROP_DRAG_WINDOW, name)) {
|
||||
value_set_bool(v, draggable->drag_window);
|
||||
return RET_OK;
|
||||
} else if (tk_str_eq(DRAGGABLE_PROP_INERTIA, name)) {
|
||||
value_set_bool(v, draggable->inertia);
|
||||
return RET_OK;
|
||||
} else if (tk_str_eq(DRAGGABLE_PROP_GO_OR_BACK, name)) {
|
||||
value_set_bool(v, draggable->go_or_back);
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
return RET_NOT_FOUND;
|
||||
}
|
||||
|
||||
static ret_t draggable_set_prop(widget_t* widget, const char* name, const value_t* v) {
|
||||
draggable_t* draggable = DRAGGABLE(widget);
|
||||
return_value_if_fail(widget != NULL && name != NULL && v != NULL, RET_BAD_PARAMS);
|
||||
|
||||
if (tk_str_eq(DRAGGABLE_PROP_TOP, name)) {
|
||||
draggable_set_top(widget, value_int32(v));
|
||||
return RET_OK;
|
||||
} else if (tk_str_eq(DRAGGABLE_PROP_BOTTOM, name)) {
|
||||
draggable_set_bottom(widget, value_int32(v));
|
||||
return RET_OK;
|
||||
} else if (tk_str_eq(DRAGGABLE_PROP_LEFT, name)) {
|
||||
draggable_set_left(widget, value_int32(v));
|
||||
return RET_OK;
|
||||
} else if (tk_str_eq(DRAGGABLE_PROP_RIGHT, name)) {
|
||||
draggable_set_right(widget, value_int32(v));
|
||||
return RET_OK;
|
||||
} else if (tk_str_eq(DRAGGABLE_PROP_VERTICAL_ONLY, name)) {
|
||||
draggable_set_vertical_only(widget, value_bool(v));
|
||||
return RET_OK;
|
||||
} else if (tk_str_eq(DRAGGABLE_PROP_HORIZONTAL_ONLY, name)) {
|
||||
draggable_set_horizontal_only(widget, value_bool(v));
|
||||
return RET_OK;
|
||||
} else if (tk_str_eq(DRAGGABLE_PROP_DRAG_WINDOW, name)) {
|
||||
draggable_set_drag_window(widget, value_bool(v));
|
||||
return RET_OK;
|
||||
} else if (tk_str_eq(DRAGGABLE_PROP_INERTIA, name)) {
|
||||
draggable_set_inertia(widget, value_bool(v));
|
||||
return RET_OK;
|
||||
} else if (tk_str_eq(DRAGGABLE_PROP_GO_OR_BACK, name)) {
|
||||
draggable_set_go_or_back(widget, value_bool(v));
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
return RET_NOT_FOUND;
|
||||
}
|
||||
|
||||
static ret_t draggable_on_destroy(widget_t* widget) {
|
||||
draggable_t* draggable = DRAGGABLE(widget);
|
||||
return_value_if_fail(widget != NULL && draggable != NULL, RET_BAD_PARAMS);
|
||||
|
||||
(void)draggable;
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
static ret_t draggable_on_paint_self(widget_t* widget, canvas_t* c) {
|
||||
draggable_t* draggable = DRAGGABLE(widget);
|
||||
|
||||
(void)draggable;
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
static ret_t draggable_on_parent_pointer_down(void* ctx, event_t* e) {
|
||||
widget_t* widget = WIDGET(ctx);
|
||||
pointer_event_t* evt = (pointer_event_t*)e;
|
||||
draggable_t* draggable = DRAGGABLE(widget);
|
||||
widget_t* target = draggable->drag_window ? widget_get_window(widget) : widget->parent;
|
||||
|
||||
draggable->down.x = evt->x;
|
||||
draggable->down.y = evt->y;
|
||||
draggable->saved_position.x = target->x;
|
||||
draggable->saved_position.y = target->y;
|
||||
|
||||
widget_grab(widget->parent->parent, widget->parent);
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
static ret_t draggable_move_target(widget_t* widget, xy_t x, xy_t y) {
|
||||
draggable_t* draggable = DRAGGABLE(widget);
|
||||
widget_t* target = draggable->drag_window ? widget_get_window(widget) : widget->parent;
|
||||
|
||||
xy_t min_x = draggable->left != DRAGGABLE_UNSPECIFIED_NUM ? draggable->left : 0;
|
||||
xy_t min_y = draggable->top != DRAGGABLE_UNSPECIFIED_NUM ? draggable->top : 0;
|
||||
xy_t max_x =
|
||||
(draggable->right != DRAGGABLE_UNSPECIFIED_NUM ? draggable->right : target->parent->w) - target->w;
|
||||
xy_t max_y =
|
||||
(draggable->bottom != DRAGGABLE_UNSPECIFIED_NUM ? draggable->bottom : target->parent->h) - target->h;
|
||||
|
||||
x = tk_clampi(x, min_x, max_x);
|
||||
y = tk_clampi(y, min_y, max_y);
|
||||
|
||||
widget_move(target, x, y);
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
static ret_t draggable_on_parent_pointer_move(void* ctx, event_t* e) {
|
||||
xy_t x = 0;
|
||||
xy_t y = 0;
|
||||
widget_t* widget = WIDGET(ctx);
|
||||
pointer_event_t* evt = (pointer_event_t*)e;
|
||||
draggable_t* draggable = DRAGGABLE(widget);
|
||||
xy_t dx = evt->x - draggable->down.x;
|
||||
xy_t dy = evt->y - draggable->down.y;
|
||||
|
||||
x = draggable->saved_position.x + (draggable->vertical_only ? 0 : dx);
|
||||
y = draggable->saved_position.y + (draggable->horizontal_only ? 0 : dy);
|
||||
|
||||
if (!evt->pressed) {
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
draggable_move_target(widget, x, y);
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
static ret_t draggable_on_parent_pointer_up(void* ctx, event_t* e) {
|
||||
widget_t* widget = WIDGET(ctx);
|
||||
|
||||
widget_grab(widget->parent->parent, widget->parent);
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
static ret_t draggable_on_attach_parent(widget_t* widget, widget_t* parent) {
|
||||
draggable_t* draggable = DRAGGABLE(widget);
|
||||
|
||||
widget_on(parent, EVT_POINTER_DOWN, draggable_on_parent_pointer_down, draggable);
|
||||
widget_on(parent, EVT_POINTER_MOVE, draggable_on_parent_pointer_move, draggable);
|
||||
widget_on(parent, EVT_POINTER_UP, draggable_on_parent_pointer_up, draggable);
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
static ret_t draggable_on_detach_parent(widget_t* widget, widget_t* parent) {
|
||||
draggable_t* draggable = DRAGGABLE(widget);
|
||||
|
||||
widget_off_by_ctx(parent, widget);
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
static ret_t draggable_on_event(widget_t* widget, event_t* e) {
|
||||
draggable_t* draggable = DRAGGABLE(widget);
|
||||
return_value_if_fail(widget != NULL && draggable != NULL, RET_BAD_PARAMS);
|
||||
|
||||
(void)draggable;
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
const char* s_draggable_properties[] = {
|
||||
DRAGGABLE_PROP_TOP, DRAGGABLE_PROP_BOTTOM,
|
||||
DRAGGABLE_PROP_LEFT, DRAGGABLE_PROP_RIGHT,
|
||||
DRAGGABLE_PROP_VERTICAL_ONLY, DRAGGABLE_PROP_HORIZONTAL_ONLY,
|
||||
DRAGGABLE_PROP_DRAG_WINDOW, DRAGGABLE_PROP_INERTIA,
|
||||
DRAGGABLE_PROP_GO_OR_BACK, NULL};
|
||||
|
||||
TK_DECL_VTABLE(draggable) = {.size = sizeof(draggable_t),
|
||||
.type = WIDGET_TYPE_DRAGGABLE,
|
||||
.clone_properties = s_draggable_properties,
|
||||
.persistent_properties = s_draggable_properties,
|
||||
.parent = TK_PARENT_VTABLE(widget),
|
||||
.create = draggable_create,
|
||||
.on_paint_self = draggable_on_paint_self,
|
||||
.set_prop = draggable_set_prop,
|
||||
.get_prop = draggable_get_prop,
|
||||
.on_event = draggable_on_event,
|
||||
.on_attach_parent = draggable_on_attach_parent,
|
||||
.on_detach_parent = draggable_on_detach_parent,
|
||||
.on_destroy = draggable_on_destroy};
|
||||
|
||||
widget_t* draggable_create(widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h) {
|
||||
widget_t* widget = widget_create(parent, TK_REF_VTABLE(draggable), x, y, w, h);
|
||||
draggable_t* draggable = DRAGGABLE(widget);
|
||||
return_value_if_fail(draggable != NULL, NULL);
|
||||
|
||||
draggable->top = DRAGGABLE_UNSPECIFIED_NUM;
|
||||
draggable->bottom = DRAGGABLE_UNSPECIFIED_NUM;
|
||||
draggable->left = DRAGGABLE_UNSPECIFIED_NUM;
|
||||
draggable->right = DRAGGABLE_UNSPECIFIED_NUM;
|
||||
draggable->vertical_only = FALSE;
|
||||
draggable->horizontal_only = FALSE;
|
||||
draggable->drag_window = FALSE;
|
||||
draggable->inertia = FALSE;
|
||||
draggable->go_or_back = FALSE;
|
||||
widget_set_sensitive(widget, FALSE);
|
||||
|
||||
return widget;
|
||||
}
|
||||
|
||||
widget_t* draggable_cast(widget_t* widget) {
|
||||
return_value_if_fail(WIDGET_IS_INSTANCE_OF(widget, draggable), NULL);
|
||||
|
||||
return widget;
|
||||
}
|
||||
|
||||
#include "base/widget_factory.h"
|
||||
|
||||
ret_t draggable_register(void) {
|
||||
return widget_factory_register(widget_factory(), WIDGET_TYPE_DRAGGABLE, draggable_create);
|
||||
}
|
282
src/ext_widgets/features/draggable.h
Normal file
282
src/ext_widgets/features/draggable.h
Normal file
@ -0,0 +1,282 @@
|
||||
/**
|
||||
* File: draggable.h
|
||||
* Author: AWTK Develop Team
|
||||
* Brief: make parent widget or window draggable
|
||||
*
|
||||
* Copyright (c) 2019 - 2019 Guangzhou ZHIYUAN Electronics Co.,Ltd.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* License file for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* History:
|
||||
* ================================================================
|
||||
* 2019-10-25 Li XianJing <xianjimli@hotmail.com> created
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TK_DRAGGABLE_H
|
||||
#define TK_DRAGGABLE_H
|
||||
|
||||
#include "base/widget.h"
|
||||
|
||||
BEGIN_C_DECLS
|
||||
/**
|
||||
* @class draggable_t
|
||||
* @parent widget_t
|
||||
* @annotation ["scriptable","design","widget"]
|
||||
*
|
||||
* 将draggable放入目标控件,即可让目标控件或当前窗口可以被拖动。
|
||||
*
|
||||
* draggable\_t是[widget\_t](widget_t.md)的子类控件,widget\_t的函数均适用于draggable\_t控件。
|
||||
*
|
||||
* 在xml中使用"draggable"标签创建draggable控件。如:
|
||||
*
|
||||
* ```xml
|
||||
* <button text="Drag Me" w="80" h="40" x="10" y="10">
|
||||
* <draggable />
|
||||
* </button>
|
||||
* ```
|
||||
*
|
||||
* 拖动对话框标题时移动对话框:
|
||||
*
|
||||
* ```xml
|
||||
* <dialog_title x="0" y="0" w="100%" h="30" text="Hello AWTK" >
|
||||
* <draggable drag_window="true"/>
|
||||
* </dialog_title>
|
||||
* ```
|
||||
*
|
||||
* > 更多用法请参考:
|
||||
* [draggable.xml](https://github.com/zlgopen/awtk/blob/master/demos/assets/raw/ui/draggable.xml)
|
||||
*
|
||||
* 在c代码中使用函数draggable\_create创建按钮控件。如:
|
||||
*
|
||||
* ```c
|
||||
* widget_t* draggable = draggable_create(target, 0, 0, 0, 0);
|
||||
* ```
|
||||
*
|
||||
* > draggable本身不可见,故无需style。
|
||||
*
|
||||
*/
|
||||
typedef struct _draggable_t {
|
||||
widget_t widget;
|
||||
|
||||
/**
|
||||
* @property {int32_t} top
|
||||
* @annotation ["set_prop","get_prop","readable","persitent","design","scriptable"]
|
||||
* 拖动范围的顶部限制。缺省为父控件的顶部。
|
||||
*/
|
||||
int32_t top;
|
||||
|
||||
/**
|
||||
* @property {int32_t} bottom
|
||||
* @annotation ["set_prop","get_prop","readable","persitent","design","scriptable"]
|
||||
* 拖动范围的底部限制。缺省为父控件的底部。
|
||||
*/
|
||||
int32_t bottom;
|
||||
|
||||
/**
|
||||
* @property {int32_t} left
|
||||
* @annotation ["set_prop","get_prop","readable","persitent","design","scriptable"]
|
||||
* 拖动范围的左边限制。缺省为父控件的左边。
|
||||
*/
|
||||
int32_t left;
|
||||
|
||||
/**
|
||||
* @property {int32_t} right
|
||||
* @annotation ["set_prop","get_prop","readable","persitent","design","scriptable"]
|
||||
* 拖动范围的右边限制。缺省为父控件的右边边。
|
||||
*/
|
||||
int32_t right;
|
||||
|
||||
/**
|
||||
* @property {bool_t} vertical_only
|
||||
* @annotation ["set_prop","get_prop","readable","persitent","design","scriptable"]
|
||||
* 只允许垂直拖动。
|
||||
*/
|
||||
bool_t vertical_only;
|
||||
|
||||
/**
|
||||
* @property {bool_t} horizontal_only
|
||||
* @annotation ["set_prop","get_prop","readable","persitent","design","scriptable"]
|
||||
* 只允许水平拖动。
|
||||
*/
|
||||
bool_t horizontal_only;
|
||||
|
||||
/**
|
||||
* @property {bool_t} drag_window
|
||||
* @annotation ["set_prop","get_prop","readable","persitent","design","scriptable"]
|
||||
* 拖动窗口而不是父控件。比如放在对话框的titlebar上,拖动titlebar其实是希望拖动对话框。
|
||||
*/
|
||||
bool_t drag_window;
|
||||
|
||||
/**
|
||||
* @property {bool_t} inertia
|
||||
* @annotation ["set_prop","get_prop","readable","persitent","design","scriptable"]
|
||||
* 启用惯性效果。
|
||||
*/
|
||||
bool_t inertia;
|
||||
|
||||
/**
|
||||
* @property {bool_t} go_or_back
|
||||
* @annotation ["set_prop","get_prop","readable","persitent","design","scriptable"]
|
||||
* 要么拖动到指定位置,要么返回原来的位置。
|
||||
*/
|
||||
bool_t go_or_back;
|
||||
|
||||
/*private*/
|
||||
point_t down;
|
||||
point_t saved_position;
|
||||
} draggable_t;
|
||||
|
||||
/**
|
||||
* @method draggable_create
|
||||
* @annotation ["constructor", "scriptable"]
|
||||
* 创建draggable对象
|
||||
* @param {widget_t*} parent 父控件
|
||||
* @param {xy_t} x x坐标
|
||||
* @param {xy_t} y y坐标
|
||||
* @param {wh_t} w 宽度
|
||||
* @param {wh_t} h 高度
|
||||
*
|
||||
* @return {widget_t*} 对象。
|
||||
*/
|
||||
widget_t* draggable_create(widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h);
|
||||
|
||||
/**
|
||||
* @method draggable_cast
|
||||
* 转换为draggable对象(供脚本语言使用)。
|
||||
* @annotation ["cast", "scriptable"]
|
||||
* @param {widget_t*} widget draggable对象。
|
||||
*
|
||||
* @return {widget_t*} draggable对象。
|
||||
*/
|
||||
widget_t* draggable_cast(widget_t* widget);
|
||||
|
||||
/**
|
||||
* @method draggable_set_top
|
||||
* 设置top。
|
||||
* @annotation ["scriptable"]
|
||||
* @param {widget_t*} widget widget对象。
|
||||
* @param {uint32_t} top 拖动范围的顶部限制。缺省为父控件的顶部。
|
||||
*
|
||||
* @return {ret_t} 返回RET_OK表示成功,否则表示失败。
|
||||
*/
|
||||
ret_t draggable_set_top(widget_t* widget, int32_t top);
|
||||
|
||||
/**
|
||||
* @method draggable_set_bottom
|
||||
* 设置bottom。
|
||||
* @annotation ["scriptable"]
|
||||
* @param {widget_t*} widget widget对象。
|
||||
* @param {uint32_t} bottom 拖动范围的底部限制。缺省为父控件的底部。
|
||||
*
|
||||
* @return {ret_t} 返回RET_OK表示成功,否则表示失败。
|
||||
*/
|
||||
ret_t draggable_set_bottom(widget_t* widget, int32_t bottom);
|
||||
|
||||
/**
|
||||
* @method draggable_set_left
|
||||
* 设置left。
|
||||
* @annotation ["scriptable"]
|
||||
* @param {widget_t*} widget widget对象。
|
||||
* @param {uint32_t} left 拖动范围的左边限制。缺省为父控件的左边。
|
||||
*
|
||||
* @return {ret_t} 返回RET_OK表示成功,否则表示失败。
|
||||
*/
|
||||
ret_t draggable_set_left(widget_t* widget, int32_t left);
|
||||
|
||||
/**
|
||||
* @method draggable_set_right
|
||||
* 设置right。
|
||||
* @annotation ["scriptable"]
|
||||
* @param {widget_t*} widget widget对象。
|
||||
* @param {uint32_t} right 拖动范围的右边限制。缺省为父控件的右边边。
|
||||
*
|
||||
* @return {ret_t} 返回RET_OK表示成功,否则表示失败。
|
||||
*/
|
||||
ret_t draggable_set_right(widget_t* widget, int32_t right);
|
||||
|
||||
/**
|
||||
* @method draggable_set_vertical_only
|
||||
* 设置vertical_only。
|
||||
* @annotation ["scriptable"]
|
||||
* @param {widget_t*} widget widget对象。
|
||||
* @param {uint32_t} vertical_only 只允许垂直拖动。
|
||||
*
|
||||
* @return {ret_t} 返回RET_OK表示成功,否则表示失败。
|
||||
*/
|
||||
ret_t draggable_set_vertical_only(widget_t* widget, bool_t vertical_only);
|
||||
|
||||
/**
|
||||
* @method draggable_set_horizontal_only
|
||||
* 设置horizontal_only。
|
||||
* @annotation ["scriptable"]
|
||||
* @param {widget_t*} widget widget对象。
|
||||
* @param {uint32_t} horizontal_only 只允许水平拖动。
|
||||
*
|
||||
* @return {ret_t} 返回RET_OK表示成功,否则表示失败。
|
||||
*/
|
||||
ret_t draggable_set_horizontal_only(widget_t* widget, bool_t horizontal_only);
|
||||
|
||||
/**
|
||||
* @method draggable_set_drag_window
|
||||
* 设置drag_window。
|
||||
* @annotation ["scriptable"]
|
||||
* @param {widget_t*} widget widget对象。
|
||||
* @param {uint32_t} drag_window
|
||||
* 拖动窗口而不是父控件。比如放在对话框的titlebar上,拖动titlebar其实是希望拖动对话框。
|
||||
*
|
||||
* @return {ret_t} 返回RET_OK表示成功,否则表示失败。
|
||||
*/
|
||||
ret_t draggable_set_drag_window(widget_t* widget, bool_t drag_window);
|
||||
|
||||
/**
|
||||
* @method draggable_set_inertia
|
||||
* 设置inertia。
|
||||
* @annotation ["scriptable"]
|
||||
* @param {widget_t*} widget widget对象。
|
||||
* @param {uint32_t} inertia 启用惯性效果。
|
||||
*
|
||||
* @return {ret_t} 返回RET_OK表示成功,否则表示失败。
|
||||
*/
|
||||
ret_t draggable_set_inertia(widget_t* widget, bool_t inertia);
|
||||
|
||||
/**
|
||||
* @method draggable_set_go_or_back
|
||||
* 设置go_or_back。
|
||||
* @annotation ["scriptable"]
|
||||
* @param {widget_t*} widget widget对象。
|
||||
* @param {uint32_t} go_or_back 要么拖动到指定位置,要么返回原来的位置。
|
||||
*
|
||||
* @return {ret_t} 返回RET_OK表示成功,否则表示失败。
|
||||
*/
|
||||
ret_t draggable_set_go_or_back(widget_t* widget, bool_t go_or_back);
|
||||
|
||||
#define DRAGGABLE_PROP_TOP "top"
|
||||
#define DRAGGABLE_PROP_BOTTOM "bottom"
|
||||
#define DRAGGABLE_PROP_LEFT "left"
|
||||
#define DRAGGABLE_PROP_RIGHT "right"
|
||||
#define DRAGGABLE_PROP_VERTICAL_ONLY "vertical_only"
|
||||
#define DRAGGABLE_PROP_HORIZONTAL_ONLY "horizontal_only"
|
||||
#define DRAGGABLE_PROP_DRAG_WINDOW "drag_window"
|
||||
#define DRAGGABLE_PROP_INERTIA "inertia"
|
||||
#define DRAGGABLE_PROP_GO_OR_BACK "go_or_back"
|
||||
|
||||
#define WIDGET_TYPE_DRAGGABLE "draggable"
|
||||
#define DRAGGABLE_UNSPECIFIED_NUM 0x1fffffff
|
||||
|
||||
#define DRAGGABLE(widget) ((draggable_t*)(draggable_cast(WIDGET(widget))))
|
||||
|
||||
ret_t draggable_register(void);
|
||||
|
||||
/*public for subclass and runtime type check*/
|
||||
TK_EXTERN_VTABLE(draggable);
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
#endif /*TK_DRAGGABLE_H*/
|
54
tests/draggable_test.cc
Normal file
54
tests/draggable_test.cc
Normal file
@ -0,0 +1,54 @@
|
||||
#include "widgets/view.h"
|
||||
#include "features/draggable.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
TEST(Draggable, basic) {
|
||||
widget_t* w = view_create(NULL, 10, 20, 30, 40);
|
||||
widget_t* d = draggable_create(w, 0, 0, 0, 0);
|
||||
draggable_t* draggable = DRAGGABLE(d);
|
||||
|
||||
ASSERT_EQ(widget_get_prop_bool(d, DRAGGABLE_PROP_VERTICAL_ONLY, FALSE), FALSE);
|
||||
ASSERT_EQ(widget_get_prop_bool(d, DRAGGABLE_PROP_HORIZONTAL_ONLY, FALSE), FALSE);
|
||||
ASSERT_EQ(widget_get_prop_bool(d, DRAGGABLE_PROP_DRAG_WINDOW, FALSE), FALSE);
|
||||
ASSERT_EQ(widget_get_prop_bool(d, DRAGGABLE_PROP_INERTIA, FALSE), FALSE);
|
||||
ASSERT_EQ(widget_get_prop_bool(d, DRAGGABLE_PROP_GO_OR_BACK, FALSE), FALSE);
|
||||
ASSERT_EQ(widget_get_prop_int(d, DRAGGABLE_PROP_LEFT, 0), DRAGGABLE_UNSPECIFIED_NUM);
|
||||
ASSERT_EQ(widget_get_prop_int(d, DRAGGABLE_PROP_TOP, 0), DRAGGABLE_UNSPECIFIED_NUM);
|
||||
ASSERT_EQ(widget_get_prop_int(d, DRAGGABLE_PROP_RIGHT, 0), DRAGGABLE_UNSPECIFIED_NUM);
|
||||
ASSERT_EQ(widget_get_prop_int(d, DRAGGABLE_PROP_BOTTOM, 0), DRAGGABLE_UNSPECIFIED_NUM);
|
||||
|
||||
ASSERT_EQ(widget_set_prop_bool(d, DRAGGABLE_PROP_VERTICAL_ONLY, TRUE), RET_OK);
|
||||
ASSERT_EQ(widget_set_prop_bool(d, DRAGGABLE_PROP_HORIZONTAL_ONLY, TRUE), RET_OK);
|
||||
ASSERT_EQ(widget_set_prop_bool(d, DRAGGABLE_PROP_DRAG_WINDOW, TRUE), RET_OK);
|
||||
ASSERT_EQ(widget_set_prop_bool(d, DRAGGABLE_PROP_INERTIA, TRUE), RET_OK);
|
||||
ASSERT_EQ(widget_set_prop_bool(d, DRAGGABLE_PROP_GO_OR_BACK, TRUE), RET_OK);
|
||||
|
||||
ASSERT_EQ(widget_set_prop_int(d, DRAGGABLE_PROP_LEFT, 1), RET_OK);
|
||||
ASSERT_EQ(widget_set_prop_int(d, DRAGGABLE_PROP_TOP, 2), RET_OK);
|
||||
ASSERT_EQ(widget_set_prop_int(d, DRAGGABLE_PROP_RIGHT, 3), RET_OK);
|
||||
ASSERT_EQ(widget_set_prop_int(d, DRAGGABLE_PROP_BOTTOM, 4), RET_OK);
|
||||
|
||||
ASSERT_EQ(widget_get_prop_bool(d, DRAGGABLE_PROP_VERTICAL_ONLY, FALSE), TRUE);
|
||||
ASSERT_EQ(widget_get_prop_bool(d, DRAGGABLE_PROP_HORIZONTAL_ONLY, FALSE), TRUE);
|
||||
ASSERT_EQ(widget_get_prop_bool(d, DRAGGABLE_PROP_DRAG_WINDOW, FALSE), TRUE);
|
||||
ASSERT_EQ(widget_get_prop_bool(d, DRAGGABLE_PROP_INERTIA, FALSE), TRUE);
|
||||
ASSERT_EQ(widget_get_prop_bool(d, DRAGGABLE_PROP_GO_OR_BACK, FALSE), TRUE);
|
||||
|
||||
ASSERT_EQ(widget_get_prop_int(d, DRAGGABLE_PROP_LEFT, 0), 1);
|
||||
ASSERT_EQ(widget_get_prop_int(d, DRAGGABLE_PROP_TOP, 0), 2);
|
||||
ASSERT_EQ(widget_get_prop_int(d, DRAGGABLE_PROP_RIGHT, 0), 3);
|
||||
ASSERT_EQ(widget_get_prop_int(d, DRAGGABLE_PROP_BOTTOM, 9), 4);
|
||||
|
||||
ASSERT_EQ(widget_get_prop_bool(d, DRAGGABLE_PROP_VERTICAL_ONLY, FALSE), draggable->vertical_only);
|
||||
ASSERT_EQ(widget_get_prop_bool(d, DRAGGABLE_PROP_HORIZONTAL_ONLY, FALSE), draggable->horizontal_only);
|
||||
ASSERT_EQ(widget_get_prop_bool(d, DRAGGABLE_PROP_DRAG_WINDOW, FALSE), draggable->drag_window);
|
||||
ASSERT_EQ(widget_get_prop_bool(d, DRAGGABLE_PROP_INERTIA, FALSE), draggable->inertia);
|
||||
ASSERT_EQ(widget_get_prop_bool(d, DRAGGABLE_PROP_GO_OR_BACK, FALSE), draggable->inertia);
|
||||
|
||||
ASSERT_EQ(widget_get_prop_int(d, DRAGGABLE_PROP_LEFT, 0), draggable->left);
|
||||
ASSERT_EQ(widget_get_prop_int(d, DRAGGABLE_PROP_TOP, 0), draggable->top);
|
||||
ASSERT_EQ(widget_get_prop_int(d, DRAGGABLE_PROP_RIGHT, 0), draggable->right);
|
||||
ASSERT_EQ(widget_get_prop_int(d, DRAGGABLE_PROP_BOTTOM, 0), draggable->bottom);
|
||||
|
||||
widget_destroy(w);
|
||||
}
|
@ -92,7 +92,7 @@ ret_t ${className}_set_${iter.name}(widget_t* widget, ${iter.type} ${iter.name})
|
||||
const propSetterDecls = this.genPropSetterDecls(json);
|
||||
const propDefines = this.genPropDefines(json);
|
||||
|
||||
let result = `${this.genFileComment(json, '.h')}
|
||||
let result = `${this.genFileComment(json, 'h')}
|
||||
|
||||
#ifndef TK_${uclassName}_H
|
||||
#define TK_${uclassName}_H
|
||||
@ -390,7 +390,7 @@ ret_t ${className}_set_${iter.name}(widget_t* widget, ${iter.type} ${iter.name})
|
||||
}).join('');
|
||||
}
|
||||
|
||||
let result = `${this.genFileComment(json, '.c')}
|
||||
let result = `${this.genFileComment(json, 'c')}
|
||||
|
||||
${defaultInclude}
|
||||
${propSetterImpls}
|
||||
|
65
tools/widget_gen/samples/draggable.json
Normal file
65
tools/widget_gen/samples/draggable.json
Normal file
@ -0,0 +1,65 @@
|
||||
{
|
||||
"name":"draggable",
|
||||
"date":"2019-10-25",
|
||||
"team":"AWTK Develop Team",
|
||||
"author":"Li XianJing <xianjimli@hotmail.com>",
|
||||
"desc":"make parent widget or window draggable",
|
||||
"copyright":"Guangzhou ZHIYUAN Electronics Co.,Ltd.",
|
||||
"includes":[],
|
||||
"props": [
|
||||
{
|
||||
"name":"top",
|
||||
"desc":"拖动范围的顶部限制。缺省为父控件的顶部。",
|
||||
"init_value":-1,
|
||||
"type":"int32_t"
|
||||
},
|
||||
{
|
||||
"name":"bottom",
|
||||
"desc":"拖动范围的底部限制。缺省为父控件的底部。",
|
||||
"init_value":-1,
|
||||
"type":"int32_t"
|
||||
},
|
||||
{
|
||||
"name":"left",
|
||||
"desc":"拖动范围的左边限制。缺省为父控件的左边。",
|
||||
"init_value":-1,
|
||||
"type":"int32_t"
|
||||
},
|
||||
{
|
||||
"name":"right",
|
||||
"desc":"拖动范围的右边限制。缺省为父控件的右边边。",
|
||||
"init_value":-1,
|
||||
"type":"int32_t"
|
||||
},
|
||||
{
|
||||
"name":"vertical_only",
|
||||
"desc":"只允许垂直拖动。",
|
||||
"init_value":"FALSE",
|
||||
"type":"bool_t"
|
||||
},
|
||||
{
|
||||
"name":"horizontall_only",
|
||||
"desc":"只允许水平拖动。",
|
||||
"init_value":"FALSE",
|
||||
"type":"bool_t"
|
||||
},
|
||||
{
|
||||
"name":"drag_window",
|
||||
"desc":"拖动窗口而不是父控件。比如放在对话框的titlebar上,拖动titlebar其实是希望拖动对话框。",
|
||||
"init_value":"FALSE",
|
||||
"type":"bool_t"
|
||||
},
|
||||
{
|
||||
"name":"inertia",
|
||||
"desc":"启用惯性效果。",
|
||||
"init_value":"FALSE",
|
||||
"type":"bool_t"
|
||||
},
|
||||
{
|
||||
"name":"go_or_back",
|
||||
"desc":"要么拖动到指定位置,要么返回原来的位置。",
|
||||
"init_value":"FALSE",
|
||||
"type":"bool_t"
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user