- Code: Select all Expand view
// +---------------------------------------+
// | C5MENU 32bits v1.2 MENU.PRG |
// | |
// | AUTOR: Francisco García [España] |
// | ADAPTACION A 32BITS: |
// | Juan Carlos Salinas Ojeda |
// | jcso@esm.com.mx |
// | jcso@hotmail.com (solo msn) |
// | |
// | AGRADECIMIENTO ESPECIAL: Gracias mil |
// | a Paco García por cederme su código y |
// | tenerme la confianza de poder hacer |
// | algo productivo para la comunidad. |
// | |
// | 05 de Julio de 2005, México DF |
// | |
// +---------------------------------------+
// #ifndef _MENU_CH
// #define _MENU_CH
//----------------------------------------------------------------------------//
// Creating PullDown Menus from source code
#xcommand C5MENU [ <oObjMenu> ] ;
[ <popup: POPUP> ] ;
[ BITMAP <cBitmap> ] ;
[ LOGO <cBmpLogo> ] ;
[ LOGOCOLOR <nLogoClr> ] ;
[ COLOR <nClrText>, <nClrPane> ] ;
[ COLORSEL <nClrTxtSel>, <nClrSelect> ] ;
[ COLORDISA <nClrDisa> ] ;
[ COLORBOX <nClrBox> ] ;
[ WIDTH <nWidth> ] ;
[ HEIGHT <nHItem> ] ;
[ CHECK <cBmpChk> ] ;
[ FONT <oFont> ] ;
[ <l3dSel:SELECT 3D>] ;
[ <lNoChks:NO CHECKS> ] ;
[ SOUND <cSound1> ] ;
=> ;
[ <oObjMenu> := ] C5MenuBegin( <.popup.>, .f., , <cBitmap>,;
<cBmpLogo>, <nClrPane>, <nHItem>, <cBmpChk>, <oFont>, <nClrText>,;
<.l3dSel.>, <nWidth>, <.lNoChks.>, <nClrSelect>, <nClrTxtSel>,;
<nClrDisa>, <cSound1>, <nClrBox>, <nLogoClr> )
#xcommand C5MENUITEM [ <oMenuItem> PROMPT ] [<cPrompt>] ;
[ MESSAGE <cMsg> ] ;
[ <checked: CHECK, CHECKED, MARK> ] ;
[ <enable: ENABLED, DISABLED> ] ;
[ <file: FILE, FILENAME, DISK> <cBmpFile> ] ;
[ <resource: RESOURCE, RESNAME, NAME> <cResName> ] ;
[ ACTION <uAction,...> ] ;
[ BLOCK <bAction> ] ;
[ <of: OF, MENU, SYSMENU> <oMenu> ] ;
[ ACCELERATOR <nState>, <nVirtKey> ] ;
[ <help: HELP> ] ;
[ <HelpId: HELP ID, HELPID> <nHelpId> ] ;
[ WHEN <uWhen> ] ;
[ <break: BREAK> ] ;
[ COLOR <nClrText> ] ;
[ FONT <oFont> ] ;
[ <align: LEFT, CENTER, RIGHT> ] ;
[ DISAFILE <cDisaBmp> ] ;
[ DISARES <cDisaRes> ] ;
[ ICON <cIcon> ] ;
[ CURSOR <oCursor> ] ;
[ <lLink: LINK> ] ;
[ HEIGHT <nHeight> ] ;
=> ;
[ <oMenuItem> := ] C5MenuAddItem( <cPrompt>, <cMsg>,;
<.checked.>, [ Upper(<(enable)>) == "ENABLED" ],;
[\{|oMenuItem|<uAction>\}],;
<cBmpFile>, <cResName>, <oMenu>, <bAction>, <nState>, <nVirtKey>,;
<.help.>, <nHelpId>, [<{uWhen}>], <.break.>, <nClrText>,;
<oFont>, [ Upper(<(align)>) ], <cDisaBmp>, <cDisaRes>, ;
<cIcon>, <oCursor>, <.lLink.>, <nHeight> )
#xcommand C5SEPARATOR [<oMenuItem>] => [<oMenuItem>:=] C5MenuAddItem()
#xcommand c5ENDMENU => C5MenuEnd()
//----------------------------------------------------------------------------//
// Using Window System Menu
#xcommand REDEFINE C5SYSMENU [<oMenu>] ;
[ <of: OF, WINDOW, DIALOG> <oWnd> ] ;
[ BITMAP <cBitmap> ] ;
[ LOGO <cBmpLogo> ] ;
[ COLOR <nClrText>, <nClrPane> ] ;
[ HEIGHT <nHItem> ] ;
[ CHECK <cBmpChk> ] ;
[ FONT <oFont> ] ;
=> ;
[<oMenu> :=] C5MenuBegin( .f., .t., <oWnd>, <cBitmap>,;
<cBmpLogo>, <nClrPane>, <nHItem>, <cBmpChk>, <oFont>, <nClrText> )
#xcommand ENDSYSC5MENU => C5MenuEnd()
// PopUps Management
#xcommand ACTIVATE C5MENU <oMenu> ;
[ AT <nRow>, <nCol> ] ;
[ <of: OF, WINDOW, DIALOG> <oWnd> ] ;
=> ;
<oMenu>:Activate( <nRow>, <nCol>, <oWnd> )
//----------------------------------------------------------------------------//
// #endif
#define MF_ENABLED 0
#define MF_GRAYED 1
#define MF_DISABLED 2
#define MF_BITMAP 4
#define MF_CHECKED 8
#define MF_POPUP 16 // 0x0010
#define MF_BREAK 64
#define MF_BYPOSITION 1024 // 0x0400
#define MF_SEPARATOR 2048 // 0x0800
#define MF_HELP 16384 // 0x4000
#define MF_HILITE 128 // 0x0080
#define MF_UNHILITE 0
#define MF_OWNERDRAW 256 // 0x0100
#define ODA_DRAWENTIRE 1
#define ODA_SELECT 2
#define ODA_FOCUS 4
#define ODS_SELECTED 1
#define ODS_GRAYED 2
#define ODS_DISABLED 4
#define ODS_CHECKED 8
#define ODS_FOCUS 16
#ifndef COLOR_ACTIVECAPTION
#define COLOR_ACTIVECAPTION 2
#endif
#ifndef COLOR_MENU
#define COLOR_MENU 4
#endif
#ifndef COLOR_MENUTEXT
#define COLOR_MENUTEXT 7
#endif
#ifndef COLOR_HIGHLIGHT
#define COLOR_HIGHLIGHT 13
#endif
#ifndef COLOR_HIGHLIGHTTEXT
#define COLOR_HIGHLIGHTTEXT 14
#endif
// #define DT_LEFT 37
#define DT_LEFT 0
#define MENUX 1
#define ITEMSX 2
#define SRCCOPY 13369376
#define OBM_CHECK 32760
Gracias.