1 /* This is a small demo of the high-performance GUIX graphics framework. */
2
3
4 #include <stdio.h>
5 #include "tx_api.h"
6 #include "gx_api.h"
7 #include "gx_validation_utility.h"
8
9 TEST_PARAM test_parameter = {
10 "guix_menu_text_alignment", /* Test name */
11 4, 4,633, 473 /* Define the coordinates of the capture area.
12 In this test, we only need to capture the pixelmap
13 drawing area. */
14 };
15
16 static VOID control_thread_entry(ULONG);
main(int argc,char ** argv)17 int main(int argc, char ** argv)
18 {
19 /* Parse the command line argument. */
20 gx_validation_setup(argc, argv);
21
22 /* Start ThreadX system */
23 tx_kernel_enter();
24 return(0);
25 }
26
tx_application_define(void * first_unused_memory)27 VOID tx_application_define(void *first_unused_memory)
28 {
29
30 /* Create a dedicated thread to perform various operations
31 on the pixelmap drawing example. These operations simulate
32 user input. */
33 gx_validation_control_thread_create(control_thread_entry);
34
35 /* Termiante the test if it runs for more than 100 ticks */
36 /* This function is not implemented yet. */
37 gx_validation_watchdog_create(100);
38
39 /* Call the actual line example routine. */
40 gx_validation_application_define(first_unused_memory);
41
42 }
43
44
45 /* Replace the default graphics driver with the validation driver. */
46 #ifdef win32_graphics_driver_setup_24xrgb
47 #undef win32_graphics_driver_setup_24xrgb
48 #endif
49 #define win32_graphics_driver_setup_24xrgb gx_validation_graphics_driver_setup_24xrgb
50
51
52 #ifdef WIN32
53 #undef WIN32
54 #endif
55
56 #include "gx_validation_wrapper.h"
57
58 #include "demo_guix_all_widgets.c"
59
60
61 char test_comment[256];
62
63 /* This thread simulates user input. Its priority is lower
64 than the GUIX thread, so that GUIX finishes an operation
65 before this thread is able to issue the next command. */
control_thread_entry(ULONG input)66 static VOID control_thread_entry(ULONG input)
67 {
68 int frame_id = 1;
69 GX_MENU *menu;
70
71 ToggleScreen(&menu_screen, pButtonScreen);
72
73 /* Set tree view menu 1 text right aligned. */
74 gx_widget_style_remove(&menu_screen.menu_screen_tree_menu_1, GX_STYLE_TEXT_ALIGNMENT_MASK);
75 gx_widget_style_add(&menu_screen.menu_screen_tree_menu_1, GX_STYLE_TEXT_RIGHT);
76 gx_menu_text_offset_set(&menu_screen.menu_screen_tree_menu_1, 0, 0);
77
78 /* set tree view menu 2 text center aligned. */
79 gx_widget_style_remove(&menu_screen.menu_screen_tree_menu_2, GX_STYLE_TEXT_ALIGNMENT_MASK);
80 gx_widget_style_add(&menu_screen.menu_screen_tree_menu_2, GX_STYLE_TEXT_CENTER);
81 gx_menu_text_offset_set(&menu_screen.menu_screen_tree_menu_2, 11, 0);
82
83 gx_validation_set_frame_id(frame_id++);
84 gx_validation_set_frame_comment("Test menu text alignment");
85
86 /* Force a screen refresh. */
87 gx_validation_screen_refresh();
88
89 /* Signal the end of the test case. Verify the output. */
90 gx_validation_end();
91
92 exit(0);
93 }
94
95
96
97
98
99