Portable software technology 2005 04 26
Download
1 / 72

Portable Software Technology 2005/04/26 - PowerPoint PPT Presentation


  • 57 Views
  • Uploaded on

GUI. Portable Software Technology 2005/04/26. Outline. GUI overview GUI description Use GUI GUI principle. 1. GUI overview. Screen Menu Message box Public Private Component Menu & MenuItem Button & Scrollbar InputBox & InlineEditBox Other Primitive. 1.1.1 Scr – Menu.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Portable Software Technology 2005/04/26' - qabil


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Portable software technology 2005 04 26

GUI

Portable Software Technology

2005/04/26


Outline
Outline

  • GUI overview

  • GUIdescription

  • Use GUI

  • GUIprinciple


1 gui overview
1. GUI overview

  • Screen

    • Menu

    • Message box

    • Public

    • Private

  • Component

    • Menu & MenuItem

    • Button & Scrollbar

    • InputBox & InlineEditBox

    • Other

  • Primitive






1 2 1 comp menu menuitem
1.2.1 Comp – Menu & MenuItem

ScrollBar

Background


1 2 2 comp button scrollbar
1.2.2 Comp – Button & Scrollbar

STYLE 3

STYLE 2

STYLE 1



1 2 4 comp other
1.2.4 Comp – Other

Status bar 0

Status bar 2(SubLCD)

Shortcut

Title bar

Information bar

Status bar 1

Scrolling text

Popup description

Virtual keyboard

Button bar

Left softkey

Right softkey

Arrow indication



2 gui description
2. GUIdescription

  • Primitive

    • LCD & Layer

    • Position & Area & Clip

    • Color & Transparent

    • String & Font

    • Image

    • Filled area

    • Theme

  • Component

    • Menu

    • MenuItem

    • Button

    • InputBox1

    • InputBox2

    • Scrollbar

    • StatusBar

  • Screen

    • Menu

    • Message box

    • Message box2

    • Public

    • Private

    • private2


2 1 1 prim lcd layer
2.1.1 Prim – LCD & Layer

Position: 0, 0

Size: 176, 220

Source key: FALSE

Opacity: FALSE

Screen

LCD

Layer list

=>

Position: 18, 50

Size: 140, 100

Source key: FALSE

Opacity: 128 (0–255)

Position: –20, 70

Size: 200, 40

Source key: (0, 0, 255)

Opacity: FALSE


2 1 2 prim coordinate clip

Layer Coordinate

X axis

Layer height

Y axis

LCD Coordinate

Layer width

X axis

LCD height

Y axis

LCDr width

2.1.2 Prim – Coordinate & Clip

Image position: 20 20

Layer

=>

Clip: (30,30,130,60)

Text position: 10 70

Text clip: (20,50,120,80)

Screen

<=





2 1 6 prim filled area
2.1.6 Prim – Filled area

Filled area = filled type + filled border +filled shadow
















3 use gui
3. Use GUI

  • Screen

    • Menu

    • Message box

    • Public

  • Component

  • Primitive


3 1 1 1 1 scr menu textlist
3.1.1.1.1 Scr – Menu – TextList

  • U8 subMenuData[MAX_SUB_MENUS][MAX_SUB_MENU_SIZE];

  • U16 list_of_items[MAX_SUB_MENUS];

  • U8 subHintData[MAX_SUB_MENUS][MAX_SUB_MENU_HINT_SIZE];

  • S32 number_of_items = 0;

  • S32 default_highlighted_item = 0;

  • U8* guiBuffer;

  • S32 i = 0;

  • EntryNewScreen(NEW_SCREEN_ID, ExitFunction, Entryfunction, NULL);

  • guiBuffer = GetCurrGuiBuffer (NEW_SCREEN_ID);

  • number_of_items = GetNumOfChild( CURRENT_PARENT_ITEM_ID );

  • GetSequenceStringIds(CURRENT_PARENT_ITEM_ID , list_of_items);

  • SetParentHandler(CURRENT_PARENT_ITEM_ID );

  • RegisterHighlightHandler(ExecuteCurrHiliteHandler);

  • for (i=0;i<number_of_items;i++)

  • subMenuData[i]=(PU8)get_string(list_of_items[i]);

  • ShowCategory1Screen( title_id,title_icon_id,left_softkey_id,left_softkey_icon_id,right_softkey_id,right_softkey_icon_id, //Common screen data

  • number_of_items, //Number of items

    • list_of_items, //List of text items

    • default_highlighted_item, //This is the default item that will be highlighted (if there is no history)

    • guiBuffer); //history buffer

  • ShowCategory6Screen(title_id,title_icon_id,left_softkey_id,left_softkey_icon_id,right_softkey_id,right_softkey_icon_id, //Common screen data

  • number_of_items, //Number of items

    • subMenuData, //List of text items

    • subHintData, //list of descriptions

    • default_highlighted_item, //This is the default item that will be highlighted (if there is no history)

    • guiBuffer); //history buffer

  • ShowCategory55Screen(title_id,title_icon_id,left_softkey_id,left_softkey_icon_id,right_softkey_id,right_softkey_icon_id, //Common screen data

  • number_of_items, //Number of items

    • list_of_items, //List of text items

    • subHintData, //list of descriptions

    • default_highlighted_item, //This is the default item that will be highlighted (if there is no history)

    • guiBuffer); //history buffer


  • 3 1 1 2 1 scr menu icontextlist1
    3.1.1.2.1 Scr – Menu – IconTextList1

    • U8 subMenuData[MAX_SUB_MENUS][MAX_SUB_MENU_SIZE];

    • U16 list_of_items[MAX_SUB_MENUS];

    • U16 list_of_icons[MAX_SUB_MENUS];

    • U8 subHintData[MAX_SUB_MENUS][MAX_SUB_MENU_HINT_SIZE];

    • S32 number_of_items = 0;

    • S32 default_highlighted_item = 0;

    • U8* guiBuffer;

    • S32 i = 0;

    • EntryNewScreen(NEW_SCREEN_ID, ExitFunction, Entryfunction, NULL);

    • guiBuffer = GetCurrGuiBuffer (NEW_SCREEN_ID);

    • number_of_items = GetNumOfChild( CURRENT_PARENT_ITEM_ID );

    • GetSequenceStringIds(CURRENT_PARENT_ITEM_ID , list_of_items);

    • GetSequenceImageIds(CURRENT_PARENT_ITEM_ID , list_of_icons);

    • SetParentHandler(CURRENT_PARENT_ITEM_ID );

    • RegisterHighlightHandler(ExecuteCurrHiliteHandler);

    • for (i=0;i<number_of_items;i++)

    • subMenuData[i]=(PU8)get_string(list_of_items[i]);

    • ShowCategory15Screen(title_id,title_icon_id,left_softkey_id,left_softkey_icon_id,right_softkey_id,right_softkey_icon_id, //Common screen data

    • number_of_items, //Number of items

      • list_of_items, //List of text items

      • list_of_icons, //list of descriptions

      • LIST_MENU, //flags, LIST_MENU or MATRIX_MENU

      • default_highlighted_item, //This is the default item that will be highlighted (if there is no history)

      • guiBuffer); //history buffer

  • ShowCategory52Screen(title_id,title_icon_id,left_softkey_id,left_softkey_icon_id,right_softkey_id,right_softkey_icon_id, //Common screen data

  • number_of_items, //Number of items

    • list_of_items, //List of text items

    • list_of_icons, //list of descriptions

    • subHintData, //list of descriptions

    • 0, //flags, unused

    • default_highlighted_item, //This is the default item that will be highlighted (if there is no history)

    • guiBuffer); //history buffer

  • ShowCategory53Screen(title_id,title_icon_id,left_softkey_id,left_softkey_icon_id,right_softkey_id,right_softkey_icon_id, //Common screen data

  • number_of_items, //Number of items

    • subMenuData, //List of text items

    • list_of_icons, //list of descriptions

    • subHintData, //list of descriptions

    • 0, //flags, unused

    • default_highlighted_item, //This is the default item that will be highlighted (if there is no history)

    • guiBuffer); //history buffer


  • 3 1 1 2 2 scr menu icontextlist2
    3.1.1.2.2 Scr – Menu – IconTextList2

    • pBOOL get_item_func(S32 item_index, UI_string_type str_buff, UI_image_type* img_buff_p, U8 str_img_mask )

    • {

    • pfnUnicodeStrcpy((S8*) str_buff, (S8*)g_my_items[store_index]);

    • *img_buff_p = g_my_icons[store_index];

    • }

    • S32 get_hint_func( S32 item_index, UI_string_type *hint_array )

    • {

    • pfnUnicodeStrcpy((S8*)hint_array[0], (S8*)g_my_hints[item_index]);

    • }

    • void MyHighlightHandler(S32 nIndex)

    • {

    • g_my_activate_item = nIndex;

    • }

    • S32 number_of_items = 0;

    • S32 default_highlighted_item = 0;

    • U8* guiBuffer;

    • S32 i = 0;

    • EntryNewScreen(NEW_SCREEN_ID, ExitFunction, Entryfunction, NULL);

    • guiBuffer = GetCurrGuiBuffer (NEW_SCREEN_ID);

    • number_of_items = 100;

    • RegisterHighlightHandler(MyHighlightHandler);

    • //Dynamic fixed list

    • ShowCategory184Screen( title_id,title_icon_id,left_softkey_id,left_softkey_icon_id,right_softkey_id,right_softkey_icon_id, //Common screen data

    • number_of_items, //Number of items

      • get_item_func, //function pointer to get next displayed items

      • get_hint_func, //function pointer to get next displayed hint data

      • default_highlighted_item, //This is the default item that will be highlighted (if there is no history)

      • guiBuffer); //history buffer


    3 1 1 3 scr menu radioboxlist
    3.1.1.3 Scr – Menu – RadioBoxList

    • void MyHighlightHandler(S32 nIndex)

    • {

    • g_my_activate_item = nIndex;

    • }

    • Void MyLeftSoftkeyFunction()

    • {

    • ………… //use g_my_activate_item

    • }

    • U8 subMenuData[MAX_SUB_MENUS][MAX_SUB_MENU_SIZE];

    • U16 list_of_items[MAX_SUB_MENUS];

    • S32 number_of_items = 0;

    • S32 default_highlighted_item = 0;

    • U8* guiBuffer;

    • S32 i = 0;

    • EntryNewScreen(NEW_SCREEN_ID, ExitFunction, Entryfunction, NULL);

    • guiBuffer = GetCurrGuiBuffer (NEW_SCREEN_ID);

    • number_of_items = GetNumOfChild( CURRENT_PARENT_ITEM_ID );

    • GetSequenceStringIds(CURRENT_PARENT_ITEM_ID , list_of_items);

    • SetParentHandler(CURRENT_PARENT_ITEM_ID );

    • RegisterHighlightHandler(MyHighlightHandler);

    • for (i=0;i<number_of_items;i++)

    • subMenuData[i]=(PU8)get_string(list_of_items[i]);

    • ShowCategory11Screen(title_id,title_icon_id,left_softkey_id,left_softkey_icon_id,right_softkey_id,right_softkey_icon_id, //Common screen data

    • number_of_items, //Number of items

      • list_of_items, //List of text items

      • default_highlighted_item, //This is the default item that will be highlighted (if there is no history)

      • guiBuffer); //history buffer

  • ShowCategory36Screen(title_id,title_icon_id,left_softkey_id,left_softkey_icon_id,right_softkey_id,right_softkey_icon_id, //Common screen data

  • number_of_items, //Number of items

    • subMenuData, //List of text items

    • default_highlighted_item, //This is the default item that will be highlighted (if there is no history)

    • guiBuffer); //history buffer

  • SetLeftSoftkeyFunction( MyLeftSoftkeyFunction, KEY_EVENT_UP);


  • 3 1 1 4 scr menu checkboxlist
    3.1.1.4 Scr – Menu – CheckBoxList

    • void MyHighlightHandler(S32 nIndex)

    • {

    • g_my_activate_item = nIndex;

    • }

    • Void MyLeftSoftkeyFunction()

    • {

    • ………… //use g_my_activate_item

    • standard_check_list_handle_item_select(g_my_activate_item);

    • }

    • U16 list_of_items[MAX_SUB_MENUS];

    • U8 list_of_status[MAX_SUB_MENUS];

    • S32 number_of_items = 0;

    • S32 default_highlighted_item = 0;

    • U8* guiBuffer;

    • S32 i = 0;

    • EntryNewScreen(NEW_SCREEN_ID, ExitFunction, Entryfunction, NULL);

    • guiBuffer = GetCurrGuiBuffer (NEW_SCREEN_ID);

    • number_of_items = GetNumOfChild( CURRENT_PARENT_ITEM_ID );

    • GetSequenceStringIds(CURRENT_PARENT_ITEM_ID , list_of_items);

    • SetParentHandler(CURRENT_PARENT_ITEM_ID );

    • RegisterHighlightHandler(MyHighlightHandler);

    • ………………………… //Init list_of_status

    • ShowCategory13Screen(title_id,title_icon_id,left_softkey_id,left_softkey_icon_id,right_softkey_id,right_softkey_icon_id, //Common screen data

    • number_of_items, //Number of items

      • list_of_items, //List of text items

      • default_highlighted_item, //This is the default item that will be highlighted (if there is no history)

      • guiBuffer); //history buffer

  • SetLeftSoftkeyFunction( MyLeftSoftkeyFunction, KEY_EVENT_UP);


  • 3 1 1 4 scr menu severalcolslist
    3.1.1.4 Scr – Menu – SeveralColsList

    • U8 subMenuData[MAX_SUB_MENUS][MAX_SUB_MENU_SIZE];

    • U16 list_of_items[MAX_SUB_MENUS];

    • U16 list_of_icons1[MAX_SUB_MENUS];

    • U16 list_of_icons2[MAX_SUB_MENUS];

    • U8 subHintData[MAX_SUB_MENUS][MAX_SUB_MENU_HINT_SIZE];

    • S32 number_of_items = 0;

    • S32 default_highlighted_item = 0;

    • U8* guiBuffer;

    • S32 i = 0;

    • EntryNewScreen(NEW_SCREEN_ID, ExitFunction, Entryfunction, NULL);

    • guiBuffer = GetCurrGuiBuffer (NEW_SCREEN_ID);

    • number_of_items = GetNumOfChild( CURRENT_PARENT_ITEM_ID );

    • GetSequenceStringIds(CURRENT_PARENT_ITEM_ID , list_of_items);

    • SetParentHandler(CURRENT_PARENT_ITEM_ID );

    • RegisterHighlightHandler(ExecuteCurrHiliteHandler);

    • for (i=0;i<number_of_items;i++)

    • subMenuData[i]=(PU8)get_string(list_of_items[i]);

    • ………………………… //Init list_of_icons1 and list_of_icons2

    • ShowCategory73Screen(title_id,title_icon_id,left_softkey_id,left_softkey_icon_id,right_softkey_id,right_softkey_icon_id, //Common screen data

    • number_of_items, //Number of items

      • subMenuData, //List of text items

      • list_of_icons1, //list of icons1

      • list_of_icons2, //list of icons2

      • default_highlighted_item, //This is the default item that will be highlighted (if there is no history)

      • guiBuffer, 0); //history buffer


    3 1 1 5 scr menu inlineeditlist
    3.1.1.5 Scr – Menu – InlineEditList

    • void MyHighlightHandler(S32 nIndex)

    • {

      • switch(nIndex)

      • {

      • Case 0:

      • ……

      • Default:

      • ……

      • }

    • }

    • U16 list_of_icons[MAX_SUB_MENUS];

    • S32 number_of_items = 0;

    • S32 default_highlighted_item = 0;

    • U8* guiBuffer;

    • S32 i = 0;

    • EntryNewScreen(NEW_SCREEN_ID, ExitFunction, Entryfunction, NULL);

    • guiBuffer = GetCurrGuiBuffer (NEW_SCREEN_ID);

    • RegisterHighlightHandler(MyHighlightHandler);

    • SetInlineItemActivation((&wgui_inline_items[0]),INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,0);

    • SetInlineItemDisplayOnly((&wgui_inline_items[0]),(U8*)my_string);

    • SetInlineItemActivation( (&wgui_inline_items[1]), INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,0);

    • SetInlineItemTextEdit( (&wgui_inline_items[1]), (PU8)my_text_buffer, 3,INPUT_TYPE_NUMERIC);

    • ………………………………………..//more inline item see 3.2.7

    • ShowCategory57Screen(title_id,title_icon_id,left_softkey_id,left_softkey_icon_id,right_softkey_id,right_softkey_icon_id, //Common screen data

    • number_of_items, //Number of items

      • subMenuData, //List of text items

      • list_of_icons, //list of icons1

      • wgui_inline_items, //See InlineItem structure

      • default_highlighted_item, //This is the default item that will be highlighted (if there is no history)

      • guiBuffer, 0); //history buffer


    3 1 2 scr msgbox
    3.1.2 Scr – MsgBox

    • U16 message_string_id;

    • S8* message_string_buffer;

    • S8* message_string_buffer2;

    • U16 message_icon_id;

    • U8* guiBuffer;

    • EntryNewScreen(NEW_SCREEN_ID, ExitFunction, Entryfunction, NULL);

    • guiBuffer = GetCurrGuiBuffer (NEW_SCREEN_ID);

    • message_string_id = MY_MESSAGE_ID;

    • Message_icon_id = MY_MESSAGE_ICON_ID;

    • Message_string_buffer = GetString(MY_MESSAGE_ID);

    • Message_string_buffer2 = GetString(MY_MESSAGE_ID2);

    • ShowCategory8Screen(

    • title_id,title_icon_id,left_softkey_id,left_softkey_icon_id,right_softkey_id,right_softkey_icon_id, //Common screen data

    • message_string_id, //Notification message

    • message_icon_id, //Notification image

      • guiBuffer); //history buffer

  • ShowCategory74Screen(

  • title_id,title_icon_id,left_softkey_id,left_softkey_icon_id,right_softkey_id,right_softkey_icon_id, //Common screen data

  • message_string_buffer, //Notification message

  • 100, //Notification message size

    • guiBuffer); //history buffer

  • ShowCategory154Screen(

  • title_id,title_icon_id,left_softkey_id,left_softkey_icon_id,right_softkey_id,right_softkey_icon_id, //Common screen data

  • message_string_buffer, //Notification message1

  • message_string_buffer2, //Notification message2

  • message_icon_id, //Notification image

    • guiBuffer); //history buffer


  • 3 1 3 scr public
    3.1.3 Scr – Public

    • S8 string_buffer[100];

    • U16 message_icon_id;

    • U8* guiBuffer;

    • EntryNewScreen(NEW_SCREEN_ID, ExitFunction, Entryfunction, NULL);

    • guiBuffer = GetCurrGuiBuffer (NEW_SCREEN_ID);

    • ShowCategory5Screen(

    • title_id,title_icon_id,left_softkey_id,left_softkey_icon_id,right_softkey_id,right_softkey_icon_id, //Common screen data

    • INPUT_TYPE_ALPHANUMERIC_SENTENCECASE, //input_type, Type of input to use

    • string_buffer, //Buffer the input box should use.Size of the buffer

    • 100, //Size of the buffer

      • guiBuffer); //history buffer


    3 2 1 1 comp menu menuitems wgui
    3.2.1.1 Comp – Menu & Menuitems(WGUI)

    Menuitems related functions

    • Create menuitems

      • create_fixed_text_menuitems

      • create_fixed_icontext_menuitems

      • create_fixed_icontext_list_menuitems

      • create_fixed_twostate_menuitems

    • Add menuitem

      • add_fixed_icontext_item

      • add_fixed_icontext_items

      • add_location_fixed_icontext_item

      • add_fixed_text_item

      • add_fixed_text_items

      • add_location_fixed_text_item

      • add_fixed_twostate_item

      • add_fixed_twostate_items

      • add_location_fixed_twostate_item

      • add_fixed_icontext_list_item_icon

      • add_fixed_icontext_list_item_text

    • Set menuitems

      • resize_fixed_icontext_menuitems

      • resize_fixed_text_menuitems

      • resize_fixed_twostate_menuitems

      • resize_fixed_icontext_list_menuitems

      • set_fixed_icontext_positions

      • set_fixed_twostate_positions

    Menu related functions

    • Create menu

      • void create_fixed_list(void);

      • void create_fixed_matrix(void);

    • Associate menu and menuitems

      • associate_fixed_icontext_list

      • associate_fixed_icontext_list_list

      • associate_fixed_icontext_list_matrix

      • associate_fixed_icontext_matrix

      • associate_fixed_multirow_list_list

      • associate_fixed_text_list

      • associate_fixed_text_matrix

      • associate_fixed_twostate_list

      • associate_fixed_twostate_matrix

    • Register menu key handler

      • register_fixed_list_keys

      • register_fixed_list_shortcut_handler

      • register_fixed_matrix_keys

      • register_fixed_matrix_shortcut_handler

    • Register highlight handler

      • register_fixed_list_highlight_handler

      • register_fixed_list_unhighlight_handler

      • register_fixed_matrix_highlight_handler

    • Set menu

      • void move_fixed_list(s32 x,s32 y)

      • void move_fixed_matrix(s32 x,s32 y)

      • void resize_fixed_list(s32 width,s32 height)

      • void resize_fixed_matrix(s32 width,s32 height)

    • Show menu

      • void redraw_fixed_list(void)

      • void show_fixed_list(void)

      • void show_fixed_matrix(void)


    3 2 1 2 comp menu example wgui
    3.2.1.2 Comp – Menu Example(WGUI)

    // Step 1, Create menu

    create_fixed_list();

    // Step 2, Create menuitems

    create_fixed_icontext_menuitems();

    // Step 3, Associate menu and menuitems

    associate_fixed_icontext_list();

    // Step 4, Set menuitems data

    for(i=0;i<number_of_items;i++)

    add_fixed_icontext_item(list_of_items[i],list_of_icons[i]);

    // Step 5, Register menu key handler

    register_fixed_list_shortcut_handler();

    register_fixed_list_keys();

    // Step 6, Register menu highlight handler

    register_fixed_list_highlight_handler(standard_list_highlight_handler);

    // Step 7, Set menu

    move_fixed_list(0,(MMI_title_y+MMI_title_height));

    resize_fixed_list(MMI_content_width,MMI_content_height);

    // Step 7, Set menuitems

    resize_fixed_icontext_menuitems(0,MMI_MENUITEM_HEIGHT);

    set_fixed_icontext_positions( MMI_ICONTEXT_MENUITEM_HEIGHT+2,0,1,0);

    // Step 8, Show menu

    Show_fixed_list();


    3 2 1 3 comp menu gui
    3.2.1.3 Comp – Menu(GUI)

    Fixed matrix menu functions

    • Create menu

      • pixtel_UI_create_fixed_matrix_menu

    • Set menu

      • pixtel_UI_set_fixed_matrix_menu_current_theme

      • pixtel_UI_set_fixed_matrix_menu_theme

      • pixtel_UI_fixed_matrix_menu_auto_configure

      • pixtel_UI_fixed_matrix_menu_setup

      • pixtel_UI_resize_fixed_matrix_menu

      • pixtel_UI_move_fixed_matrix_menu

    • Menu goto functions

      • pixtel_UI_fixed_matrix_menu_locate_highlighted_item

      • pixtel_UI_fixed_matrix_menu_goto_next_item

      • pixtel_UI_fixed_matrix_menu_goto_previous_item

      • pixtel_UI_fixed_matrix_menu_goto_previous_row

      • pixtel_UI_fixed_matrix_menu_goto_next_row

      • pixtel_UI_fixed_matrix_menu_goto_previous_column

      • pixtel_UI_fixed_matrix_menu_goto_next_column

      • pixtel_UI_fixed_matrix_menu_goto_first_item

      • pixtel_UI_fixed_matrix_menu_goto_last_item

      • pixtel_UI_fixed_matrix_menu_goto_next_page

      • pixtel_UI_fixed_matrix_menu_goto_previous_page

      • pixtel_UI_fixed_matrix_menu_goto_item

    • Set menuitems functions

      • pixtel_UI_set_fixed_matrix_menu_item_functions

      • pixtel_UI_set_fixed_matrix_menu_common_item_data

    • Show menu

      • pixtel_UI_show_fixed_matrix_menu

    Fixed list menu functions

    • Create menu

      • pixtel_UI_create_fixed_list_menu

    • Set menu

      • pixtel_UI_set_fixed_list_menu_current_theme

      • pixtel_UI_set_fixed_list_menu_theme

      • pixtel_UI_resize_fixed_list_menu

      • pixtel_UI_move_fixed_list_menu

    • Menu goto functions

      • pixtel_UI_fixed_list_menu_goto_item

      • pixtel_UI_fixed_list_menu_goto_next_item

      • pixtel_UI_fixed_list_menu_goto_previous_item

      • pixtel_UI_fixed_list_menu_goto_next_page

      • pixtel_UI_fixed_list_menu_goto_previous_page

      • pixtel_UI_fixed_list_menu_goto_first_item

      • pixtel_UI_fixed_list_menu_goto_last_item

    • Set menuitems functions

      • pixtel_UI_set_fixed_list_menu_item_functions

      • pixtel_UI_set_fixed_list_menu_common_item_data

    • Show menu

      • pixtel_UI_show_fixed_list_menu


    3 2 1 4 comp menuitem gui
    3.2.1.4 Comp – MenuItem(GUI)

    Icontext

    • Create

      • pixtel_UI_create_fixed_icontext_menuitem

    • Set

      • pixtel_UI_set_fixed_icontext_menuitem_current_theme

      • pixtel_UI_set_fixed_icontext_menuitem_theme

      • pixtel_UI_fixed_icontext_menuitem_set_text_position

      • pixtel_UI_fixed_icontext_menuitem_set_icon_position

      • pixtel_UI_resize_fixed_icontext_menuitem

    • Item functions

      • pixtel_UI_hide_fixed_icontext_menuitem

      • pixtel_UI_measure_fixed_icontext_menuitem

      • pixtel_UI_highlight_fixed_icontext_menuitem

      • pixtel_UI_remove_highlight_fixed_icontext_menuitem

    • Show

      • pixtel_UI_show_fixed_icontext_menuitem

    Text functions

    • Create

      • pixtel_UI_create_fixed_text_menuitem

    • Set

      • pixtel_UI_set_fixed_text_menuitem_theme

      • pixtel_UI_set_fixed_text_menuitem_current_theme

      • pixtel_UI_fixed_text_menuitem_set_text_position

      • pixtel_UI_resize_fixed_text_menuitem

    • Item functions

      • pixtel_UI_measure_fixed_text_menuitem

      • pixtel_UI_highlight_fixed_text_menuitem

      • pixtel_UI_remove_highlight_fixed_text_menuitem

    • Show

      • pixtel_UI_show_fixed_text_menuitem

    Icontext list

    • Create

      • pixtel_UI_create_fixed_icontext_list_menuitem

    • Set

      • pixtel_UI_set_fixed_icontext_list_menuitem_current_theme

      • pixtel_UI_set_fixed_icontext_list_menuitem_theme

      • pixtel_UI_fixed_icontext_list_menuitem_set_post_display

      • pixtel_UI_fixed_icontext_list_menuitem_set_text_coordinates

      • pixtel_UI_fixed_icontext_list_menuitem_set_icon_coordinates

      • pixtel_UI_resize_fixed_icontext_list_menuitem

    • Item functions

      • pixtel_UI_measure_fixed_icontext_list_menuitem

      • pixtel_UI_highlight_fixed_icontext_list_menuitem

      • pixtel_UI_remove_highlight_fixed_icontext_list_menuitem

    • Show

      • pixtel_UI_show_fixed_icontext_list_menuitem

    Twostate

    • Create

      • pixtel_UI_create_fixed_twostate_menuitem

    • Set

      • pixtel_UI_set_fixed_twostate_menuitem_current_theme

      • pixtel_UI_set_fixed_twostate_menuitem_theme

      • pixtel_UI_fixed_twostate_menuitem_set_text_position

      • pixtel_UI_fixed_twostate_menuitem_set_icon_position

      • pixtel_UI_fixed_twostate_menuitem_set_icons

      • pixtel_UI_resize_fixed_twostate_menuitem

    • Item functions

      • pixtel_UI_measure_fixed_twostate_menuitem

      • pixtel_UI_highlight_fixed_twostate_menuitem

      • pixtel_UI_remove_highlight_fixed_twostate_menuitem

    • Show

      • pixtel_UI_show_fixed_twostate_menuitem


    3 2 1 5 comp fixed list menu example gui
    3.2.1.5 Comp – Fixed list menu Example(GUI)

    fixed_text_menuitem common_item; // common item data

    fixed_text_menuitem_type item_list [10]; // 10 items in the list

    void * item_pointers [10]; // 10 item pointers for the 10 items

    fixed_list_menu demo_menu; // sample fixed menu

    /* Initialization */

    for( k=0; k<10; k++)

    { item_pointers[k]=(void*) item_list[k]; // initialize the list of pointers

    }

    item_list[0].text=”one”; // add the items

    item_list[1].text=”two”;

    ….

    Item_list[9].text=”nine”;

    /* Association with a fixed list menu */

    pixtel_UI_create_fixed_list_menu(&demo_menu,0,0,120,120);

    demo_menu.n_items=10;

    demo_menu.items=item_pointers;

    demo_menu.common_item_data=&common_item;

    pixtel_UI_set_fixed_list_menu_item_functions(&demo_menu,

    pixtel_UI_show_fixed_text_menuitem, // Display function

    pixtel_UI_measure_fixed_text_menuitem, // Measure function

    pixtel_UI_highlight_fixed_text_menuitem, // Highlight function

    pixtel_UI_remove_highlight_fixed_text_menuitem, // Remove highlight function

    dummy_function); // Hide function (In this case a dummy)

    pixtel_UI_show_fixed_list_menu(&demo_menu); // Display the fixed menu


    3 2 1 6 comp fixed matrix menu example gui
    3.2.1.6 Comp – Fixed matrix menu Example(GUI)

    fixed_text_menuitem common_item; // common item data

    fixed_text_menuitem_type item_list [10]; // 10 items in the list

    void * item_pointers [10]; // 10 item pointers for the 10 items

    fixed_matrix_menu demo_menu;

    /* Initialization */

    for( k=0; k<10; k++)

    { item_pointers[k]=(void*) item_list[k]; // initialize the list of pointers

    }

    item_list[0].text=”one”; // add the items

    item_list[1].text=”two”;

    ….

    Item_list[9].text=”nine”;

    /* Association with the fixed matrix menu */

    pixtel_UI_create_fixed_matrix_menu(&demo_menu,0,0,120,120);

    pixtel_UI_fixed_matrix_setup(&demo_menu,32,32,3,0); // 3 columns, n rows

    demo_menu.n_items=10;

    demo_menu.items=item_pointers;

    demo_menu.common_item_data=&common_item;

    pixtel_UI_set_fixed_matrix_menu_item_functions(&demo_menu,

    pixtel_UI_show_fixed_text_menuitem, // Display function

    pixtel_UI_measure_fixed_text_menuitem, // Measure function

    pixtel_UI_highlight_fixed_text_menuitem, // Highlight function

    pixtel_UI_remove_highlight_fixed_text_menuitem, // Remove highlight function

    dummy_function); // Hide function (In this case a dummy)

    pixtel_UI_show_fixed_matrix_menu(&demo_menu); // Display the fixed menu


    3 2 2 1 comp button gui
    3.2.2.1 Comp – Button(GUI)

    Text button functions

    • Create

      • pixtel_UI_create_text_button

    • Set

      • pixtel_UI_set_text_button_current_theme

      • pixtel_UI_set_text_button_theme

      • pixtel_UI_set_text_button_BG_theme

      • pixtel_UI_text_button_set_text_position

    • Show

      • pixtel_UI_show_text_button

    Button functions

    • Create

      • pixtel_UI_create_button

    • Set

      • pixtel_UI_set_button_current_theme

      • pixtel_UI_set_button_theme

    • Show

      • pixtel_UI_show_button

    Icon button functions

    • Create

      • pixtel_UI_create_icon_button

    • Set

      • pixtel_UI_set_icon_button_current_theme

      • pixtel_UI_set_icon_button_theme

      • pixtel_UI_set_icon_button_BG_theme

      • pixtel_UI_resize_icon_button

      • pixtel_UI_move_icon_button

      • pixtel_UI_icon_button_set_icon_positon

      • pixtel_UI_icon_button_set_icon

    • Show

      • pixtel_UI_show_icon_button

    Icontext button functions

    • Create

      • pixtel_UI_create_icontext_button

    • Set

      • pixtel_UI_set_icontext_button_current_theme

      • pixtel_UI_set_icontext_button_theme

      • pixtel_UI_set_icontext_button_BG_theme

      • pixtel_UI_resize_icontext_button

      • pixtel_UI_move_icontext_button

      • pixtel_UI_icontext_button_set_icon_positon

      • pixtel_UI_icontext_button_set_text_position

      • pixtel_UI_icontext_button_set_icon

    • Show

      • pixtel_UI_show_icontext_button


    3 2 3 1 comp scrollbar gui
    3.2.3.1 Comp – Scrollbar(GUI)

    Slide functions

    • Create

      • pixtel_UI_create_vertical_slide

    • Set

      • pixtel_UI_set_vertical_slide_current_theme

      • pixtel_UI_set_vertical_slide_theme

      • pixtel_UI_set_vertical_slide_range

      • pixtel_UI_set_vertical_slide_value

      • pixtel_UI_set_vertical_slide_scale

      • pixtel_UI_move_vertical_slide

      • pixtel_UI_resize_vertical_slide

    • Show

      • pixtel_UI_show_vertical_slide

    Scrollbar functions

    • Create

      • pixtel_UI_create_vertical_scrollbar

    • Set

      • pixtel_UI_set_vertical_scrollbar_current_theme

      • pixtel_UI_set_vertical_scrollbar_theme

      • pixtel_UI_set_vertical_scrollbar_range

      • pixtel_UI_set_vertical_scrollbar_value

      • pixtel_UI_set_vertical_scrollbar_scale

      • pixtel_UI_move_vertical_scrollbar

      • pixtel_UI_resize_vertical_scrollbar

    • Show

      • pixtel_UI_show_vertical_scrollbar

    Progress indicator functions

    • Create

      • pixtel_UI_create_vertical_progress_indicator

    • Set

      • pixtel_UI_set_vertical_progress_indicator_theme

      • pixtel_UI_set_vertical_progress_indicator_range

      • pixtel_UI_set_vertical_progress_indicator_value

    • Show

      • pixtel_UI_show_vertical_progress_indicator


    3 2 3 2 comp scrollbar example
    3.2.3.2 Comp – Scrollbar Example

    Scrollbar:

    // create the scrollbar

    vertical_scrollbar vbar;

    pixtel_UI_create_vertical_scrollbar(&vbar,100,10,8,60);

    // set the range and scale and value

    pixtel_UI_set_vertical_scrollbar_range(&vbar, 100); // for example to display 100 items in a list view

    pixtel_UI_set_vertical_scrollbar_scale(&vbar,6); // for example, 6 items displayed at a time in the list

    pixtel_UI_set_vertical_scrollbar_value(&vbar,0); // for example, at first item in the list view

    // show vertical scrollbar

    pixtel_UI_show_vertical_scrollbar(&vbar);

    Slide:

    // create the slide

    vertical_slide slide;

    pixtel_UI_create_vertical_slide(&slide,0,0,8,100);

    // set the range and scale and value

    pixtel_UI_set_vertical_slide_range(&slide,100);

    pixtel_UI_set_vertical_slide_value(&slide,66);

    pixtel_UI_set_vertical_slide_scale(&slide,15);

    // show vertical slide

    pixtel_UI_show_vertical_slide(&slide);

    Progress:

    // create the progress indicator

    horizontal_progress_indicator b;

    pixtel_UI_create_horizontal_progress_indicator(&b, 10,10,100,15);

    // set the range and scale and value

    pixtel_UI_set_horizontal_progress_indicator_range(&b, 100);

    pixtel_UI_set_horizontal_progress_indicator_value(&b, 33);

    // show horizontal progress

    pixtel_UI_show_horizontal_progress_indicator(&b);


    3 2 4 comp statusbar
    3.2.4 Comp – Statusbar

    Statusbar example:

    //Enable status icon bar(show screen):

    show_status_icon_bar(0);

    show_status_icon_bar(1);

    show_status_icon_bar(2);

    //show all three status bar(redraw screen):

    show_status_icons();

    //Close all three status bar(exit screen):

    close_status_icons();

    Statusbar icons related functions:

    void ShowStatusIcon(s16 icon_ID);

    void HideStatusIcon(s16 icon_ID);

    void disable_status_icon(s16 icon_ID);

    void enable_status_icon(s16 icon_ID);

    void ChangeStatusIconLevel(s16 icon_ID,byte level_percentage);

    void ChangeStatusIconImage(s16 icon_ID, U16 image_ID);

    void AnimateStatusIcon(s16 icon_ID);

    void BlinkStatusIcon(s16 icon_ID);

    void set_status_icon_state(s16 icon_ID,byte state);

    void reset_status_icon_state(s16 icon_ID);


    3 2 5 comp scrolling text
    3.2.5 Comp – Scrolling text

    scrolling_text g_scrolling_text; //My scrolling text

    //Timer callback

    void timer_callback(void)

    {

    pixtel_UI_handle_scrolling_text( &g_scrolling_text);

    }

    //Draw background callback

    void draw_background(S32 x1, S32 y1, S32 x2, S32 y2)

    {

    color bg_color = pixtel_UI_color( 0, 255, 255 );

    pixtel_UI_push_clip();

    pixtel_UI_set_clip(x1, y1, x2, y2);

    pixtel_UI_fill_rectangle(x1,y1,x2,y2, bg_color);

    pixtel_UI_pop_clip();

    }

    //Create and show scrolling text

    void show_my_scrolling_text()

    {

    UI_character_type str[] = L”Show scrolling text”;

    color text_color = pixtel_UI_color( 255, 255, 255 );

    color border_color = pixtel_UI_color( 0, 0, 0 );

    pixtel_UI_create_scrolling_text( &g_scrolling_text,10, 10, 100, 20, str,

    timer_callback, draw_background, text_color, border_color);

    pixtel_UI_show_scrolling_text(&g_scrolling_text);

    }


    3 2 6 comp popup description
    3.2.6 Comp – Popup description

    //Step 1, Create popup description

    UI_pop_up_description my_desc;

    UI_character_type str[] = L”My popup description”;

    pixtel_UI_create_pop_up_description( &my_desc, 10, 10, 100, 20 );

    //Step 2, Set popup description

    pixtel_UI_set_pop_up_description_current_theme( &my_desc);

    pixtel_UI_set_pop_up_description_n_strings(&my_desc , 1);

    pixtel_UI_set_pop_up_description_text( &my_desc, 0, str);

    //Step 3, Show popup description

    pixtel_UI_show_pop_up_description(&my_desc);

    pixtel_UI_pop_up_description_start_scroll(&my_desc);

    //Step 4, Stop popup description

    pixtel_UI_pop_up_description_stop_scroll();


    3 2 7 1 comp inlineedit text
    3.2.7.1 Comp – InlineEdit – Text

    Full screen edit:

    void custom_setup_function(void)

    {

    ChangeLeftSoftkey (STR_GLOBAL_OPTIONS, IMG_GLOBAL_OPTIONS);

    SetLeftSoftkeyFunction(EntryScrForInputMethodAndDone, KEY_EVENT_UP);

    SetInputMethodAndDoneCaptionIcon(IMG_SCR_PBOOK_CAPTION);

    }

    UI_character_type my_string[100];

    SetInlineItemActivation(&wgui_inline_items[inline_item_index],KEY_LSK,KEY_EVENT_UP);

    SetInlineItemFullScreenEdit( &wgui_inline_items[inline_item_index],TITLE_ID, TITLE_ICON_ID, (PU8)my_string,100, INPUT_TYPE_ALPHANUMERIC_SENTENCECASE );

    SetInlineFullScreenEditCustomFunction(&wgui_inline_items[inline_item_index], custom_setup_function);

    Text edit:

    UI_character_type my_string[100];

    SetInlineItemTextEdit( &wgui_inline_items[inline_item_index], (U8*)PU8)my_string, 100, INPUT_TYPE_DECIMAL_NUMERIC );

    Multiline edit:

    UI_character_type my_string[100];

    SetInlineItemMultiLineEdit( &wgui_inline_items[inline_item_index], my_string,

    (U8*)GetString(STR_EMAIL_SIGNATURE_TEXT),

    100, INPUT_TYPE_ALPHANUMERIC_SENTENCECASE );

    Multiline read only:

    UI_character_type my_string[100];

    SetInlineMultiLineRdOnly ( &wgui_inline_items[inline_item_index],

    (U8*)PU8)my_string, 100, INPUT_TYPE_USE_ENCODING_BASED_LENGTH |

    INPUT_TYPE_ALPHANUMERIC_SENTENCECASE, 3);


    3 2 7 2 comp inlineedit select
    3.2.7.2 Comp – InlineEdit – Select

    Select:

    S32 my_select_index = 0;

    S32 num_of_items = 3;

    UI_character_type list_of_items[3][] = {L”slect 1”, L”select 2”, L”selct 3”};

    SetInlineItemSelect(&(wgui_inline_items[inline_item_index]), num_of_items, (U8**)list_of_items, &my_select_index );

    Color select:

    void color_highlighted_callback(U16 index)

    {

    //Save index

    }

    U16 HilitedColor = 1;

    color color_list[3] = {{0,255,255}, {255,0,0}, {0,255,0}};

    SetInlineItemColorSelect(&wgui_inline_items[inline_item_index], 3, HilitedColor , color_list, color_highlighted_callback);

    User defined select:

    U8* current_item_callback()

    {

    return (U8*)L”index 2”;

    }

    U8* previous_item_callback()

    {

    return (U8*)L”index 1”;

    }

    U8* next_item_callback()

    {

    return (U8*)L”index 3”;

    }

    SetInlineItemUserDefinedSelect(&wgui_inline_items[inline_item_index],current_item_callback, previous_item_callback, next_item_callback);


    3 2 7 3 comp inlineedit datetime
    3.2.7.3 Comp – InlineEdit – DateTime

    Date:

    void DateEditorCallback(U8 *DateStr, U8 *day,U8 *month,U8 *year) //show date string callback

    {

    pfnUnicodeStrcpy((S8*)DateStr,(S8*)year); pfnUnicodeStrcat((S8*)DateStr,(S8*)"/");

    pfnUnicodeStrcat((S8*)DateStr,(S8*)month); pfnUnicodeStrcat((S8*)DateStr,(S8*)"/");

    pfnUnicodeStrcat((S8*)DateStr,(S8*)day);

    }

    SetInlineItemDate( (&(wgui_inline_items[inline_item_index]), (U8*)gDate,(U8*)gMonth,(U8*)gYear, DateEditorCallback);

    set_inline_date_boundary(2030, 2000, 12, 1); //year from 2000 to 2030,month from 1 to 12

    Time:

    void TimeEditorCallBack(U8 *string_buffer,U8* hours_buffer,U8* min_buffer,U8* AM_PM_flag)

    {

    pfnUnicodeStrcpy((S8*)string_buffer,(S8*)hours_buffer);

    pfnUnicodeStrcat((S8*)string_buffer,(S8*)":");

    pfnUnicodeStrcat((S8*)string_buffer,(S8*)min_buffer);

    }

    SetInlineItemTime (&wgui_inline_items[inline_item_index], (U8*)HourBuf, (U8*)MinBuf,NULL, TimeEditorCallBack);

    Time period:

    void TimeEditorCallBack(U8* string_buffer, U8* hours_buffer1, U8* minutes_buffer1, U8* AM_PM_flag1,

    U8* hours_buffer2,U8* minutes_buffer2,U8* AM_PM_flag2)

    {

    //Set string_buffer such as “12:30 – 17:50”

    }

    SetInlineItemTimePeriod(&(wgui_inline_items[inline_item_index]),(U8*)HourBuff1, (U8*)MinBuff1, NULL,

    (U8*)HourBuff2, (U8*)MinBuff2, NULL, TimeEditorCallBack);

    Dow(day of week) select:

    S32 HilitedDays = 3;

    U8 gDaysStates[7] = {1,0,0,0,1,1,0};

    SetInlineItemDOWSelect(&(wgui_inline_items[inline_item_index]),HilitedDays, gDaysStates);


    3 2 7 4 comp inlineedit common
    3.2.7.4 Comp – InlineEdit – Common

    Activation:

    S32 key_code = INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT; // Or KEY_0 to MAX_KEYS

    S32 key_event = 0; //Or KEY_EVENT_DOWN / KEY_EVENT_UP / KEY_LONG_PRESS / KEY_REPEAT

    SetInlineItemActivation(&(wgui_inline_items[inline_item_index]), key_code, key_event );

    Display only:

    SetInlineItemDisplayOnly(&(wgui_inline_items[inline_item_index]), my_string);

    Caption:

    SetInlineItemCaption(&wgui_inline_items[inline_item_index], (U8*)my_sting);

    Ip4 edit:

    void ip_addr_callback(U8* string_buffer,U8 *IP1,U8 *IP2,U8 *IP3,U8 *IP4)

    {

    //Set string_buffer such as “172.021.210.70”

    }

    UI_character_type ip_string[4][4]; //255.255.255.255

    SetInlineItemIP4(&wgui_inline_items[inline_item_index], ip_string[0], ip_string[1], ip_string[2], ip_string[3], ip_addr_callback);


    3 2 7 5 comp inlineedit set flag
    3.2.7.5 Comp – InlineEdit – Set flag

    • Follow

      • void SetInlineItemFollowUp(InlineItem *item,s32 index)

      • void SetInlineItemFollowDown(InlineItem *item,s32 index)

    • Width and Height

      • void DisableInlineItemHighlight(InlineItem *item)

      • void SetInlineItemFullWidth(InlineItem *item)

    • Justify

      • void LeftJustifyInlineItem(InlineItem *item)

      • void RightJustifyInlineItem(InlineItem *item)

      • void CenterJustifyInlineItem(InlineItem *item)

    • Boundary

      • void DisableInlineItemBoundary(InlineItem *item)

      • void EnableInlineItemBoundary(InlineItem *item)

    • DottedUnderline

      • void SetInlineItemDottedUnderline(InlineItem *item)


    3 2 8 comp title buttonbar
    3.2.8 Comp – Title & Buttonbar

    Title:

    //In show screen

    MMI_title_icon = MY_TITLE_ICON_ID;

    MMI_title_string = (U8*)L”my title”;

    //In redraw screen

    draw_title();

    //Other functions

    ChangeTitleString( (U8*)L”my title string” );

    ChangeTitleIcon( MY_TITLE_ICON_ID2 );

    ChangeTitle((U8*)L”my title string” , MY_TITLE_ICON_ID2 );

    draw_scrolling_title();

    close_scrolling_title();

    Buttonbar:

    show_softkey_background();

    draw_arrow_indication(left_enable, right_enable, up_enable, down_enable);

    show_left_softkey();

    show_right_softkey();

    show_softkey(MMI_LEFT_SOFTKEY|MMI_RIGHT_SOFTKEY|MMI_CENTER_SOFTKEY);



    3 3 2 1 prim string set show
    3.3.2.1 Prim – String – Set & Show

    stFontAttribute my_font = {0,/*bold*/ 0,/*italic*/ 0,/*underline*/ 2,/*size*/ 100,/*color*/ 2,/*type*/ 0,/*oblique*/ 0/*smallCaps*/};

    S32 line_height = 30;

    // Set attribute

    pixtel_UI_set_text_color(UI_COLOR_RED);

    pixtel_UI_set_text_border_color(UI_COLOR_GREEN);

    pixtel_UI_set_font(&my_font);

    // Print string

    pixtel_UI_move_text_cursor(5,1);

    pixtel_UI_print_character((UI_character_type)L'我');

    pixtel_UI_move_text_cursor(100,30);

    pixtel_UI_print_bordered_character((UI_character_type)L'我');

    pixtel_UI_move_text_cursor(4,60);

    pixtel_UI_set_line_height(line_height);

    pixtel_UI_print_text((UI_string_type)L"字符串:print_text");

    pixtel_UI_draw_rectangle(4,60,200,60+line_height,UI_COLOR_GREEN);

    pixtel_UI_move_text_cursor(0,100);

    pixtel_UI_print_bordered_text((UI_string_type)L"字符串:print_bordered_text");

    pixtel_UI_move_text_cursor(1,130);

    pixtel_UI_print_text_n((UI_string_type)L"字符串:print_text_n",6);

    pixtel_UI_move_text_cursor(10,160);

    pixtel_UI_print_bordered_text_n((UI_string_type)L"字符串:print_bordered_text_n",6);

    pixtel_UI_move_text_cursor(50,190);

    pixtel_UI_printf((UI_string_type)"printf-%d",line_height);


    3 3 2 2 prim string measure
    3.3.2.2 Prim – String – Measure

    S32 width = 0, height = 0;

    pixtel_UI_set_text_color(UI_COLOR_RED);

    pixtel_UI_set_text_border_color(UI_COLOR_GREEN);

    width = pixtel_UI_get_character_width((UI_character_type)L'我');

    pixtel_UI_move_text_cursor(10,10);

    pixtel_UI_printf((UI_string_type)"width = %d",width);

    height = pixtel_UI_get_character_height((UI_character_type)L'我');

    pixtel_UI_move_text_cursor(10,35);

    pixtel_UI_printf((UI_string_type)"height = %d", height);

    pixtel_UI_measure_character((UI_character_type)L'我', &width, &height);

    pixtel_UI_move_text_cursor(10,60);

    pixtel_UI_printf((UI_string_type)"width = %d height = %d",width, height);

    width = pixtel_UI_get_string_width((UI_string_type)L"字符串 String 123");

    pixtel_UI_move_text_cursor(10,85);

    pixtel_UI_printf((UI_string_type)"width = %d",width);

    width = pixtel_UI_get_string_width_n((UI_string_type)L"字符串 String 123", 7);

    pixtel_UI_move_text_cursor(10,110);

    pixtel_UI_printf((UI_string_type)"width = %d",width);

    height = pixtel_UI_get_string_height((UI_string_type)L"字符串 String 123");

    pixtel_UI_move_text_cursor(10,135);

    pixtel_UI_printf((UI_string_type)"height = %d", height);

    pixtel_UI_measure_string((UI_string_type)L"字符串 String 123", &width, &height);

    pixtel_UI_move_text_cursor(10,160);

    pixtel_UI_printf((UI_string_type)"width = %d height = %d",width, height);

    pixtel_UI_measure_string_n((UI_string_type)L"字符串 String 123", 8, &width, &height);

    pixtel_UI_move_text_cursor(10,185);

    pixtel_UI_printf((UI_string_type)"width = %d height = %d",width, height);


    3 3 3 1 prim image static
    3.3.3.1 Prim – Image – Static

    U16 image_id = MY_IMAGE_ID;

    UI_image_type image_ptr = (UI_image_type)GetImage(image_id);

    UI_string_type image_name = L"C:\\my_image.c";

    S32 offset_x = 10, offset_y = 10, resized_width = 120, resized_height = 150;

    S32 n_frames = 0, single_frame = 0, start_frame = 2;

    S32 width = 0, height = 0;

    U16 image_type = GDI_IMAGE_TYPE_INVALID;

    gdi_handle ani_handle = NULL;

    gdi_image_draw(offset_x, offset_y, image_ptr);

    gdi_image_draw_id(offset_x, offset_y, image_id);

    gdi_image_draw_file(offset_x, offset_y, image_name);

    gdi_image_draw_resized(offset_x, offset_y, resized_width, resized_height, image_ptr);

    gdi_image_draw_resized_id(offset_x, offset_y, resized_width, resized_height, image_id);

    gdi_image_draw_resized_file(offset_x, offset_y, resized_width, resized_height, image_name);

    gdi_image_draw_animation_single_frame(offset_x, offset_y, image_ptr, single_frame);

    gdi_image_draw_animation_single_frame_id(offset_x, offset_y, image_id, single_frame);

    gdi_image_get_frame_count(image_ptr, &n_frames);

    gdi_image_get_frame_count_id(image_id, &n_frames);

    gdi_image_get_dimension(image_ptr, &width, &height);

    gdi_image_get_dimension_id(image_id, &width, &height);

    gdi_image_get_dimension_file(image_name, &width, &height);

    image_type = gdi_image_get_type_from_file(image_name);

    image_type = gdi_image_get_type_from_id(image_id);


    3 3 3 2 prim image animation
    3.3.3.2 Prim – Image - animation

    U16 image_id = MY_IMAGE_ID;

    UI_image_type image_ptr = (UI_image_type)GetImage(image_id);

    UI_string_type image_name = L"C:\\my_image.c";

    S32 offset_x = 10, offset_y = 10, resized_width = 120, resized_height = 150;

    S32 n_frames = 0, single_frame = 0, start_frame = 2;

    S32 width = 0, height = 0;

    U16 image_type = GDI_IMAGE_TYPE_INVALID;

    gdi_handle ani_handle = NULL;

    gdi_image_draw_animation(offset_x, offset_y, image_ptr, &ani_handle);

    gdi_image_draw_animation_id(offset_x, offset_y, image_id, &ani_handle);

    gdi_image_draw_animation_frames_id(offset_x, offset_y, image_id, &ani_handle, start_frame);

    gdi_image_draw_animation_once_id(offset_x, offset_y, image_id, &ani_handle);

    gdi_image_draw_animation_frames(offset_x, offset_y, image_ptr, &ani_handle, start_frame);

    gdi_image_draw_animation_once(offset_x, offset_y, image_ptr, &ani_handle);

    gdi_image_draw_animation_file(offset_x, offset_y, image_name, &ani_handle);

    gdi_image_draw_animation_resized(offset_x, offset_y, resized_width, resized_height, image_ptr, &ani_handle);

    gdi_image_draw_animation_resized_file(offset_x, offset_y, resized_width, resized_height, image_name, &ani_handle);

    gdi_image_draw_animation_frames_file(offset_x, offset_y, image_name, &ani_handle, start_frame);


    3 3 4 1 prim grapha pixel line
    3.3.4.1 Prim – Grapha – Pixel & line

    color c = { 255, 0, 0, 100};

    U32 line_color = DRV_RGB_TO_HW(255,0,0);

    U8 bits[10] = {1,1,1,1,0,0,0,1,0,0};

    for (x1 = 20; x1 < 160; x1+=3)

    pixtel_UI_putpixel(x1, 10, c);

    pixtel_UI_draw_vertical_line(20, 160, 160, c);

    pixtel_UI_draw_horizontal_line(20,160, 20, c);

    pixtel_UI_line(20, 20, 160, 160 , c);

    pixtel_UI_wline(160, 22, 20, 160, c, 5);

    gdi_draw_line(30, 100, 80, 160, line_color);

    gdi_draw_line(20, 110, 90, 150, line_color);

    gdi_draw_line_style(80, 60, 120, 60, line_color, 10, bits);

    gdi_draw_line_style(120, 60, 120, 100, line_color, 10, bits);


    3 3 4 2 prim grapha rect
    3.3.4.2 Prim – Grapha – Rect

    gdi_color rect_color = DRV_RGB_TO_HW(255,0,0);

    gdi_color frame_color = DRV_RGB_TO_HW(0,255,0);

    gdi_color shadow_color = DRV_RGB_TO_HW(0,0,255);

    gdi_color rect_color_start = DRV_RGB_TO_HW(0,255,255);

    gdi_color rect_color_end = DRV_RGB_TO_HW(255,0,255);

    gdi_draw_rect(10, 10, 160, 30, frame_color);

    gdi_draw_solid_rect(10, 35, 160, 55, rect_color);

    gdi_draw_greyscale_rect(10, 60, 160, 80, 20);

    gdi_draw_frame_rect(10, 85, 160, 105, rect_color, frame_color, 3);

    gdi_draw_round_rect(10, 110, 160, 130, rect_color, frame_color, 2);

    gdi_draw_button_rect(10, 135, 160, 155,

    rect_color, frame_color, 3, 4, TRUE);

    gdi_draw_shadow_rect(10, 160, 160, 180,

    rect_color, frame_color, 2, shadow_color, 4);

    gdi_draw_gradient_rect(10, 190, 160, 210,

    rect_color_start, rect_color_end, frame_color, 3, 0);


    3 3 5 prim filled area
    3.3.5 Prim – Filled area

    color colors[] = {{0,0,0,100}, {255,255,0,100}, {0,255,0,100}, {0,0,255,100},{0,255,255}};

    byte pts[] = { 50,50,30,40};

    gradient_color gc = {colors,pts,3};

    UI_filled_area f = {

    NULL/*flag*/, get_image(IMG_GLOBAL_SAVE)/*bitmap*/,

    &gc/*gradient color*/, { 0, 255, 0, 100}/*color*/, { 255, 0, 0, 100}/*alternate color*/,

    { 255, 0, 255, 100}/*border color*/, { 0, 255, 255, 100}/*shadow color*/, 100/*transparent color*/

    };

    S32 *flags = &f.flags;

    S32 y = 0;

    *flags = UI_FILLED_AREA_TYPE_COLOR | UI_FILLED_AREA_TYPE_NO_BORDER; y += 5;

    pixtel_UI_draw_filled_area(10, y, 160, y + 18, &f);

    *flags = UI_FILLED_AREA_TYPE_GRADIENT_COLOR ; y += 24;

    pixtel_UI_draw_filled_area(10, y, 160, y + 18, &f);

    *flags = UI_FILLED_AREA_TYPE_TEXTURE | UI_FILLED_AREA_SINGLE_BORDER; y += 24;

    pixtel_UI_draw_filled_area(10, y, 160, y + 18, &f);

    *flags = UI_FILLED_AREA_TYPE_BITMAP | UI_FILLED_AREA_DOUBLE_BORDER | UI_FILLED_AREA_3D_BORDE;

    y += 24;

    pixtel_UI_draw_filled_area(10, y, 160, y + 18, &f);

    *flags = UI_FILLED_AREA_TYPE_HATCH_COLOR | UI_FILLED_AREA_ROUNDED_BORDER; y += 24;

    pixtel_UI_draw_filled_area(10, y, 160, y + 18, &f);

    *flags = UI_FILLED_AREA_TYPE_ALTERNATE_HATCH_COLOR | UI_FILLED_AREA_ELEVATED_BORDER; y += 24;

    pixtel_UI_draw_filled_area(10, y, 160, y + 18, &f);

    *flags = UI_FILLED_AREA_TYPE_CROSS_HATCH_COLOR | UI_FILLED_AREA_SINGLE_BORDER | UI_FILLED_AREA_3D_DEPRESSED_BORDER | UI_FILLED_AREA_SHADOW; y += 24;

    pixtel_UI_draw_filled_area(10, y, 160, y + 18, &f);

    *flags = UI_FILLED_AREA_TYPE_ALTERNATE_CROSS_HATCH_COLOR | UI_FILLED_AREA_SHADOW_DOUBLE_LINE;

    y += 24;

    pixtel_UI_draw_filled_area(10, y, 160, y + 18, &f);

    *flags = UI_FILLED_AREA_TYPE_CUSTOM_FILL_TYPE1; y += 24;

    pixtel_UI_draw_filled_area(10, y, 160, y + 18, &f);


    Show category screen
    Show Category Screen

    ShowCategoryScreen XXX:

    ShowCategoryXXXScreen

    RedrawCategoryXXXScreen

    ExitCategoryXXXScreen

    GetCategoryXXXHistory

    GetCategoryXXXHistorySize

    ShowCategoryXXXScreen:

    • Clear screen key handler

    • Register screen key handler

    • Change softkey text/icon

    • Save parameter

    • Create screen component

    • Set screen component

    • Register screen function

    • Display screen

    RedrawCategoryXXXScreen:

    • Clear screen

    • Draw title status icon

    • Draw title

    • Display other component

    • Draw softkey




    ad