diff --git a/common/src/gx_single_line_text_input_event_process.c b/common/src/gx_single_line_text_input_event_process.c index c2ff2829..90070003 100644 --- a/common/src/gx_single_line_text_input_event_process.c +++ b/common/src/gx_single_line_text_input_event_process.c @@ -238,7 +238,7 @@ GX_VALUE click_x; /* FUNCTION RELEASE */ /* */ /* _gx_single_line_text_input_event_process PORTABLE C */ -/* 6.1.3 */ +/* 6.x */ /* AUTHOR */ /* */ /* Kenneth Maxwell, Microsoft Corporation */ @@ -294,6 +294,11 @@ GX_VALUE click_x; /* added logic to release */ /* dynamic input buffer, */ /* resulting in version 6.1.3 */ +/* xx-xx-xxxx Ting Zhu Modified comment(s), */ +/* modified to always call */ +/* default widget event */ +/* process on a pen up event, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _gx_single_line_text_input_event_process(GX_SINGLE_LINE_TEXT_INPUT *text_input, GX_EVENT *event_ptr) @@ -390,10 +395,8 @@ ULONG old_style; text_input -> gx_widget_status &= ~(GX_STATUS_MARK_NEXT | GX_STATUS_MARK_PREVIOUS); } } - else - { - _gx_widget_event_process(widget, event_ptr); - } + + _gx_widget_event_process(widget, event_ptr); break; case GX_EVENT_TIMER: diff --git a/test/example_internal/sl_text_input_16bpp/demo_guix_sl_text_input_16bpp.c b/test/example_internal/sl_text_input_16bpp/demo_guix_sl_text_input_16bpp.c index 66341b3e..6a9c025b 100644 --- a/test/example_internal/sl_text_input_16bpp/demo_guix_sl_text_input_16bpp.c +++ b/test/example_internal/sl_text_input_16bpp/demo_guix_sl_text_input_16bpp.c @@ -92,6 +92,7 @@ VOID demo_thread_entry(ULONG thread_input) /* Create the button screen */ gx_studio_named_widget_create("window", (GX_WIDGET *) root, (GX_WIDGET **) &pMainScreen); + gx_studio_named_widget_create("input_focus_release_test", GX_NULL, GX_NULL); /* Show the root window to make it and patients screen visible. */ gx_widget_show(root); diff --git a/test/example_internal/sl_text_input_16bpp/sl_text_input_16bpp.gxp b/test/example_internal/sl_text_input_16bpp/sl_text_input_16bpp.gxp index 26546466..ce753919 100644 --- a/test/example_internal/sl_text_input_16bpp/sl_text_input_16bpp.gxp +++ b/test/example_internal/sl_text_input_16bpp/sl_text_input_16bpp.gxp @@ -2,9 +2,9 @@
-55 +56 60103 -6010603 +6030001 sl_text_input_16bpp .\ .\ @@ -18,6 +18,7 @@ 0 FALSE FALSE +FALSE 10 10 FALSE @@ -68,7 +69,7 @@ FALSE TRUE TRUE -0 +None FALSE 1 @@ -89,7 +90,7 @@ FALSE TRUE FALSE -4096 +THEME_HEADER GROUP @@ -100,7 +101,7 @@ FALSE TRUE FALSE -4096 +COLOR_GROUP FOLDER Defaults @@ -110,7 +111,7 @@ FALSE TRUE FALSE -4096 +DEFAULT_COLOR_FOLDER COLOR CANVAS @@ -440,7 +441,7 @@ FALSE TRUE FALSE -4097 +CUSTOM_COLOR_FOLDER Add New Color @@ -461,7 +462,7 @@ FALSE TRUE FALSE -4097 +FONT_GROUP FOLDER Defaults @@ -471,7 +472,7 @@ FALSE TRUE FALSE -4098 +DEFAULT_FONT_FOLDER FONT SYSTEM @@ -487,6 +488,7 @@ FALSE FALSE FALSE +FALSE TRUE 32 @@ -643,6 +645,7 @@ FALSE FALSE FALSE +FALSE TRUE 32 @@ -799,6 +802,7 @@ FALSE FALSE FALSE +FALSE TRUE 32 @@ -956,6 +960,7 @@ TRUE FALSE FALSE +FALSE TRUE 32 @@ -1107,7 +1112,7 @@ FALSE TRUE FALSE -4099 +CUSTOM_FONT_FOLDER Add New Font @@ -1133,6 +1138,7 @@ FALSE FALSE FALSE +FALSE TRUE 32 @@ -1290,6 +1296,7 @@ FALSE FALSE FALSE +FALSE TRUE 32 @@ -1447,6 +1454,7 @@ FALSE FALSE FALSE +FALSE TRUE 32 @@ -1604,6 +1612,7 @@ FALSE FALSE FALSE +FALSE TRUE 32 @@ -1761,6 +1770,7 @@ FALSE FALSE FALSE +FALSE TRUE 32 @@ -1918,6 +1928,7 @@ FALSE FALSE FALSE +FALSE TRUE 32 @@ -2076,6 +2087,7 @@ FALSE FALSE font_CHINESE_18PIX.c +FALSE TRUE 32 @@ -2234,6 +2246,7 @@ FALSE FALSE font_CHINESE_24PIX.c +FALSE TRUE 32 @@ -2386,7 +2399,7 @@ FALSE TRUE FALSE -4098 +PIXELMAP_GROUP FOLDER System @@ -2396,7 +2409,7 @@ FALSE TRUE FALSE -4100 +DEFAULT_PIXELMAP_FOLDER PIXELMAP RADIO_ON @@ -2410,8 +2423,8 @@ TRUE FALSE FALSE -0 FALSE +FALSE None @@ -2427,8 +2440,8 @@ TRUE FALSE FALSE -0 FALSE +FALSE None @@ -2444,8 +2457,8 @@ FALSE FALSE FALSE -0 FALSE +FALSE None @@ -2461,8 +2474,8 @@ FALSE FALSE FALSE -0 FALSE +FALSE None @@ -2475,7 +2488,7 @@ FALSE TRUE FALSE -4101 +CUSTOM_PIXELMAP_FOLDER Add New Pixelmap @@ -2496,7 +2509,7 @@ FALSE TRUE FALSE -4099 +STRING_GROUP Add New String @@ -2719,6 +2732,69 @@ default_folder window +input_focus_release_test + +0 +0 +639 +479 + + +0 +TRUE +WINDOW_FILL +WINDOW_FILL +DISABLED_FILL + +FALSE + +button +button + +184 +158 +475 +300 + + +0 +TRUE +BTN_LOWER +BTN_UPPER +DISABLED_FILL + +FALSE + +text_input +text_input + +239 +200 +402 +263 + + +0 +TRUE +CANVAS +SELECTED_FILL +DISABLED_FILL + +FALSE +STRING_1 +TEXT_INPUT +TEXT_INPUT_TEXT +SELECTED_TEXT +DISABLED_TEXT +READONLY_FILL +READONLY_TEXT +100 +FALSE + + + + +window window 5 @@ -3464,7 +3540,7 @@ FALSE TRUE FALSE -0 +None FALSE 1 @@ -3485,7 +3561,7 @@ FALSE TRUE FALSE -4096 +THEME_HEADER GROUP @@ -3496,7 +3572,7 @@ FALSE TRUE FALSE -4096 +COLOR_GROUP FOLDER Defaults @@ -3506,7 +3582,7 @@ FALSE TRUE FALSE -4096 +DEFAULT_COLOR_FOLDER COLOR CANVAS @@ -3836,7 +3912,7 @@ FALSE TRUE FALSE -4097 +CUSTOM_COLOR_FOLDER Add New Color @@ -3857,7 +3933,7 @@ FALSE TRUE FALSE -4097 +FONT_GROUP FOLDER Defaults @@ -3867,7 +3943,7 @@ FALSE TRUE FALSE -4098 +DEFAULT_FONT_FOLDER FONT SYSTEM @@ -3883,6 +3959,7 @@ FALSE FALSE FALSE +FALSE TRUE 32 @@ -4039,6 +4116,7 @@ FALSE FALSE FALSE +FALSE TRUE 32 @@ -4195,6 +4273,7 @@ FALSE FALSE FALSE +FALSE TRUE 32 @@ -4351,6 +4430,7 @@ FALSE FALSE FALSE +FALSE TRUE 32 @@ -4502,7 +4582,7 @@ FALSE TRUE FALSE -4099 +CUSTOM_FONT_FOLDER Add New Font @@ -4523,7 +4603,7 @@ FALSE TRUE FALSE -4098 +PIXELMAP_GROUP FOLDER System @@ -4533,7 +4613,7 @@ FALSE TRUE FALSE -4100 +DEFAULT_PIXELMAP_FOLDER PIXELMAP RADIO_ON @@ -4547,8 +4627,8 @@ TRUE FALSE FALSE -0 FALSE +FALSE None @@ -4564,8 +4644,8 @@ TRUE FALSE FALSE -0 FALSE +FALSE None @@ -4581,8 +4661,8 @@ FALSE FALSE FALSE -0 FALSE +FALSE None @@ -4598,8 +4678,8 @@ FALSE FALSE FALSE -0 FALSE +FALSE None @@ -4612,7 +4692,7 @@ FALSE TRUE FALSE -4101 +CUSTOM_PIXELMAP_FOLDER Add New Pixelmap @@ -4633,7 +4713,7 @@ FALSE TRUE FALSE -4099 +STRING_GROUP Add New String @@ -4688,7 +4768,7 @@ FALSE TRUE FALSE -0 +None FALSE 1 @@ -4709,7 +4789,7 @@ FALSE TRUE FALSE -4096 +THEME_HEADER GROUP @@ -4720,7 +4800,7 @@ FALSE TRUE FALSE -4096 +COLOR_GROUP FOLDER Defaults @@ -4730,7 +4810,7 @@ FALSE TRUE FALSE -4096 +DEFAULT_COLOR_FOLDER COLOR CANVAS @@ -5060,7 +5140,7 @@ FALSE TRUE FALSE -4097 +CUSTOM_COLOR_FOLDER Add New Color @@ -5081,7 +5161,7 @@ FALSE TRUE FALSE -4097 +FONT_GROUP FOLDER Defaults @@ -5091,7 +5171,7 @@ FALSE TRUE FALSE -4098 +DEFAULT_FONT_FOLDER FONT SYSTEM @@ -5107,6 +5187,7 @@ FALSE FALSE FALSE +FALSE TRUE 32 @@ -5263,6 +5344,7 @@ FALSE FALSE FALSE +FALSE TRUE 32 @@ -5419,6 +5501,7 @@ FALSE FALSE FALSE +FALSE TRUE 32 @@ -5575,6 +5658,7 @@ FALSE FALSE FALSE +FALSE TRUE 32 @@ -5726,7 +5810,7 @@ FALSE TRUE FALSE -4099 +CUSTOM_FONT_FOLDER Add New Font @@ -5747,7 +5831,7 @@ FALSE TRUE FALSE -4098 +PIXELMAP_GROUP FOLDER System @@ -5757,7 +5841,7 @@ FALSE TRUE FALSE -4100 +DEFAULT_PIXELMAP_FOLDER PIXELMAP RADIO_ON @@ -5771,8 +5855,8 @@ TRUE FALSE FALSE -0 FALSE +FALSE None @@ -5788,8 +5872,8 @@ TRUE FALSE FALSE -0 FALSE +FALSE None @@ -5805,8 +5889,8 @@ FALSE FALSE FALSE -0 FALSE +FALSE None @@ -5822,8 +5906,8 @@ FALSE FALSE FALSE -0 FALSE +FALSE None @@ -5836,7 +5920,7 @@ FALSE TRUE FALSE -4101 +CUSTOM_PIXELMAP_FOLDER Add New Pixelmap @@ -5857,7 +5941,7 @@ FALSE TRUE FALSE -4099 +STRING_GROUP Add New String @@ -5912,7 +5996,7 @@ FALSE TRUE FALSE -0 +None FALSE 1 @@ -5933,7 +6017,7 @@ FALSE TRUE FALSE -4096 +THEME_HEADER GROUP @@ -5944,7 +6028,7 @@ FALSE TRUE FALSE -4096 +COLOR_GROUP FOLDER Defaults @@ -5954,7 +6038,7 @@ FALSE TRUE FALSE -4096 +DEFAULT_COLOR_FOLDER COLOR CANVAS @@ -6284,7 +6368,7 @@ FALSE TRUE FALSE -4097 +CUSTOM_COLOR_FOLDER Add New Color @@ -6305,7 +6389,7 @@ FALSE TRUE FALSE -4097 +FONT_GROUP FOLDER Defaults @@ -6315,7 +6399,7 @@ FALSE TRUE FALSE -4098 +DEFAULT_FONT_FOLDER FONT SYSTEM @@ -6331,6 +6415,7 @@ FALSE FALSE FALSE +FALSE TRUE 32 @@ -6487,6 +6572,7 @@ FALSE FALSE FALSE +FALSE TRUE 32 @@ -6643,6 +6729,7 @@ FALSE FALSE FALSE +FALSE TRUE 32 @@ -6799,6 +6886,7 @@ FALSE FALSE FALSE +FALSE TRUE 32 @@ -6950,7 +7038,7 @@ FALSE TRUE FALSE -4099 +CUSTOM_FONT_FOLDER Add New Font @@ -6971,7 +7059,7 @@ FALSE TRUE FALSE -4098 +PIXELMAP_GROUP FOLDER System @@ -6981,7 +7069,7 @@ FALSE TRUE FALSE -4100 +DEFAULT_PIXELMAP_FOLDER PIXELMAP RADIO_ON @@ -6995,8 +7083,8 @@ TRUE FALSE FALSE -0 FALSE +FALSE None @@ -7012,8 +7100,8 @@ TRUE FALSE FALSE -0 FALSE +FALSE None @@ -7029,8 +7117,8 @@ FALSE FALSE FALSE -0 FALSE +FALSE None @@ -7046,8 +7134,8 @@ FALSE FALSE FALSE -0 FALSE +FALSE None @@ -7060,7 +7148,7 @@ FALSE TRUE FALSE -4101 +CUSTOM_PIXELMAP_FOLDER Add New Pixelmap @@ -7081,7 +7169,7 @@ FALSE TRUE FALSE -4099 +STRING_GROUP Add New String diff --git a/test/example_internal/sl_text_input_16bpp/sl_text_input_16bpp_resources.c b/test/example_internal/sl_text_input_16bpp/sl_text_input_16bpp_resources.c index 2fae5f57..f9ebd861 100644 --- a/test/example_internal/sl_text_input_16bpp/sl_text_input_16bpp_resources.c +++ b/test/example_internal/sl_text_input_16bpp/sl_text_input_16bpp_resources.c @@ -5,8 +5,8 @@ /* resource file(s). For more information please refer to the Azure RTOS GUIX */ /* Studio User Guide, or visit our web site at azure.com/rtos */ /* */ -/* GUIX Studio Revision 6.2.1.2 */ -/* Date (dd.mm.yyyy): 5. 6.2023 Time (hh:mm): 15:13 */ +/* GUIX Studio Revision 6.3.0.1 */ +/* Date (dd.mm.yyyy): 14.12.2023 Time (hh:mm): 11:25 */ /*******************************************************************************/ diff --git a/test/example_internal/sl_text_input_16bpp/sl_text_input_16bpp_resources.h b/test/example_internal/sl_text_input_16bpp/sl_text_input_16bpp_resources.h index a7df4df6..40d53d1c 100644 --- a/test/example_internal/sl_text_input_16bpp/sl_text_input_16bpp_resources.h +++ b/test/example_internal/sl_text_input_16bpp/sl_text_input_16bpp_resources.h @@ -5,8 +5,8 @@ /* resource file(s). For more information please refer to the Azure RTOS GUIX */ /* Studio User Guide, or visit our web site at azure.com/rtos */ /* */ -/* GUIX Studio Revision 6.1.12.0 */ -/* Date (dd.mm.yyyy): 25. 8.2022 Time (hh:mm): 18:42 */ +/* GUIX Studio Revision 6.3.0.1 */ +/* Date (dd.mm.yyyy): 14.12.2023 Time (hh:mm): 11:25 */ /*******************************************************************************/ diff --git a/test/example_internal/sl_text_input_16bpp/sl_text_input_16bpp_specifications.c b/test/example_internal/sl_text_input_16bpp/sl_text_input_16bpp_specifications.c index d483f13b..185d5311 100644 --- a/test/example_internal/sl_text_input_16bpp/sl_text_input_16bpp_specifications.c +++ b/test/example_internal/sl_text_input_16bpp/sl_text_input_16bpp_specifications.c @@ -5,8 +5,8 @@ /* specification file(s). For more information please refer to the Azure RTOS */ /* GUIX Studio User Guide, or visit our web site at azure.com/rtos */ /* */ -/* GUIX Studio Revision 6.2.0.1 */ -/* Date (dd.mm.yyyy): 31.10.2022 Time (hh:mm): 14:11 */ +/* GUIX Studio Revision 6.3.0.1 */ +/* Date (dd.mm.yyyy): 14.12.2023 Time (hh:mm): 11:25 */ /*******************************************************************************/ @@ -16,6 +16,7 @@ #include "sl_text_input_16bpp_specifications.h" static GX_WIDGET *gx_studio_nested_widget_create(GX_BYTE *control, GX_CONST GX_STUDIO_WIDGET *definition, GX_WIDGET *parent); +INPUT_FOCUS_RELEASE_TEST_CONTROL_BLOCK input_focus_release_test; WINDOW_CONTROL_BLOCK window; GX_DISPLAY display_1_control_block; GX_WINDOW_ROOT display_1_root_window; @@ -47,6 +48,14 @@ GX_STUDIO_DISPLAY_INFO sl_text_input_16bpp_display_table[1] = }; +UINT gx_studio_button_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent) +{ + UINT status; + GX_BUTTON *button = (GX_BUTTON *) control_block; + status = gx_button_create(button, info->widget_name, parent, info->style, info->widget_id, &info->size); + return status; +} + UINT gx_studio_checkbox_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent) { UINT status; @@ -170,6 +179,95 @@ UINT gx_studio_text_input_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *con } return status; } +GX_WINDOW_PROPERTIES input_focus_release_test_properties = +{ + 0 /* wallpaper pixelmap id */ +}; +GX_CHAR input_focus_release_test_text_input_buffer[100]; +GX_SINGLE_LINE_TEXT_INPUT_PROPERTIES input_focus_release_test_text_input_properties = +{ + GX_STRING_ID_STRING_1, /* string id */ + GX_FONT_ID_TEXT_INPUT, /* font id */ + GX_COLOR_ID_TEXT_INPUT_TEXT, /* normal text color */ + GX_COLOR_ID_SELECTED_TEXT, /* selected text color */ + GX_COLOR_ID_DISABLED_TEXT, /* disabled text color */ + GX_COLOR_ID_READONLY_FILL, /* readonly fill color */ + GX_COLOR_ID_READONLY_TEXT, /* readonly text color */ + input_focus_release_test_text_input_buffer, /* buffer */ + 100, /* buffer size */ +}; + +GX_CONST GX_STUDIO_WIDGET input_focus_release_test_text_input_define = +{ + "text_input", + GX_TYPE_SINGLE_LINE_TEXT_INPUT, /* widget type */ + GX_ID_NONE, /* widget id */ + #if defined(GX_WIDGET_USER_DATA) + 0, /* user data */ + #endif + GX_STYLE_BORDER_RECESSED|GX_STYLE_ENABLED|GX_STYLE_TEXT_LEFT, /* style flags */ + GX_STATUS_ACCEPTS_FOCUS, /* status flags */ + sizeof(GX_SINGLE_LINE_TEXT_INPUT), /* control block size */ + GX_COLOR_ID_CANVAS, /* normal color id */ + GX_COLOR_ID_SELECTED_FILL, /* selected color id */ + GX_COLOR_ID_DISABLED_FILL, /* disabled color id */ + gx_studio_text_input_create, /* create function */ + GX_NULL, /* drawing function override */ + GX_NULL, /* event function override */ + {239, 200, 402, 263}, /* widget size */ + GX_NULL, /* no next widget */ + GX_NULL, /* no child widgets */ + offsetof(INPUT_FOCUS_RELEASE_TEST_CONTROL_BLOCK, input_focus_release_test_text_input), /* control block */ + (void *) &input_focus_release_test_text_input_properties /* extended properties */ +}; + +GX_CONST GX_STUDIO_WIDGET input_focus_release_test_button_define = +{ + "button", + GX_TYPE_BUTTON, /* widget type */ + GX_ID_NONE, /* widget id */ + #if defined(GX_WIDGET_USER_DATA) + 0, /* user data */ + #endif + GX_STYLE_BORDER_RAISED|GX_STYLE_ENABLED, /* style flags */ + GX_STATUS_ACCEPTS_FOCUS, /* status flags */ + sizeof(GX_BUTTON), /* control block size */ + GX_COLOR_ID_BTN_LOWER, /* normal color id */ + GX_COLOR_ID_BTN_UPPER, /* selected color id */ + GX_COLOR_ID_DISABLED_FILL, /* disabled color id */ + gx_studio_button_create, /* create function */ + GX_NULL, /* drawing function override */ + GX_NULL, /* event function override */ + {184, 158, 475, 300}, /* widget size */ + GX_NULL, /* no next widget */ + &input_focus_release_test_text_input_define, /* child widget definition */ + offsetof(INPUT_FOCUS_RELEASE_TEST_CONTROL_BLOCK, input_focus_release_test_button), /* control block */ + (void *) GX_NULL /* no extended properties */ +}; + +GX_CONST GX_STUDIO_WIDGET input_focus_release_test_define = +{ + "input_focus_release_test", + GX_TYPE_WINDOW, /* widget type */ + GX_ID_NONE, /* widget id */ + #if defined(GX_WIDGET_USER_DATA) + 0, /* user data */ + #endif + GX_STYLE_BORDER_THIN|GX_STYLE_ENABLED, /* style flags */ + GX_STATUS_ACCEPTS_FOCUS, /* status flags */ + sizeof(INPUT_FOCUS_RELEASE_TEST_CONTROL_BLOCK), /* control block size */ + GX_COLOR_ID_WINDOW_FILL, /* normal color id */ + GX_COLOR_ID_WINDOW_FILL, /* selected color id */ + GX_COLOR_ID_DISABLED_FILL, /* disabled color id */ + gx_studio_window_create, /* create function */ + GX_NULL, /* drawing function override */ + GX_NULL, /* event function override */ + {0, 0, 639, 479}, /* widget size */ + GX_NULL, /* next widget */ + &input_focus_release_test_button_define, /* child widget */ + 0, /* control block */ + (void *) &input_focus_release_test_properties /* extended properties */ +}; GX_WINDOW_PROPERTIES window_properties = { 0 /* wallpaper pixelmap id */ @@ -1195,6 +1293,7 @@ GX_CONST GX_STUDIO_WIDGET window_define = }; GX_CONST GX_STUDIO_WIDGET_ENTRY sl_text_input_16bpp_widget_table[] = { + { &input_focus_release_test_define, (GX_WIDGET *) &input_focus_release_test }, { &window_define, (GX_WIDGET *) &window }, {GX_NULL, GX_NULL} }; diff --git a/test/example_internal/sl_text_input_16bpp/sl_text_input_16bpp_specifications.h b/test/example_internal/sl_text_input_16bpp/sl_text_input_16bpp_specifications.h index 1ac6edde..d49c235e 100644 --- a/test/example_internal/sl_text_input_16bpp/sl_text_input_16bpp_specifications.h +++ b/test/example_internal/sl_text_input_16bpp/sl_text_input_16bpp_specifications.h @@ -5,8 +5,8 @@ /* specification file(s). For more information please refer to the Azure RTOS */ /* GUIX Studio User Guide, or visit our web site at azure.com/rtos */ /* */ -/* GUIX Studio Revision 6.2.0.1 */ -/* Date (dd.mm.yyyy): 31.10.2022 Time (hh:mm): 14:11 */ +/* GUIX Studio Revision 6.3.0.1 */ +/* Date (dd.mm.yyyy): 14.12.2023 Time (hh:mm): 11:25 */ /*******************************************************************************/ @@ -140,6 +140,13 @@ typedef struct /* Declare top-level control blocks */ +typedef struct INPUT_FOCUS_RELEASE_TEST_CONTROL_BLOCK_STRUCT +{ + GX_WINDOW_MEMBERS_DECLARE + GX_BUTTON input_focus_release_test_button; + GX_SINGLE_LINE_TEXT_INPUT input_focus_release_test_text_input; +} INPUT_FOCUS_RELEASE_TEST_CONTROL_BLOCK; + typedef struct WINDOW_CONTROL_BLOCK_STRUCT { GX_WINDOW_MEMBERS_DECLARE @@ -178,6 +185,7 @@ typedef struct WINDOW_CONTROL_BLOCK_STRUCT /* extern statically defined control blocks */ #ifndef GUIX_STUDIO_GENERATED_FILE +extern INPUT_FOCUS_RELEASE_TEST_CONTROL_BLOCK input_focus_release_test; extern WINDOW_CONTROL_BLOCK window; #endif @@ -211,6 +219,7 @@ typedef struct GX_STUDIO_DISPLAY_INFO_STRUCT /* Declare Studio-generated functions for creating top-level widgets */ +UINT gx_studio_button_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent); UINT gx_studio_checkbox_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent); UINT gx_studio_radio_button_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent); UINT gx_studio_prompt_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent); diff --git a/test/guix_test/cmake/regression/CMakeLists.txt b/test/guix_test/cmake/regression/CMakeLists.txt index 200ac610..fa779550 100644 --- a/test/guix_test/cmake/regression/CMakeLists.txt +++ b/test/guix_test/cmake/regression/CMakeLists.txt @@ -1669,7 +1669,8 @@ set(sl_text_input_16bpp_REG_TESTS guix_sl_input_left_arrow guix_sl_input_mark_home guix_sl_input_style_remove - guix_sl_input_text_select) + guix_sl_input_text_select + guix_sl_input_input_focus_release) set(sl_text_clip_8bpp_FILE_LIST demo_guix_single_line_text_input_clip_8bpp.c sl_text_clip_8bpp_resources.c diff --git a/test/guix_test/golden_files/guix_sl_input_input_focus_release.7z b/test/guix_test/golden_files/guix_sl_input_input_focus_release.7z new file mode 100644 index 00000000..186c5b24 Binary files /dev/null and b/test/guix_test/golden_files/guix_sl_input_input_focus_release.7z differ diff --git a/test/guix_test/golden_files/guix_sl_input_input_focus_release.checksum b/test/guix_test/golden_files/guix_sl_input_input_focus_release.checksum new file mode 100644 index 00000000..0ea5e806 Binary files /dev/null and b/test/guix_test/golden_files/guix_sl_input_input_focus_release.checksum differ diff --git a/test/guix_test/regression_test/tests/validation_guix_sl_input_input_focus_release.c b/test/guix_test/regression_test/tests/validation_guix_sl_input_input_focus_release.c new file mode 100644 index 00000000..b0da8ba0 --- /dev/null +++ b/test/guix_test/regression_test/tests/validation_guix_sl_input_input_focus_release.c @@ -0,0 +1,93 @@ +/* This is a small demo of the high-performance GUIX graphics framework. */ + +#include +#include "tx_api.h" +#include "gx_api.h" +#include "gx_validation_utility.h" +#include "gx_system.h" + +TEST_PARAM test_parameter = { + "guix_sl_input_input_focus_release", /* Test name */ + 0, 0, 640, 480 /* Define the coordinates of the capture area. + In this test, we only need to capture the pixelmap + drawing area. */ +}; + +static VOID control_thread_entry(ULONG); +int main(int argc, char ** argv) +{ + /* Parse the command line argument. */ + gx_validation_setup(argc, argv); + + /* Start ThreadX system */ + tx_kernel_enter(); + return(0); +} + +VOID tx_application_define(void *first_unused_memory) +{ + + /* Create a dedicated thread to perform various operations + on the line drawing example. These operations simulate + user input. */ + gx_validation_control_thread_create(control_thread_entry); + + /* Termiante the test if it runs for more than 100 ticks */ + /* This function is not implemented yet. */ + gx_validation_watchdog_create(100); + + /* Call the actual line example routine. */ + gx_validation_application_define(first_unused_memory); + +} + + +/* Replace the default graphics driver with the validation driver. */ +#ifdef win32_graphics_driver_setup_565rgb +#undef win32_graphics_driver_setup_565rgb +#endif +#define win32_graphics_driver_setup_565rgb gx_validation_graphics_driver_setup_565rgb + + +#ifdef WIN32 +#undef WIN32 +#endif + +#include "gx_validation_wrapper.h" +#include "demo_guix_sl_text_input_16bpp.c" + +/* This thread simulates user input. Its priority is lower + than the GUIX thread, so that GUIX finishes an operation + before this thread is able to issue the next command. */ +static VOID control_thread_entry(ULONG input) +{ +GX_SINGLE_LINE_TEXT_INPUT *text_input; +INT frame_id = 1; +GX_EVENT event; + + gx_widget_detach(pMainScreen); + gx_widget_attach(root, &input_focus_release_test); + text_input = &input_focus_release_test.input_focus_release_test_text_input; + + /* Remove cursor blink style. */ + gx_single_line_text_input_style_remove(text_input, GX_STYLE_CURSOR_BLINK); + + memset(&event, 0, sizeof(GX_EVENT)); + event.gx_event_type = GX_EVENT_PEN_DOWN; + event.gx_event_target = (GX_WIDGET *)text_input; + + gx_validation_set_frame_id(frame_id++); + gx_validation_set_frame_comment("Pen down on text input"); + gx_system_event_send(&event); + + gx_validation_set_frame_id(frame_id++); + gx_validation_set_frame_comment("Pen up on text input"); + event.gx_event_type = GX_EVENT_PEN_UP; + gx_system_event_send(&event); + + + /* Signal the end of the test case. Verify the output. */ + gx_validation_end(); + + exit(0); +}