WGI的WMenu.h文件源代码


/**
 *
 * 文 件 名:WMenu.h
 *
 * 描    述:
 *
 * 创 建 者:赵平智   <[email protected]>
 *
 * 创建日期:20091116
 *
 * 备    注:
 *
 *
 * * 维护历史 *
 *
 *   <日期>                <修改者>
 *   <修改内容...>
 *
 **/

#ifndef __WMENU_H__
#define __WMENU_H__

#include "../go.h"
#include "../../../se/wgi.h"
#include "../WDialog/WDialog.h"
#include "../WScrollBar/WScrollBar.h"


/*
 *
 * Menu styles
 */
#define   MS_UPDOWN              0x00000001L    // 1: Up/Down, 0: Right/Left
#define   MS_VSCROLLBAR          0x00000002L    // 1: vertical scroll bar, 0: up and down knob
#define   MS_AUTOWIDTH           0x00000004L    // 1: automatically calculate menu's width, 0: specify menu's width
#define   MS_AUTOHEIGHT          0x00000008L    // 1: automatically calculate menu's height, 0: specify menu's height
#define   MS_ITEMWIDTHSPS        0x00000010L    // 1: item's width as sponsor, 0: item's width by max-width of text
#define   MS_ITEMHEIGHTBMP       0x00000020L    // 1: item's height as bitmap, 0: item's height by height of text
#define   MS_UPPOP               0x00000040L    // 1: firstly try to up pop when MS_UPDOWN, 0: firstly try to down pop when MS_UPDOWN

 

/*=======================+ INIT +========================*/

/*
*
* NAME: INIT_WMENU
* DESC: initialize by AC2.
*/
typedef struct TAG_INIT_WMENU
{
 MENUITEM*      pfirstmit;          // first menu item
 UI32           style;              // style 
 COLORREF       crMITNormal;        // menu item's text normal color
 COLORREF       crMITOver;          // menu item's over color
 COLORREF       crMITDown;          // menu item's down color
 COLORREF       crMITDisable;       // menu item's disable color
 void           (*GetBitmapsForItem) (OBJECT* pParentWnd, MENUITEM*  pItem);
 void           (*GetBitmapsForVScrollBar) (OBJECT* pParentWnd, SCROLLBARBITMAPS*  pSBBmps);
}INIT_WMENU;


/*==================+ Extended Member +==================*/

/*
*
* 名称:EM_WMENU
*/
typedef struct TAG_EM_WMENU
{
 WNDPROC      pWndProc;
 OBJECT*      pWGrinterface;
 OBJECT*      pWPanel;
 OBJECT*      pWDialog;
 int          nScrCtrl;           // number of scroll control.
 MENUITEM*    pfirstmit;          // first menu item.
 UI32         style;              // style 
 OBJECT*      pSubMenu;           // sub menu
 int          curitem;            // current item  
 COLORREF     crMITNormal;        // menu item's text normal color
 COLORREF     crMITOver;          // menu item's over color
 COLORREF     crMITDown;          // menu item's down color
 COLORREF     crMITDisable;       // menu item's disable color
 void         (*GetBitmapsForItem) (OBJECT* pParentWnd, MENUITEM*  pItem);
 void         (*GetBitmapsForVScrollBar) (OBJECT* pParentWnd, SCROLLBARBITMAPS*  pSBBmps);
}EM_WMENU;


#endif  /* #ifndef __WMENU_H__ */