|
本帖最后由 hpdell 于 2024-4-26 16:42 编辑
请教下,guix 里面的 vertical_list 这个控件,横向增加 2个 prompt 控件失败 ?
demo_guix_vertical_list.7z
(4.09 KB, 下载次数: 0)
参考例程: ..\guix-6.4.0_rel\tutorials\demo_guix_vertical_list
#define LIST_ROW_HEIGHT 36
void vertical_list_row_create(GX_VERTICAL_LIST *list, GX_WIDGET *widget, INT index)
{
GX_BOOL is_created;
GX_BOOL is_created_2;
GX_RECTANGLE size;
LIST_ROW *row = (LIST_ROW *)widget;
GX_RESOURCE_ID bkgnd_color;
GX_STRING string;
if (index & 1)
{
bkgnd_color = GX_COLOR_ID_WINDOW_FILL;
}
else
{
bkgnd_color = GX_COLOR_ID_ODD_ROW;
}
/* Test if the widget have already been created. */
gx_widget_created_test(&row->prompt, &is_created);
if (!is_created)
{
// size.gx_rectangle_top = size.gx_rectangle_left = size.gx_rectangle_right = 0;
// size.gx_rectangle_bottom = size.gx_rectangle_top + LIST_ROW_HEIGHT - 1;
size.gx_rectangle_top = 0;
size.gx_rectangle_bottom = size.gx_rectangle_top + LIST_ROW_HEIGHT - 1;
size.gx_rectangle_left = 0;
size.gx_rectangle_right = 180 - 1;
gx_prompt_create(&row->prompt, GX_NULL, list, 0, GX_STYLE_ENABLED, 0, &size);
// ---------------------------------------------------------------------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------------------------------------------------------------------
size.gx_rectangle_top = 0;
size.gx_rectangle_bottom = size.gx_rectangle_top + LIST_ROW_HEIGHT - 1;
size.gx_rectangle_left = 182;
size.gx_rectangle_right = 260-20-180 - 1-2;
gx_prompt_create(&row->name, GX_NULL, list, 1, GX_STYLE_ENABLED, 1, &size);
}
/* Initiate row text. */
gx_utility_ltoa(index, row->text, LIST_ROW_TEXT_BUFFER_SIZE);
/* Set row text to prompt. */
string.gx_string_ptr = row->text;
string.gx_string_length = string_length_get(row->text, LIST_ROW_TEXT_BUFFER_SIZE - 1);
gx_prompt_text_set_ext(&row->prompt, &string);
gx_prompt_text_set_ext(&row->name, &string);
/* Set text color. */
gx_prompt_text_color_set(&row->prompt, GX_COLOR_ID_OFF_WHITE, GX_COLOR_ID_BLACK, GX_COLOR_ID_OFF_WHITE);
gx_prompt_text_color_set(&row->name, GX_COLOR_ID_OFF_WHITE, GX_COLOR_ID_BLACK, GX_COLOR_ID_OFF_WHITE);
/* Set fill color. */
gx_widget_fill_color_set(&row->prompt, bkgnd_color, GX_COLOR_ID_GREEN, bkgnd_color);
gx_widget_fill_color_set(&row->name, bkgnd_color, GX_COLOR_ID_GREEN, bkgnd_color);
}
上面的驱动仿真效果图(这个不是我需要的):
------------------------------------
我需要的效果图:
大神们有什么好的方法没 ???????????
|
|