📄 wgui_categories_popup.c
字号:
/*****************************************************************************
* FUNCTION
* RedrawCalibrationScreen
* DESCRIPTION
* Redraws Calibration Screen
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void RedrawCalibrationScreen(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
PU8 image = NULL;
gdi_handle handle;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
gui_lock_double_buffer();
gui_hide_animations();
if (g_gui_calibration_screen_cntx.image_id)
{
image = get_image((MMI_ID_TYPE) g_gui_calibration_screen_cntx.image_id);
}
gui_push_clip();
gui_reset_clip();
clear_screen();
show_multiline_inputbox();
gui_reset_clip();
if (image)
{
gdi_image_draw_animation(
g_gui_calibration_screen_cntx.image_x,
g_gui_calibration_screen_cntx.image_y,
image,
(gdi_handle*) & handle);
}
gui_pop_clip();
gui_unlock_double_buffer();
gui_BLT_double_buffer(0, 0, UI_device_width - 1, UI_device_height - 1);
}
/*****************************************************************************
* FUNCTION
* ShowCalibrationScreen
* DESCRIPTION
* Shows Calibration Screen
* PARAMETERS
* image_id [IN]
* cali_x [IN]
* cali_y [IN]
* string [IN]
* state [IN]
* image(?) [IN]
* RETURNS
* void
*****************************************************************************/
void ShowCalibrationScreen(U16 image_id, S16 cali_x, S16 cali_y, U16 string, U16 state)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
entry_full_screen();
MMI_menu_shortcut_number = -1;
gui_lock_double_buffer();
clear_category_screen_key_handlers();
clear_left_softkey();
clear_right_softkey();
UpdateCalibrationScreen(image_id, cali_x, cali_y, string, state, MMI_FALSE);
gui_unlock_double_buffer();
ExitCategoryFunction = ExitCalibrationScreen;
RedrawCategoryFunction = RedrawCalibrationScreen;
GetCategoryHistory = dummy_get_history;
GetCategoryHistorySize = dummy_get_history_size;
RedrawCalibrationScreen();
}
#ifdef __MMI_HANDWRITING_PAD__
static U8 g_gui_control_area[TP_AREA_MAX_NUM];
/*****************************************************************************
* FUNCTION
* UpdateTestControlAreaScreen
* DESCRIPTION
* Updates Multiline buffer contents before redrawing test control area screens.
* PARAMETERS
* pos [IN] The position of the click point
* string [IN]
* state [IN] Casted from PHNSET_CALIBRATION_STATE_ENUM
* redraw [IN] Redraw the category screen
* RETURNS
* the state in testing control area screen
* REMARKS
* We should avoid overlapping of image and text
*****************************************************************************/
U16 UpdateTestControlAreaScreen(mmi_pen_point_struct pos, U16 string, U16 state, BOOL redraw)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
S32 l, fh;
S32 yloc; /* start y coordinate */
S32 maxht; /* maximum height of Multiline Box */
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
/* Compute inputbox height */
MMI_message_string = (UI_string_type) GetString(string);
l = gui_strlen(MMI_message_string);
create_multiline_inputbox_set_buffer(MMI_message_string, l, l, 0);
MMI_multiline_inputbox.flags |= UI_MULTI_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW
| UI_MULTI_LINE_INPUT_BOX_CENTER_JUSTIFY
| UI_MULTI_LINE_INPUT_BOX_DISABLE_BACKGROUND
| UI_MULTI_LINE_INPUT_BOX_DISABLE_SCROLLBAR | UI_MULTI_LINE_INPUT_BOX_VIEW_MODE;
resize_multiline_inputbox(UI_device_width - 2, UI_device_height);
show_multiline_inputbox_no_draw();
fh = get_multiline_inputbox_line_height();
/* Move the inputbox to appropriate position */
#ifdef __MMI_UI_STYLE_1__
maxht = (MMI_multiline_inputbox.n_lines * fh) + MULTILINE_INPUTBOX_HEIGHT_PAD + MMI_multiline_inputbox.text_y + 10;
#else
maxht = (MMI_multiline_inputbox.n_lines * fh) + MULTILINE_INPUTBOX_HEIGHT_PAD + MMI_multiline_inputbox.text_y;
#endif
if (maxht > UI_device_height)
{
maxht = UI_device_height;
}
switch (state)
{
case TEST_CONTROL_AREA_WELCOME_STATE:
memset(g_gui_control_area, 0, sizeof(U8) * TP_AREA_MAX_NUM);
yloc = 20; /* (UI_device_height>>1) - (maxht >> 1); */
state = TEST_CONTROL_AREA_TESTING_STATE;
break;
case TEST_CONTROL_AREA_TESTING_STATE:
{
S32 i;
yloc = 20; /* (UI_device_height>>1) - (maxht >> 1); */
if ((i = mmi_pen_check_inside_control_area(pos)) >= 0)
{
g_gui_control_area[i] = MMI_TRUE;
}
state = TEST_CONTROL_AREA_FINISH_STATE;
for (i = 0; i < TP_AREA_MAX_NUM; i++)
{
if (IS_ENABLE_FLAG(tp_area_table[i].flag, TP_CONTROL_AREA) && (g_gui_control_area[i] != MMI_TRUE))
{
state = TEST_CONTROL_AREA_TESTING_STATE;
break;
}
}
}
break;
default:
MMI_ASSERT(0);
state = TEST_CONTROL_AREA_WELCOME_STATE;
break;
}
resize_multiline_inputbox(UI_device_width - 2, maxht);
move_multiline_inputbox(1, yloc);
if (redraw)
{
RedrawTestControlAreaScreen();
}
return state;
}
/*****************************************************************************
* FUNCTION
* ExitTestControlAreaScreen
* DESCRIPTION
* Exits Control Area Screen
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void ExitTestControlAreaScreen(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
ExitCategoryFunction = MMI_dummy_function;
RedrawCategoryFunction = MMI_dummy_function;
GetCategoryHistory = dummy_get_history;
GetCategoryHistorySize = dummy_get_history_size;
}
/*****************************************************************************
* FUNCTION
* RedrawTestControlAreaScreen
* DESCRIPTION
* Redraws Control Area Screen
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void RedrawTestControlAreaScreen(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
int i;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
/* gdi_color color[] = {GDI_COLOR_BLACK, GDI_COLOR_GREEN, GDI_COLOR_GRAY, GDI_COLOR_RED, GDI_COLOR_GREEN }; */
gui_lock_double_buffer();
gui_push_clip();
gui_reset_clip();
clear_screen();
show_multiline_inputbox();
gui_reset_clip();
for (i = 0; i < TP_AREA_MAX_NUM; i++)
{
if (IS_ENABLE_FLAG(tp_area_table[i].flag, TP_CONTROL_AREA) && (g_gui_control_area[i] != MMI_TRUE))
{
int index = 0;
mmi_pen_point_struct pos1, pos2;
pos1 = tp_area_table[i].pos[index];
index++;
while ((tp_area_table[i].pos[index].x != -1) && (tp_area_table[i].pos[index].y != -1))
{
pos2 = tp_area_table[i].pos[index];
gdi_draw_line(pos1.x, pos1.y, pos2.x, pos2.y, GDI_COLOR_BLACK);
pos1 = pos2;
index++;
}
pos2 = tp_area_table[i].pos[0];
gdi_draw_line(pos1.x, pos1.y, pos2.x, pos2.y, GDI_COLOR_BLACK);
}
else
{
/* handwriting area */
}
}
gui_pop_clip();
gui_unlock_double_buffer();
gui_BLT_double_buffer(0, 0, UI_device_width - 1, UI_device_height - 1);
}
/*****************************************************************************
* FUNCTION
* ShowTestControlAreaScreen
* DESCRIPTION
* Shows Control Area Screen
* PARAMETERS
* pos [IN]
* string [IN]
* state [IN]
* RETURNS
* void
*****************************************************************************/
void ShowTestControlAreaScreen(mmi_pen_point_struct pos, U16 string, U16 state)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
entry_full_screen();
MMI_menu_shortcut_number = -1;
gui_lock_double_buffer();
clear_category_screen_key_handlers();
clear_left_softkey();
clear_right_softkey();
UpdateTestControlAreaScreen(pos, string, state, MMI_FALSE);
gui_unlock_double_buffer();
ExitCategoryFunction = ExitTestControlAreaScreen;
RedrawCategoryFunction = RedrawTestControlAreaScreen;
GetCategoryHistory = dummy_get_history;
GetCategoryHistorySize = dummy_get_history_size;
RedrawTestControlAreaScreen();
}
#endif /* __MMI_HANDWRITING_PAD__ */
#endif /* defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__) */
/** Slide 32 ***/
/*****************************************************************************
* FUNCTION
* ExitCategory121Screen
* DESCRIPTION
* Exits the category121 screen
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void ExitCategory121Screen(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
#ifdef __MMI_UI_SMALL_SCREEN_SUPPORT__
reset_small_screen();
#endif
close_status_icons();
reset_softkeys();
reset_multiline_inputbox();
gui_hide_animations();
ExitCategoryFunction = MMI_dummy_function;
RedrawCategoryFunction = MMI_dummy_function;
GetCategoryHistory = dummy_get_history;
GetCategoryHistorySize = dummy_get_history_size;
}
extern void wgui_set_animation_y(S32 x, S32 y, MMI_ID_TYPE img);
/*****************************************************************************
* FUNCTION
* ShowCategory121Screen
* DESCRIPTION
* Displays the category121 screen
* PARAMETERS
* left_softkey [IN] Left softkey label
* left_softkey_icon [IN] Icon for the right softkey
* right_softkey [IN] Right softkey label
* right_softkey_icon [IN]
* message [IN] String to display
* message_icon [IN] Icon to display
* history_buffer [IN] History buffer
* flag [IN] Value shpuld be 0/1 -
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -