📄 wgui_categories.c
字号:
* void
*
* GLOBALS AFFECTED
* ExitCategoryFunction, RedrawCategoryFunction, GetCategoryHistory
* GetCategoryHistorySize, g_dm_data_struct
* *****************************************************************************/
void ShowCategory13Screen(U16 title,U16 title_icon,U16 left_softkey,U16 left_softkey_icon,U16 right_softkey,U16 right_softkey_icon,S32 number_of_items,U16* list_of_items,U8* list_of_states,S32 highlighted_item,U8* history_buffer)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U8 i =0;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
for(i=0;i<number_of_items;i++)
{
subMenuDataPtrs[i]=(PU8)get_string(list_of_items[i]);
}
ShowCategory12Screen( title, title_icon, left_softkey, left_softkey_icon, right_softkey, right_softkey_icon, number_of_items, subMenuDataPtrs, list_of_states, highlighted_item, history_buffer);
}/* end of ShowCategory13Screen */
/*----------------------------------------------------------------------------
Function: ShowCategory15Screen
Description: Displays the category15 screen
Input Parameters: [1] STRING_ID title, Title for the screen
[2] IMAGE_ID title_icon, Icon displayed with the title
[3] STRING_ID left_softkey, Left softkey label
[4] IMAGE_ID left_softkey_icon, Left softkey icon
[5] STRING_ID right_softkey, Right softkey label
[6] IMAGE_ID right_softkey_icon, Right softkey icon
[7] INT number_of_items, Number of items in the menu
[8] STRING_ID* list_of_items, Array of items
[9] IMAGE_ID* list_of_icons, Array of icons
[10]INT flags, flags (see explanation below)
[11]INT highlighted_item, Default item to be highlighted (if there is no history)
[12]BYTE* history_buffer history buffer
The last 8 bits of flags represent the type of the menu.
Values allowed for these 8 bits are:
LIST_MENU,
MATRIX_MENU
Output Parameters: none
Returns: void
----------------------------------------------------------------------------*/
void ShowCategory15Screen(U16 title,U16 title_icon,U16 left_softkey,U16 left_softkey_icon,U16 right_softkey,U16 right_softkey_icon,S32 number_of_items,U16* list_of_items,U16* list_of_icons,S32 flags,S32 highlighted_item,U8* history_buffer)
{
//START VIJAY PMT 20050930
#ifdef UI_SMALL_LIST_SCREEN
//START VIJAY PMT 20051202
if(whether_no_small_screen())
//END VIJAY PMT 20051202
ShowCategory10Screen(title,title_icon,left_softkey,left_softkey_icon,right_softkey,right_softkey_icon,number_of_items,list_of_items,list_of_icons,highlighted_item,history_buffer);
else
#endif /* UI_SMALL_LIST_SCREEN */
{
//END VIJAY PMT 20050930
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
dm_data_struct dm_data;
S32 i,shortcut_width,ixsize,iysize;
byte h_flag;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
gdi_layer_lock_frame_buffer();
MMI_menu_shortcut_number=-1;
change_left_softkey(left_softkey,left_softkey_icon);
change_right_softkey(right_softkey,right_softkey_icon);
SetupCategoryKeyHandlers();
create_fixed_icontext_menuitems();
MMI_current_menu_type=flags&0x0f;
MMI_title_string=(UI_string_type)get_string(title);
MMI_title_icon=(UI_image_type)get_image(title_icon);
switch(MMI_current_menu_type)
{ case LIST_MENU:
//resize_fixed_list(MMI_content_width,MMI_content_height+2);
resize_fixed_list(MMI_content_width,MMI_content_height);//031705 Calvin modified
associate_fixed_icontext_list();
for(i=0;i<number_of_items;i++)
add_fixed_icontext_item(get_string(list_of_items[i]), wgui_get_list_menu_icon (i, list_of_icons[i]));
register_fixed_list_shortcut_handler();
register_fixed_list_keys();
shortcut_width=set_menu_item_count(number_of_items)+7;
resize_menu_shortcut_handler(shortcut_width,MMI_title_height);
move_menu_shortcut_handler(UI_device_width-MMI_menu_shortcut_box.width,MMI_title_y);
register_hide_menu_shortcut(mmi_gui_redraw_menu_shortcut);
//resize_fixed_icontext_menuitems(0,get_menu_item_height());//041205 Calvin modified
resize_fixed_icontext_menuitems(0,MMI_MENUITEM_HEIGHT);
set_fixed_icontext_positions(MMI_ICONTEXT_MENUITEM_HEIGHT+2,0,1,0);
register_fixed_list_highlight_handler(standard_list_highlight_handler);
h_flag=set_list_menu_category_history(MMI_CATEGORY15_LIST_ID,history_buffer);
if(h_flag)
fixed_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
else
fixed_list_goto_item_no_redraw(highlighted_item);
break;
case MATRIX_MENU:
associate_fixed_icontext_matrix();
for(i=0;i<number_of_items;i++)
add_fixed_icontext_item(get_string(list_of_items[i]),get_image(list_of_icons[i]));
register_fixed_matrix_shortcut_handler();
MMI_fixed_matrix_menu.flags|=UI_MATRIX_MENU_LOOP;
register_fixed_matrix_loop_keys();
register_fixed_matrix_highlight_handler(standard_animated_matrix_highlight_handler_type2);
if(number_of_items>9)
ixsize=(MMI_content_width-MMI_fixed_matrix_menu.vbar.width-6)/3;
else
ixsize=(MMI_content_width-6)/3;
iysize=(MMI_content_height-6)/3;
configure_fixed_matrix(ixsize,iysize,3,0);
shortcut_width=set_menu_item_count(number_of_items)+7;
resize_menu_shortcut_handler(shortcut_width,MMI_title_height);
move_menu_shortcut_handler(UI_device_width-MMI_menu_shortcut_box.width,MMI_title_y);
register_hide_menu_shortcut(mmi_gui_redraw_menu_shortcut);
set_fixed_icontext_positions(0,0,0,0);
MMI_fixed_icontext_menuitem.flags|=UI_MENUITEM_DISABLE_TEXT_DISPLAY;
MMI_disable_title_shortcut_display=0;
h_flag=set_matrix_menu_category_history(MMI_CATEGORY15_MATRIX_ID,history_buffer);
if(h_flag)
fixed_matrix_goto_item_no_redraw(MMI_fixed_matrix_menu.highlighted_item);
else
fixed_matrix_goto_item_no_redraw(highlighted_item);
break;
}
gdi_layer_unlock_frame_buffer();
ExitCategoryFunction=ExitCategory15Screen;
RedrawCategoryFunction=dm_redraw_category_screen;
GetCategoryHistory = dm_get_category_history;
GetCategoryHistorySize = dm_get_category_history_size;
dm_data.s32ScrId = (S32)GetActiveScreenId();
if ( (MMI_current_menu_type == LIST_MENU) || (MMI_current_menu_type==PAGE_MENU) )
dm_data.s32CatId = MMI_CATEGORY15_LIST_ID;
else
dm_data.s32CatId = MMI_CATEGORY15_MATRIX_ID;
dm_data.s32flags = 0;
dm_setup_data(&dm_data);
dm_redraw_category_screen();
//START VIJAY PMT 20050930
}
//END VIJAY PMT 20050930
}/* end of ShowCategory15Screen */
/*****************************************************************************
* FUNCTION
* ExitCategory15Screen
*
* DESCRIPTION
* Exits the category15 screen
*
* PARAMETERS
* void
*
* RETURNS
* void
*
* GLOBALS AFFECTED
*
*****************************************************************************/
void ExitCategory15Screen(void)
{
ClearHighlightHandler();
reset_softkeys();
reset_menu_shortcut_handler();
reset_fixed_list();
reset_fixed_matrix();
//START VIJAY PMT 20051202
#ifdef UI_SMALL_LIST_SCREEN
restore_small_screen();
#endif /* UI_SMALL_LIST_SCREEN */
//END VIJAY PMT 20051202
}
//START VIJAY PMT 20050930
#ifdef UI_SMALL_LIST_SCREEN /* PMT MANISH 20050705 */
UI_filled_area *fixed_list_backup_filler;
UI_filled_area small_list_menu_normal_filler;
UI_filled_area small_list_menu_item_selected_filler;
void ExitCategory10Screen(void)
{
#ifdef __MMI_UI_SMALL_SCREEN_SUPPORT__
reset_small_screen();
#endif /* __MMI_UI_SMALL_SCREEN_SUPPORT__ */
MMI_fixed_list_menu.normal_filler = fixed_list_backup_filler;
show_status_icon_bar(0);//052906 early status icon
ExitListCategoryScreen();
entry_full_screen();
}
void ShowCategory10Screen(U16 title,U16 title_icon,U16 left_softkey,U16 left_softkey_icon,U16 right_softkey,U16 right_softkey_icon,S32 number_of_items,U16* list_of_items,U16* list_of_icons,S32 highlighted_item,U8* history_buffer)
{
dm_data_struct dm_data;
S32 i,icon_width=0,icon_height=0;
color c=*(current_MMI_theme->UI_black_color);
byte h_flag,flag=0;
MMI_title_x = MMI_SMALL_SCREEN_X_OFFSET+1;
MMI_title_y += MMI_title_height + MMI_SMALL_SCREEN_Y_OFFSET;
MMI_title_width -= (2*MMI_SMALL_SCREEN_X_OFFSET+1);
gdi_layer_lock_frame_buffer();
#ifdef __MMI_UI_SMALL_SCREEN_SUPPORT__
set_small_screen();
mmi_gui_add_cleanup_hook(disable_resized_small_screen);
#endif /* __MMI_UI_SMALL_SCREEN_SUPPORT__ */
hide_status_icon_bar(0);//052906 early status icon
create_fixed_icontext_menuitems();
associate_fixed_icontext_list();
fixed_list_backup_filler = MMI_fixed_list_menu.normal_filler;
small_list_menu_normal_filler = *MMI_fixed_list_menu.normal_filler;
small_list_menu_normal_filler.flags = UI_FILLED_AREA_TYPE_COLOR;
MMI_fixed_list_menu.normal_filler = &small_list_menu_normal_filler;
small_list_menu_item_selected_filler=*MMI_fixed_list_menu.normal_filler;
small_list_menu_item_selected_filler.flags=UI_FILLED_AREA_TYPE_COLOR|UI_FILLED_AREA_SINGLE_BORDER|UI_FILLED_AREA_ROUNDED_BORDER;
ShowListCategoryScreen( get_string(title),get_image( title_icon), get_string(left_softkey), get_image( left_softkey_icon), get_string(right_softkey), get_image( right_softkey_icon), number_of_items);
if(list_of_icons==NULL)
{
for(i=0;i<number_of_items;i++)
{
add_fixed_icontext_item(get_string(list_of_items[i]),NULL);
}
}
else
{
for(i=0;i<number_of_items;i++)
{
add_fixed_icontext_item(get_string(list_of_items[i]),wgui_get_list_menu_icon(i,list_of_icons[i]));
if(list_of_icons[i]!=UI_NULL_IMAGE)
{
flag=1;
pixtel_UI_measure_image(get_image(list_of_icons[i]),&icon_width,&icon_height);
}
}
}
//START VIJAY PMT 20051202
resize_fixed_list(MMI_content_width-2*MMI_SMALL_SCREEN_X_OFFSET-1,MMI_content_height-2*MMI_SMALL_SCREEN_Y_OFFSET-MMI_title_height);
resize_fixed_icontext_menuitems(MMI_fixed_list_menu.width-MMI_fixed_list_menu.vbar.width-1,MMI_MENUITEM_HEIGHT);
//END VIJAY PMT 20051202
h_flag=set_list_menu_category_history(MMI_CATEGORY10_ID,history_buffer);
if(h_flag) fixed_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
else fixed_list_goto_item_no_redraw(highlighted_item);
gdi_layer_unlock_frame_buffer();
RedrawCategoryFunction=dm_redraw_category_screen;
ExitCategoryFunction = ExitCategory10Screen;
GetCategoryHistory = dm_get_category_history;
GetCategoryHistorySize = dm_get_category_history_size;
dm_data.s32ScrId = (S32)GetActiveScreenId();
dm_data.s32CatId = MMI_CATEGORY10_ID;
dm_data.s32flags = 0;
dm_add_rectangle(c,DM_RECTANGLE_FILL_GRAYSCALE);
dm_setup_data(&dm_data);
dm_add_back_fill_area(&small_list_menu_item_selected_filler);
dm_redraw_category_screen();
}
#endif /* UI_SMALL_LIST_SCREEN */
//END VIJAY PMT 20050930
/*****************************************************************************
* FUNCTION
* ShowCategory21Screen
*
* DESCRIPTION
* Displays the category21 screen
*
* PARAMETERS
* title IN Title for the screen
* title_icon IN Icon shown with the title
* left_softkey IN Left softkey label
* left_softkey_icon IN Icon for the left softkey
* right_softkey IN Right softkey label
* right_softkey_iconIN Icon for the right softkey
* message IN Notification message (string. Not string ID)
* history_buffer IN history buffer
*
* RETURNS
* void
*
* GLOBALS AFFECTED
* ExitCategoryFunction, RedrawCategoryFunction, GetCategoryHistory
* GetCategoryHistorySize, g_dm_data_struct
* *****************************************************************************/
void ShowCategory21Screen(U16 title,U16 title_icon,U16 left_softkey,U16 left_softkey_icon,U16 right_softkey,U16 right_softkey_icon,U16 message,U8* history_buffer)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
dm_data_struct dm_data;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
UI_UNUSED_PARAMETER(history_buffer);
gdi_layer_lock_frame_buffer();
MMI_menu_shortcut_number=-1;
change_left_softkey(left_softkey,left_softkey_icon);
change_right_softkey(right_softkey,right_softkey_icon);
SetupCategoryKeyHandlers();
MMI_title_string=(UI_string_type)get_string(title);
MMI_title_icon=(UI_image_type)get_image(title_icon);
MMI_message_string=(UI_string_type)get_string(message);
create_multiline_inputbox_set_buffer(MMI_message_string,pixtel_UI_strlen((UI_string_type)MMI_message_string),pixtel_UI_strlen((UI_string_type)MMI_message_string),0);
SetKeyHandler(multiline_inputbox_previous_line,KEY_UP_ARROW,KEY_EVENT_DOWN);
SetKeyHandler(multiline_inputbox_next_line,KEY_DOWN_ARROW,KEY_EVENT_DOWN);
MMI_multiline_inputbox.flags|=(UI_MULTI_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW|UI_MULTI_LINE_INPUT_BOX_DISABLE_BACKGROUND);
gdi_layer_unlock_frame_buffer();
ExitCategoryFunction=MMI_dummy_function;
RedrawCategoryFunction=dm_redraw_category_screen;
GetCategoryHistory = dm_get_category_history;
GetCategoryHistorySize = dm_get_category_history_size;
dm_data.s32ScrId = (S32)GetActiveScreenId();
dm_data.s32CatId = MMI_CATEGORY21_ID;
dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
dm_setup_data(&dm_data);
dm_redraw_category_screen();
}/* end of ShowCategory21Screen */
/*****************************************************************************
* FUNCTION
* ShowCategory22Screen
*
* DESCRIPTION
* Displays the category22 screen
*
* PARAMETERS
* title IN Title for the screen
* title_icon IN Icon displayed with the title
* left_softkey IN Left softkey label
* left_softkey_icon IN Left softkey icon
* right_softkey IN Right softkey label
* right_softkey_icon IN Right softkey icon
* num_of_symbols IN number of symbols
* MMI_symbols IN Symbols specific to application
* highlighted_item IN Default item to be highlighted (if there is no history)
* history_buffer IN history buffer
*
* RETURNS
* void
*
* GLOBALS AFFECTED
* ExitCategoryFunction, RedrawCategoryFunction, GetCategoryHistory
* GetCategoryHistorySize, g_dm_data_struct
* *****************************************************************************/
void ShowCategory22Screen(U16 title,U16 title_icon,U16 left_softkey,U16 left_softkey_icon,U16 right_softkey,U16 right_softkey_icon,S32 num_of_symbols,U8** MMI_symbols,S32 highlighted_item,U8* history_buffer)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
dm_data_struct dm_data;
S32 i;
byte h_flag;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
//PMT VIKAS START 20050720
#ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
pixtel_UI_block_list_effect();
#endif
//PMT VIKAS END 20050720
gdi_layer_lock_frame_buffer();
MMI_menu_shortcut_number=-1;
change_left_softkey(left_softkey,left_softkey_icon);
change_right_softkey(right_softkey,right_softkey_icon);
SetupCategoryKeyHandlers();
create_fixed_text_menuitems();
associate_fixed_text_matrix();
for(i=0;i<num_of_symbols;i++)
add_fixed_text_item((UI_string_type)MMI_symbols[i]);
configure_fixed_matrix(19,21,0,0);
register_fixed_matrix_loop_keys();
register_fixed_matrix_highlight_handler(standard_noshortcut_matrix_highlight_handler);
MMI_current_menu_type=MATRIX_MENU;
MMI_fixed_matrix_menu.flags|=UI_MATRIX_MENU_LOOP;
h_flag=set_matrix_menu_category_history
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -