📄 wgui_datetime.c
字号:
}
/*****************************************************************************
* FUNCTION
* wgui_show_date_time_input
* DESCRIPTION
* show date time input box
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void wgui_show_date_time_input(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
gdi_layer_lock_frame_buffer();
if (wgui_date_input_enabled) /* if date input box enabled */
{
wgui_show_date_input(); /* show date input box -day/month/year */
}
if (wgui_time_input_enabled) /* if time input is enabled */
{
wgui_show_time_input(); /* show time input box */
}
gdi_layer_unlock_frame_buffer();
gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
}
/*****************************************************************************
* FUNCTION
* wgui_create_date_time_inputbox
* DESCRIPTION
* create single input box of date or time
* PARAMETERS
* b [IN] Single input box
* buffer [IN] Buffer
* buffer_length [IN] Total buffer length
* text_length [IN] Current text length
* RETURNS
* void
*****************************************************************************/
void wgui_create_date_time_inputbox(single_line_input_box *b, U8 *buffer, S32 buffer_length, S32 text_length)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
/* create single iput box and set buffer */
gui_create_single_line_input_box_set_buffer(
b,
0,
0,
0,
0,
(UI_string_type) buffer,
(buffer_length + 1) * 2,
(text_length + 1) * 2,
text_length);
b->flags |= UI_SINGLE_LINE_INPUT_BOX_OVERWRITE_MODE;
/* set the cursor position to first character */
gui_single_line_input_box_goto_first_character(b);
}
/*****************************************************************************
* FUNCTION
* wgui_initialize_date_input
* DESCRIPTION
* set the day,month,year value and length of date input box
* PARAMETERS
* day_buffer [IN] Store valeu of day
* day_buffer_length [IN] Length of day buffer
* month_buffer [IN] Store value of minth
* month_buffer_length [IN] Length of month buffer
* year_buffer [IN] Store valeu of year
* year_buffer_length [IN] Length of year buffer
* RETURNS
* void
*****************************************************************************/
void wgui_initialize_date_input(
UI_buffer_type day_buffer,
S32 day_buffer_length,
UI_buffer_type month_buffer,
S32 month_buffer_length,
UI_buffer_type year_buffer,
S32 year_buffer_length)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
S32 l;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
/* set the theme of date input */
wgui_date_time_input_theme.normal_filler = current_MMI_theme->formatted_inputbox_normal_filler;
wgui_date_time_input_theme.disabled_filler = current_MMI_theme->formatted_inputbox_normal_filler;
wgui_date_time_input_theme.selected_filler = current_MMI_theme->formatted_inputbox_selected_filler;
/* set the theme of single line input box equal to date time input themem */
current_single_line_input_box_theme = &wgui_date_time_input_theme;
l = gui_strlen((UI_string_type) day_buffer);
/* create day input box and set the buffe of day input box */
wgui_create_date_time_inputbox(&wgui_date_input_day, day_buffer, day_buffer_length, l);
l = gui_strlen((UI_string_type) month_buffer);
/* create month input box and set the buffer of month input box */
wgui_create_date_time_inputbox(&wgui_date_input_month, month_buffer, month_buffer_length, l);
l = gui_strlen((UI_string_type) year_buffer);
/* create year input box and set the buffer of year input box */
wgui_create_date_time_inputbox(&wgui_date_input_year, year_buffer, year_buffer_length, l);
current_single_line_input_box_theme = current_UI_theme->single_line_input_box_theme;
wgui_date_time_input_remove_object_focus(&wgui_date_input_day);
wgui_date_time_input_remove_object_focus(&wgui_date_input_month);
wgui_date_time_input_remove_object_focus(&wgui_date_input_year);
/* set the flag of date input enabled */
wgui_date_input_enabled = 1;
}
/*****************************************************************************
* FUNCTION
* wgui_initialize_time_input
* DESCRIPTION
* set the hour ,minute,second value and length of time input box
* PARAMETERS
* hours_buffer [IN] Store valeu of hours
* hours_buffer_length [IN] Length of hours buffer
* minutes_buffer [IN] Store value of minute
* minutes_buffer_length [IN] Length of minute buffer
* seconds_buffer [IN] Store valeu of seconds
* seconds_buffer_length [IN] Length of second buffer
* RETURNS
* void
*****************************************************************************/
void wgui_initialize_time_input(
UI_buffer_type hours_buffer,
S32 hours_buffer_length,
UI_buffer_type minutes_buffer,
S32 minutes_buffer_length,
UI_buffer_type seconds_buffer,
S32 seconds_buffer_length)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
S32 l;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
/* set the theme of time input box */
wgui_date_time_input_theme.normal_filler = current_MMI_theme->formatted_inputbox_normal_filler;
wgui_date_time_input_theme.disabled_filler = current_MMI_theme->formatted_inputbox_normal_filler;
wgui_date_time_input_theme.selected_filler = current_MMI_theme->formatted_inputbox_selected_filler;
current_single_line_input_box_theme = &wgui_date_time_input_theme;
l = gui_strlen((UI_string_type) hours_buffer);
/* create hour inputbox and set the buffer of hour input box */
wgui_create_date_time_inputbox(&wgui_time_input_hours, hours_buffer, hours_buffer_length, l);
l = gui_strlen((UI_string_type) minutes_buffer);
/* create minutes inputbox and set the buffer of minutes input box */
wgui_create_date_time_inputbox(&wgui_time_input_minutes, minutes_buffer, minutes_buffer_length, l);
l = gui_strlen((UI_string_type) seconds_buffer);
/* create seconds inputbox and set the buffer of second input box */
wgui_create_date_time_inputbox(&wgui_time_input_seconds, seconds_buffer, seconds_buffer_length, l);
current_single_line_input_box_theme = current_UI_theme->single_line_input_box_theme;
wgui_date_time_input_remove_object_focus(&wgui_time_input_hours);
wgui_date_time_input_remove_object_focus(&wgui_time_input_minutes);
wgui_date_time_input_remove_object_focus(&wgui_time_input_seconds);
wgui_date_time_input_remove_object_focus(&wgui_time_input_AM_PM);
wgui_time_input_enabled = 1;
}
/*****************************************************************************
* FUNCTION
* wgui_reset_date_input
* DESCRIPTION
* set the flag of date input to default valeu
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void wgui_reset_date_input(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
wgui_date_input_enabled = 0;
}
/*****************************************************************************
* FUNCTION
* wgui_reset_time_input
* DESCRIPTION
* set the flag of time input to default valeu
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void wgui_reset_time_input(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
wgui_time_input_enabled = 0;
}
/*****************************************************************************
* FUNCTION
* wgui_move_day_input
* DESCRIPTION
* move day input box to particula position x , y equal to valeu pass as parameter
* PARAMETERS
* x [IN]
* y [IN]
* RETURNS
* void
*****************************************************************************/
void wgui_move_day_input(S32 x, S32 y)
{ /* move the day input box to particular x,y position */
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
gui_move_single_line_input_box(&wgui_date_input_day, x, y);
}
/*****************************************************************************
* FUNCTION
* wgui_resize_day_input
* DESCRIPTION
* resize day inpuit box
* PARAMETERS
* width [IN]
* height [IN]
* RETURNS
* void
*****************************************************************************/
void wgui_resize_day_input(S32 width, S32 height)
{ /* resize da input box equal to width and height pass as parameter */
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
gui_resize_single_line_input_box(&wgui_date_input_day, width, height);
}
/*****************************************************************************
* FUNCTION
* wgui_move_month_input
* DESCRIPTION
* move month input box to particula position x , y equal to valeu pass as parameter
* PARAMETERS
* x [IN]
* y [IN]
* RETURNS
* void
*****************************************************************************/
void wgui_move_month_input(S32 x, S32 y)
{ /* move the month input box to particular x,y position */
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
gui_move_single_line_input_box(&wgui_date_input_month, x, y);
}
/*****************************************************************************
* FUNCTION
* wgui_resize_month_input
* DESCRIPTION
* resize month inpuit box
* PARAMETERS
* width [IN]
* height [IN]
* RETURNS
* void
*****************************************************************************/
void wgui_resize_month_input(S32 width, S32 height)
{ /* resize month input box equal to width and height pass as parameter */
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
gui_resize_single_line_input_box(&wgui_date_input_month, width, height);
}
/*****************************************************************************
* FUNCTION
* wgui_move_year_input
* DESCRIPTION
* move year input box to particula position x , y equal to valeu pass as parameter
* PARAMETERS
* x [IN]
* y [IN]
* RETURNS
* void
*****************************************************************************/
void wgui_move_year_input(S32 x, S32 y)
{ /* move the year input box to particular x,y position */
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
gui_move_single_line_input_box(&wgui_date_input_year, x, y);
}
/*****************************************************************************
* FUNCTION
* wgui_resize_year_input
* DESCRIPTION
* resize year inpuit box
* PARAMETERS
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -