⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mmidynamenu.h

📁 是一个手机功能的模拟程序
💻 H
字号:


#ifndef _DEF_MMI_DYNAMENU_H__
#define _DEF_MMI_DYNAMENU_H__
/*******************************************************************************

					CONDAT (UK)

********************************************************************************                                                                              

 This software product is the property of Condat (UK) Ltd and may not be
 disclosed to any third party without the express permission of the owner.                                 
                                                                              
********************************************************************************

 $Project name:	Basic MMI                                                      
 $Project code:	BMI (6349)                                                           
 $Module:		PhoneBook
 $File:		    Mmi_dynamenu.h
 $Revision:		1.0                                                       
                                                                              
 $Author:		Condat(UK)                                                         
 $Date:		    25/10/00                                                      
                                                                               
********************************************************************************
                                                                              
 Description:
 
    Dynamic menu handling

                        
********************************************************************************

 $History: Mmi_dynamenu.h

	25/10/00			Original Condat(UK) BMI version.	
	   
 $End

*******************************************************************************/
/* 
	The dynamic menu is not designed to replace the menu handling in mfw.
	it is used for non standard menus that are created by a window rather than linked
	into the top level menu system. in this respect they are more like pop-up windows.

    The menu data structure is minimalist and does not provide a handler for events or
	key presses - these must be provided by the owner window. All you get here is the
	ability to redraw the menu and step forwards and back through the data.

    each menu item contains an ID, this is the eventual return value for the menu.
	the menu type indicates whether the menu item is a string, a prompt id or a picture

    the menu supports string pointers so that you can build menus in memory dynamically 
	from data returned from the resource file enumerations
	 
	the menu supports prompt ids so that you can build const menus in the resouce file
	 
	picture menus use a bitmap to represent the menu item, although it does have to be 
	the correct height for the current font. The bitmap is not inverted when the highlight
	bar passes over it - instead the second frame of the bitmap is shown - if available. 
	this can be a simple negative image or something more pretty.

	The menu also supports a scroll bar showing the position of the current item in 
	relation to the size of the menu.

    The menu also supports a selected indicator which identifies the item that has been
	selected.
	
	The only highlight type available is a bar.

	All functions take a menu pointer as their first parameter.

*/
typedef enum {
	ST_PROMPT_MENU=0,
	ST_TEXT_MENU=1,
	ST_PICTURE_MENU=2
} ST_MENU_TYPE;

typedef struct {
	UINT16	id;
	ST_MENU_TYPE menu_type;			// 1 is text, 0 is prompt.
	union {
		int		  prompt;
		int		  icon;
//JVJE		ST_STRING	text;
	} str;
} ST_MENU_ITEM;


typedef struct {
	UINT16	count;			// number of menu items.
	UBYTE   current;		// index of currently highlighted item
	UBYTE   selected ;		// index of currently checked item
	ST_MENU_ITEM *items;	// menu item array
} ST_MENU ;


void menu_Next(ST_MENU *menu);		// steps forward one menu item
void menu_Prev(ST_MENU *menu);		// steps backward one menu item

void menu_SetSelected(ST_MENU *menu, int id);	// sets selected and current to item containing id
 int menu_Select(ST_MENU *menu);			// makes current item selected and returns id

 int menu_FindIdIndex(const ST_MENU *menu, UINT16 id ); // returns entry number in menu that matches id, or zero
 int menu_GetCurrentID(const ST_MENU *menu); 	// returns the id of the current menu item
void menu_DrawMenu(const ST_MENU *menu ) ;	// static void menu_DisplayScrollBar(ST_MENU *menu ) ;

void menu_DrawScrollBar(int pos, int max ); // draws the scroll bar


#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -