下载此文档

mtk 手机模板.doc


文档分类:IT计算机 | 页数:约20页 举报非法文档有奖
1/20
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/20 下载此文档
文档列表 文档介绍
本文详细说明了如何建设一个自定义列表窗体模板。原理部分请参见《MTK平台(1)——如何添加一个窗体模板》。
最终实现的是一个字典输入界面。布局为:
该模板不包含业务逻辑,仅提供页面显示和InputBox框输入事件后的ListBox的Redraw事件的注册,以及基本的输入法设置、清空后的返回函数。
 
一、添加用户自定义列表模板的过程
(一)在g_categories_controls_map[]中加入:
,{MMI_CATEGORY_CUSTOM_LIST,(U8*)custom_define_list,(s16*)coordinate_custom_list,NULL}
const U8 custom_define_list[]=
{
5,
DM_BASE_LAYER_START,
DM_SCR_BG,
DM_BASE_CONTROL_SET1,
DM_SINGLELINE_INPUTBOX1,
DM_LIST1
};
const S16 coordinate_custom_list[]=
{
DM_FULL_SCREEN_COORDINATE_FLAG,
DM_CUSTOM_DEFINE_INPUTBOX, //需要定义
DM_CUSTOM_DEFINE_LIST //需要定义
};
(二)在dm_get_coordinates()函数中加入:
//设定列表位置和大小(不要忘记全局变量 MMI_custom_Listbox_x 等的定义)
else if( *essPtr_p == DM_CUSTOM_DEFINE_LIST )
{
dm_coordinate_info->s16X = MMI_custom_Listbox_x;
dm_coordinate_info->s16Y = MMI_custom_Listbox_y; dm_coordinate_info->s16Width = MMI_custom_Listbox_width; dm_coordinate_info->s16Height = MMI_custom_Listbox_height;
dm_coordinate_info->Flags = DM_NO_FLAGS;
essPtr_p ++ ;
}
//设定输入框位置和大小
else if( *essPtr_p == DM_CUSTOM_DEFINE_INPUTBOX )
{
dm_coordinate_info->s16X = MMI_custom_inputbox_x ;
dm_coordinate_info->s16Y = MMI_custom_inputbox_y;
dm_coordinate_info->s16Width = MMI_custom_inputbox_width ;
dm_coordinate_info->s16Height = MMI_custom_inputbox_height; dm_coordinate_info->Flags = DM_SINGLE_LINE_INPUTBOX_SPECIFIC_HEIGHT;
essPtr_p ++ ;
}

(三)
void ShowCategoryCustomListScreen(
U8 *title,
U16 title_icon,
U16 left_softkey,
U16 left_softkey_icon,
U16 right_softkey,
U16 right_softkey_icon,
S32 number_of_items,
U8 **list_of_items,
U16 *list_of_icons,
S32 flags,
S32 highlighted_item,
U8 *history_buffer)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
dm_data_struct dm_data;
S32 i;
U8 h_flag;
/*----------------------------------------------------------------*/
/*

mtk 手机模板 来自淘豆网m.daumloan.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数20
  • 收藏数0 收藏
  • 顶次数0
  • 上传人xunlai783
  • 文件大小99 KB
  • 时间2018-01-13