




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、精選優(yōu)質(zhì)文檔-傾情為你奉上函數(shù)1.設(shè)置字體顏色#if defined(UI_WATCH_STYLE_128X128BAR) GUIEDIT_SetFontColor(MMISET_SET_DIVERT_NUMBER_CTRL_ID,MMI_BLACK_COLOR);#endif2.顯示輸入法#if defined(UI_WATCH_STYLE_128X128BAR)GUIEDIT_SetDispImIcon(MMIBT_PIN_EDITBOX_CTRL_ID,&is_display_im,&is_display_num);#endif3.idleHandleIdleMsg(idle入口函數(shù))
2、IdleWin_HandleMsg(idle按鍵注冊)4. MMK_RunWinProc(窗口跟蹤函數(shù)) MMK_RunCtrlProc(控件跟蹤函數(shù))5. MMITHEME_GetMenuProc 菜單回調(diào)函數(shù)6. MMITHEME_GetCommonMenuTheme設(shè)置菜單tiemer7. MMITHEME_GetSecondMenuTheme設(shè)置二級菜單的風格數(shù)據(jù)8.6. MMK_DispatchToHandle mmk消息分配函數(shù)7. MMITHEME_GetMenuProc設(shè)置各種style風格的控件的回調(diào)函數(shù)GUIMENU_PROCESS_T結(jié)構(gòu)typedef struct vo
3、id (*InitMenu)(GUIMENU_CTRL_T*); /init menu void (*DestoryMenu)(GUIMENU_CTRL_T*); /destory menu void (*DisplayMenu)(GUIMENU_CTRL_T*); /display menu(必須實現(xiàn)) void (*DisplaySpecialMenu)(GUIMENU_CTRL_T*); /display menu(處理主菜單震動拖選效果) void (*ShowScrollItemStr)(GUIMENU_CTRL_T*); /display scroll item string MM
4、I_RESULT_E (*HandleMenuUpKey)(GUIMENU_CTRL_T*); /handle menu up key(必須實現(xiàn)) MMI_RESULT_E (*HandleMenuDownKey)(GUIMENU_CTRL_T*); /handle menu down key(必須實現(xiàn)) BOOLEAN (*HandleMenuLeftKey)(GUIMENU_CTRL_T*,MMI_MESSAGE_ID_E); /handle menu left key,return is handle cancel(返回是否需要處理) BOOLEAN (*HandleMenuRightK
5、ey)(GUIMENU_CTRL_T*,MMI_MESSAGE_ID_E); /handle menu right key,return is handle ok(返回是否需要處理) BOOLEAN (*HandleMenuNumKey)(uint16,GUIMENU_CTRL_T*); /handle menu number key(返回是否需要處理) void (*HandleMenuTpDown)(GUI_POINT_T*,GUIMENU_CTRL_T*); /handle menu tp down(必須實現(xiàn)) BOOLEAN (*HandleMenuTpUp)(GUI_POINT_T*
6、,GUIMENU_CTRL_T*); /handle menu tp up(必須實現(xiàn))(返回是否需要處理) void (*HandleMenuTpMove)(GUI_POINT_T*,GUIMENU_CTRL_T*); /handle menu tp move(必須實現(xiàn)) void (*HandleMenuTpScroll)(uint16,GUIMENU_CTRL_T*); /handle menu scroll bar tp void (*AdjustFirstAndDisplay)(GUIMENU_CTRL_T*, BOOLEAN); /調(diào)整first_item_index索引并重新顯示(
7、非主菜單,實現(xiàn)) uint16 (*GetCurItemTop)(GUIMENU_CTRL_T*); /獲得當前Item的Top值(POP風格彈出二級時,實現(xiàn)) BOOLEAN (*MoveInit)(GUIMENU_CTRL_T*); /移動信息初始化 BOOLEAN (*MoveDestory)(GUIMENU_CTRL_T*); /移動信息銷毀 BOOLEAN (*HandleMenuOk)(GUIMENU_CTRL_T*, MMI_MESSAGE_ID_E); /handle menu ok(返回mmimenu是否已經(jīng)處理) MMI_RESULT_E (*HandleMenuTimer
8、)(GUIMENU_CTRL_T*, MMI_MESSAGE_ID_E, DPARAM); /handle menu timer BOOLEAN (*HandleMenuCancelKey)(GUIMENU_CTRL_T*, MMI_MESSAGE_ID_E); /handle menu cancel(返回mmimenu是否已經(jīng)處理) BOOLEAN (*HandleMenuEndKey)(GUIMENU_CTRL_T*); /handle menu end BOOLEAN (*SearchMenuId)(GUIMENU_CTRL_T*, MMI_MENU_ID_T); / 判斷指定的item
9、 id是否存在(已無用,可刪) void (*HandleMenuModifyRect)(GUIMENU_CTRL_T*); /handle menu modify rect(必須實現(xiàn)) MMI_RESULT_E (*HandleSpecialMsg)(GUIMENU_CTRL_T*, MMI_MESSAGE_ID_E, DPARAM); /display menu void (*GetItemPtr)(GUIMENU_CTRL_T*, uint16, uint16, GUIMENU_MAINMENU_INFO_T* ); / 獲取指定頁指定索引的靜態(tài)item內(nèi)容信息(用于主菜單) GUIME
10、NULIST_ITEM_INFO_T* (*GetItemInfoPtr)(GUIMENU_CTRL_T*, uint16, uint16);/ 獲取指定頁指定索引的靜態(tài)item信息(用于主菜單) uint16 (*GetTotalItemNum)(GUIMENU_CTRL_T*, uint16); / 獲取指定頁的總item數(shù)(用于分頁型的風格) uint16 (*GetLineNumPage)(GUIMENU_CTRL_T *); / 獲取一個有多少行(非主菜單實現(xiàn)) BOOLEAN (*ResetDisplayItem)(GUIMENU_CTRL_T *, int16*, BOOLEAN
11、); / 修正顯示位置,獲取相對于現(xiàn)在的偏移量 void (*CalculateRect)(GUIMENU_CTRL_T *, uint16); / 計算menu的區(qū)域 BOOLEAN (*U_SetPageInfo)(GUIMENU_CTRL_T *, uint16, void *); / 設(shè)置U動畫信息 GUIMENU_PROCESS_T;窗口風格Guimenu控件把一種風格對應(yīng)的消息處理函數(shù)封裝成一個結(jié)構(gòu),開放給應(yīng)用使用。該結(jié)構(gòu)只封裝了消息處理的接口,以下每一個函數(shù)都對應(yīng)了某個消息的處理,通常一種風格對應(yīng)的是一組這樣的消息處理函數(shù)。codeMENU_DEF( MENU_MAINMENU_
12、ICON, menu_mainmenu_icon, GUIMENU_STYLE_ICON, TXT_NULL, IMAGE_NULL, IMAGE_NULL, IMAGE_NULL, GUIMENU_ITEM_NUM(menu_mainmenu_icon)endcodeMENU_DEF宏的參數(shù)從前往后依次為:- 菜單組ID- 菜單數(shù)組地址- 菜單類型(可以看到為GUIMENU_STYLE_ICON,)- 四個空的文本或圖片(NULL表示不需要)- 菜單數(shù)組的項數(shù)如果修改位置信息,那么只需要修改mmitheme_menu.h文件中的宏定義即可,有橫豎屏的,應(yīng)該兼顧。如果修改選項數(shù)據(jù)信息,只需要修
13、改菜單的靜態(tài)數(shù)組,例如menu_mainmenu_icon。彈出式菜單和其它菜單不同,在創(chuàng)建的時候,彈出式菜單不需要使用CREATE_MENU_CTRL宏,也不需要依賴于窗口Table,無論是動態(tài)創(chuàng)建還是靜態(tài)創(chuàng)建都是通過接口來實現(xiàn)的。-# MMIPOPMENU_CreateStatic 靜態(tài)創(chuàng)建彈出式菜單-# MMIPOPMENU_CreateDynamic 動態(tài)創(chuàng)建彈出式菜單彈出試菜單的風格如下:-# 菜單顯示的最大項數(shù),該值使用一個宏定義的常量,常量名稱MMIMENU_POPUP_LINE_NUM_PAGE,定義在mmimenu_position.h文件中,目前我們對于240x320以及1
14、76x220的屏幕,彈出式菜單的最大顯示項數(shù)為8,而240x400的最大顯示數(shù)為10。-# 菜單的背景修改,彈出式菜單的背景分為上下兩個部分,上半部分為半透的效果,使用圖片IMAGE_PUBWIN_UP_BG,這是一張固定資源圖片,圖片的大小可以自行修改。窗口的下半部分為背景色,顏色值為MMITHEME_POPUPMENU_BG_COLOR,在創(chuàng)建菜單控件的時候,調(diào)用MMITHEME_GetPopupMenuTheme(mmitheme_menu.c實現(xiàn))獲取。-# 菜單的其他風格信息都可以在MMITHEME_GetPopupMenuTheme接口中修改。菜單控件分為兩大類:- 靜態(tài)菜單n 靜
15、態(tài)菜單的數(shù)據(jù)事先通過菜單表的形式已經(jīng)確定,菜單控件分析這張菜單表解析出菜單項, 用戶不能夠再動態(tài)添加和刪除菜單項。ntypedef void*PWND;/*! window struct pointer type */typedef void*DPARAM;/*! param data pointer type */typedef void*ADD_DATA;/*! additional data pointer type */typedef uint16MMI_SOFT_ICON;/*! soft icon type */typedef uint32MMI_TEXT_ID_T;/*! tex
16、t id type */typedef uint32MMI_IMAGE_ID_T;/*! image id type */typedef uint32MMI_ANIM_ID_T;/*! animation id type */typedef uint32MMI_RING_ID_T;/*! ring id type */typedef uint32MMI_COLOR_ID_T;/*! color id type */typedef uint32MMI_RECT_ID_T;/*! rect id type */typedef uint32MMI_DATA_ID_T;/*! data id type
17、 */typedef uint32MMI_MENU_GROUP_ID_T;/*! menu group id type */typedef uint32MMI_MENU_ID_T;/*! menu id type */typedef uint16MMI_MENU_TIP_T;/*! menu tip type */typedef uint32MMI_MESSAGE_ID_E;/*! message id type */typedef uint32MMI_WIN_ID_T;/*! window id type */typedef uint32MMI_CTRL_ID_T;/*! control i
18、d type */typedef uint32MMI_NV_ID_T;/*! nv id type */typedef uint32MMI_HANDLE_T;/*! handle type */typedef uint32 MMI_RESULT_E; 現(xiàn)在link #GUIMENU_STYLE_ICON endlink、link #GUIMENU_STYLE_OPTION_PAGE endlink、 link #GUIMENU_STYLE_TITLE_ICON endlink、link #GUIMENU_STYLE_SLIDE_PAGE endlink、 link #GUIMENU_STYLE
19、_CUBE endlink必須是靜態(tài)菜單。- 動態(tài)菜單n 動態(tài)菜單的數(shù)據(jù)是用戶通過控件提供的方法來插入的。n 現(xiàn)在主要彈出式的菜單用動態(tài)菜單。彈出式菜單和其它菜單不同,在創(chuàng)建的時候,彈出式菜單不需要使用CREATE_MENU_CTRL宏,也不需要依賴于窗口Table,無論是動態(tài)創(chuàng)建還是靜態(tài)創(chuàng)建都是通過接口來實現(xiàn)的。-# MMIPOPMENU_CreateStatic 靜態(tài)創(chuàng)建彈出式菜單-# MMIPOPMENU_CreateDynamic 動態(tài)創(chuàng)建彈出式菜單typedef struct guimenu_ctrl_tag CAF_VTBL_T(IGUICTRL_T) *vtbl_ptr; GUI
20、CTRL_DATA_MEMBER; MMI_HANDLE_T win_handle; /window handle GUIMENU_STATE_T menu_state; BOOLEAN is_static; /is static menu BOOLEAN is_focus_title; /title is focus for option page BOOLEAN is_set_font_color; /is set font color BOOLEAN is_transparent; /是否半透背景 BOOLEAN is_need_reset_rect; /是否需要重設(shè)區(qū)域 BOOLEAN
21、 is_active; / is active uint8 item_timer_id; /item timer id uint16 item_str_index; /item string start index uint16 menu_level; /menu level uint16 cur_page_index; /default 0,from 0 to max-1 uint16 cur_item_index; /current selected menu index. in option page style, it is also item index uint16 first_i
22、tem_index; /item index at the top uint16 end_item_index; /item index at the top int16 offset_y; /offset y int16 offset_x; /offset x uint16 pre_cur_item_index; /previous current index uint16 item_total_num; /current total visible item number. in option page style, it is page count. wchar title_wstrGU
23、IMENU_TITLE_MAX_LEN + 1; /for dynamic menu or volatile static menu title uint16 title_len; /for dynamic menu or volatile static menu title GUI_COLOR_T font_color; /font color GUIMENU_STYLE_E cur_style; /menu style GUIMENU_GROUP_T *cur_group_ptr; /current menu group info MMI_MENU_GROUP_ID_T cur_group
24、_id; /current menu group id GUIMENU_GROUP_INFO_T *cur_group_info_ptr; /current additional menu group info GUIMENU_GROUP_INFO_T *root_group_info_ptr; /additional menu group info memory GUIMENU_STATIC_ITEM_T *static_item_ptr; /text and image for static item GUIMENU_NODE_MEMORY_T node_memory; /dynamic
25、menu,node memory GUIMENU_NODE_T *root_node_ptr; /dynamic menu,root node pointer GUIMENU_NODE_T *cur_parent_node_ptr; /dynamic menu,current parent node pointer MMI_TEXT_ID_T dyna_softkey_idGUIMENU_BUTTON_MAX_NUM;/dynamic menu,softkey text id GUIMENU_STACK_T menu_stackGUIMENU_STACK_MAX_LEVEL; /menu st
26、ack info GUIMENU_POP_SELECT_LIST_T selected_list; /all selected item info only for pop-up radio/check menu BOOLEAN is_need_prgbox; /is need prgbox or not BOOLEAN is_revise_rect; /is need revise rect or not,當增加滾動條的時候,需要重新調(diào)整區(qū)域 GUIPRGBOX_CTRL_T *prgbox_ctrl_ptr; /progress box control pointer void *proc
27、ess_funcGUIMENU_STYLE_MAX; /menu process function MMITHEME_MENU_COMMON_T common_theme; /menu common theme MMITHEME_MAINMENU_T main_menu_theme; /main menu theme MMITHEME_SECONDMENU_T second_menu_theme; /second menu theme MMITHEME_POPMENU_T pop_menu_theme; /pop-up menu theme MMITHEME_OPTIONSMENU_T opt
28、ions_menu_theme; / options menu theme GUIMENU_MAINMENU_U main_menu_data; /主菜單的信息 GUIMENULIST_ITEM_T menu_list_info; /menu list information GUIMENULIST_ITEM_T menu_bar_info; /menu bar information BOOLEAN is_delete_state; /item是否在抖動 BOOLEAN is_move_state; /item是否在抖動 BOOLEAN is_moving; /item是否被拖動 BOOLE
29、AN is_empty_space; /tp up時,是否在item上 BOOLEAN is_item_pressed; /tp down時,是否在item上 BOOLEAN is_tp_pressed; /is tp down? BOOLEAN is_bar_item; /is bar item /BOOLEAN is_open_folder; /is open folder/#ifndef RUNTIME_DRAW_SUPPORT BOOLEAN is_press_without_moving;/ for compiler BOOLEAN is_press_in_folder_rect;
30、BOOLEAN is_opened_folder_from_bar; BOOLEAN is_temp_filefold_create; /是否建立了臨時文件夾icon BOOLEAN opened_folder_is_bar_item; uint16 cur_folder_idx; /當前文件夾 int16 temp_filefold_index; / 文件夾形成時代index uint16 opened_folder_page_index; uint16 opened_folder_item_index; MMI_HANDLE_Tctrl_foldername_handle; GUIMENU
31、LIST_ITEM_INFO_T* cur_folder_ptr;/#endif /for istyle search BOOLEAN is_search_display; /search page data already exist BOOLEAN is_cur_pagesearch; /搜索頁是不是當前頁 BOOLEAN is_search_entry; /enter search page BOOLEAN is_search_listslide; /record list slide vertical or menu slide horizontalGUI_LCD_DEV_INFOtm
32、p_layer_handle;/temp layer handle uint16 tmp_cur_item_index; /移動的時候使用 uint16 tmp_first_item_index; /移動的時候使用 uint16 tmp_page_item_index; /移動到時候使用 BOOLEAN tmp_is_bar_item; /移動的時候使用 uint16 move_item_index; /移動的item項,用于給idle和刪除用 uint16 tmp_width; /移動的時候使用 uint16 tmp_height; /移動的時候使用 GUI_RECT_T move_rect
33、; CONTINUE_MOVE_TYPE_E continue_move_type; / 連續(xù)移動的類型 uint8 tp_timer_id; / 為支持TP連續(xù)移動而加的timer uint8 start_move_timer_id; / 進入抖動狀態(tài)的定時器 uint8 shake_icon_timer_id; / 進入抖動狀態(tài)時,每次抖動的間隔 uint8 titleidx_timer_id; / title index顯示的timer ID uint8 redrew_timer_id; / 滑動時,slide和fling狀態(tài)下,畫圖的timer uint8 user_timer_id;
34、 / 應(yīng)用自定義的timer BOOLEAN is_display_title; / 是否顯示title BOOLEAN is_display_item_layer; / 是否畫item layer的數(shù)據(jù) GUI_LCD_DEV_INFO highlight_layer_handle; /高亮層 GUI_LCD_DEV_INFO icon_move_layer_handle; /圖標移動層 MMK_TP_SLIDE_E slide_state; /current slide state MMK_TP_SLIDE_E tpdown_slide_state; /slide state when t
35、p down MMI_MENU_ID_T delete_menu_id; /組織狀態(tài)下使用,要刪除的menu_id GUI_POINT_T slide_start_point; /Slide時候使用 GUI_POINT_T slide_pre_point; /Slide時候使用 GUI_POINT_T pre_tp_point; /上一次tp move的坐標 GUI_LCD_DEV_INFO page_layer_handleGUIMENU_SLIDE_PAGE_NUM; /頁面移動層1 GUI_LCD_DEV_INFO titleidx_layer_handle; / 頁面索引層GUI_LC
36、D_DEV_INFOto_idle_layer_handle; /到主菜單圖層 GUI_LCD_DEV_INFOdelete_layer_handle; /刪除圖層 GUIMENU_SOFTKEY_STATE_T softkey_state; /softkey的狀態(tài),目前只有主菜單使用 GUIMENU_ITEM_POS_INFO_T *item_pos_info_ptr; / 記錄Item位置信息 GUI_LCD_DEV_INFO item_layer; / 二級菜單畫item的層信息 / end / auto popup menu uint16 max_horz_width; / 菜單的橫向
37、最大寬度,用于popupmenu_auto動態(tài)計算寬度時用 uint16 max_vert_width; / 菜單的縱向最大寬度,用于popupmenu_auto動態(tài)計算寬度時用 GUIMENU_EP_E effective_point; / 彈出的基點,用于popup_auto風格的菜單 / end / cube menu uint8 cube_back_timer_id; / 觸筆按下時啟動timer,時間到才啟動移動狀態(tài) int16 cur_angle; / 當前角度 CUBEMENU_MODE_E cube_mode; / 立方體當前的模式 GUI_LCD_DEV_INFO cube_
38、layer_handle; / 立方體層 BOOLEAN is_page_scaled; / 頁面是否被縮放緩存 GUI_RECT_T pre_cube_rect; / 上次立方體的區(qū)域 MMIMENU_SCALED_PAGE_T scaled_pageMMITHEME_MENUMAIN_SLIDE_PAGE_NUM; / 頁面縮放緩存內(nèi)存 MMIMENU_SCALED_PAGE_T *scaled_page_ptr2; / 指向當前顯示的頁面 /end float fling_velocity; /滑動速度 BOOLEAN is_first_disp; /是否第一次顯示,在特效時使用;防止重新獲得焦點時再次顯示特效 GUIMENU_ENTER_ANIM_TYPE_E enter_anim_type; / 進入時的動畫類型 uint16 pre_msg_loop_page_index; / 每次消息循環(huán)后,focus page index uint16 pre_msg_loop_item_index; / 每次消息循環(huán)后,focus項index uint16 pre_msg_loop_menu_level; / 每次
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 公司組織考試活動方案
- 公司新員工打卡活動方案
- 2025年網(wǎng)絡(luò)安全工程師考試試題及答案
- 2025年心理素質(zhì)與情商訓練考試試題及答案
- 2025年水利工程師資格考試試題及答案
- 2025年交通工程專業(yè)知識考試試題及答案
- 2025年國際法與人權(quán)保障方法考試試題及答案
- 關(guān)于烏鎮(zhèn)導游詞
- 2024年度浙江省二級造價工程師之土建建設(shè)工程計量與計價實務(wù)題庫練習試卷A卷附答案
- 2024年度浙江省二級造價工程師之土建建設(shè)工程計量與計價實務(wù)高分通關(guān)題庫A4可打印版
- 2025年江蘇瑞海投資控股集團有限公司招聘筆試參考題庫含答案解析
- 醫(yī)療廢物應(yīng)急處理流程與方案
- 簡陽市2024-2025學年數(shù)學五下期末統(tǒng)考試題含答案
- 體檢中心投訴處理流程
- 2025山西焦煤集團公司招聘高頻重點模擬試卷提升(共500題附帶答案詳解)
- 2025年中國東方航空股份有限公司招聘筆試參考題庫含答案解析
- 畜牧飼養(yǎng)行業(yè)安全生產(chǎn)培訓
- 《水龍頭知識培訓》課件
- (八省聯(lián)考)河南省2025年高考綜合改革適應(yīng)性演練 化學試卷合集(含答案逐題解析)
- 用戶體驗量化評估-洞察分析
- 農(nóng)場租賃合同范本:養(yǎng)殖場租賃
評論
0/150
提交評論