// Autor: Cristobal Navarro
// Fecha: 18/06/2015
// Pruebas de Menus
#include "FiveWin.ch"
#include "wcolors.ch"
#define GWL_STYLE -16
#define SM_TABLETPC 86
#define SM_DIGITIZER 94
#define SM_MAXIMUMTOUCHES 95
#define SM_IMMENABLED 82
#define SM_CYMENUSIZE 55
//----------------------------------------------------------------------------//
static oWnd
static oMru1
static oMru2
Static cColorPan
Static oFontMenu
//----------------------------------------------------------------------------//
function Main()
local oBar, oBar1, oBar2
local cTitle, x
Local cFont := "Segoe UI Symbol" //"Calibri"
Local cFontH := -14 //-16 //-20 //-18 //-14 //-10 //-12
Local aFonts
FW_SetUnicode( .T. )
SetResDebug( .T. )
if !IsWin8() .and. !IsWindows10()
cFont := "Calibri"
endif
DEFINE FONT oFontMenu NAME cFont SIZE 0, -14 WEIGHT 300
cTitle := " Menus: " + if( !Empty( oFontMenu ), oFontMenu:cFaceName, "" ) +;
if( !Empty( oFontMenu ), Str( oFontMenu:nHeight ), "" )
DEFINE WINDOW oWnd FROM 3, 6 TO 20, 70 MDI ;
TITLE cTitle MENU MBuildMenu( oWnd ) COLOR CLR_WHITE, CLR_WHITE //RGB( 116, 149, 193 )
oWnd:SetFont( oFontMenu )
SET MESSAGE OF oWnd TO "Prueba de Controles" FONT oFontMenu ;
COLORS RGB( 10, 10, 10 ), CLR_WHITE ; // , RGB( 116, 149, 193 ) ; //RGB( 31, 117, 70 ) ;
NOINSET CLOCK DATE KEYBOARD NOBORDER 2015
ACTIVATE WINDOW oWnd MAXIMIZED ON INIT MenuDlg( oWnd )
//Hb_GCall(.t.)
//CLEAR MEMORY
While oFontMenu:nCount > 0
oFontMenu:End()
Enddo
if File( "checkres.txt" )
FErase( "checkres.txt" )
endif
CheckRes()
return nil
//----------------------------------------------------------------------------//
function MBuildMenu( oW )
local oMenu
local oMruConnections
local oMruDBFs
local cClrDegrIni, cClrDegrFin
local cClrSelIni , cClrSelFin , cClrSelTxt, cClrSelBor
local cClrMenu , cClrMenuTxt
DEFAULT oW := oWnd
cClrMenu := CLR_RED
cClrMenuTxt := CLR_WHITE
cClrDegrFin := CLR_WHITE
cClrDegrIni := CLR_WHITE
cColorPan := CLR_GRAY
cClrSelFin := CLR_HGRAY
cClrSelIni := CLR_HGRAY
cClrSelTxt := CLR_BLACK
cClrSelBor := CLR_GRAY
MENU oMenu ;
COLORMENU RGB( 0, 0, 1 ), CLR_WHITE ;
COLORRIGHT CLR_WHITE, RGB( 0, 0, 1 );
COLORLEFT RGB( 0, 0, 1 ), CLR_WHITE ; //COLORBMP CLR_WHITE, RGB( 0, 0, 1 );
COLORSELECT GetSysColor( COLOR_MENUHILIGHT ), GetSysColor( COLOR_MENUHILIGHT ) , GetSysColor( COLOR_MENU ) ;
; // COLORSELECT CLR_BLUE, CLR_WHITE, CLR_RED ;
COLORSEPARATOR CLR_WHITE ;
FONT oFontMenu NOBORDER 2013
MENUITEM "NoClient"
MENU
MENUITEM "IsTablet" + "..." CHARICON 57696 //ACTION MsgInfo( IsTactil() )
MENUITEM "Browse Properties NonClient" CHECKED //ACTION XBrowse(NonClient())
MENUITEM FWString( "Sample MRU Recent files" ) CHARICON 57697
MENU
MRU oMruDBFs ;
FILENAME GetEnv( "APPDATA" ) + "\FiveDBU.ini" ;
SECTION "Recent DBF files" ; //
MESSAGE FWString( "Open this file" ) ;
SIZE 10
ENDMENU
SEPARATOR
MENUITEM FWString( "Change Color BLUE" ) + "..." CHARICON 57698
MENUITEM FWString( "Sample MRU ADO connections" ) CHARICON 57699
MENU
MRU oMruConnections ;
FILENAME GetEnv( "APPDATA" ) + "\FiveDBU.ini" ; // .INI to manipulate
SECTION FWString( "Recent ADO connections strings" ) ;
MESSAGE FWString( "Connect to this ADO database" ) ; // The message for all of them
SIZE 10
ENDMENU
SEPARATOR
MENUITEM FWString( "Change System Menu" ) + "..." ;
ACTION MsgInfo("Prueba" ) CHARICON 57695
SEPARATOR
MENUITEM FWString( "Exit" ) ACTION oWnd:End() CHARICON 57694
ENDMENU
MENUITEM "Client"
MENU
MENUITEM "IsTablet" + "..." CHARICON 57696 //ACTION MsgInfo( IsTactil() )
MENUITEM "Browse Properties NonClient" CHECKED //ACTION XBrowse(NonClient())
ENDMENU
oMenu:AddEdit()// { CLR_WHITE, CLR_BLACK, CLR_WHITE, CLR_WHITE, CLR_HGRAY, CLR_HGRAY, CLR_BLACK, CLR_GRAY } )
oMenu:AddFile()// { CLR_YELLOW, CLR_BLACK, CLR_WHITE, CLR_WHITE, CLR_HGRAY, CLR_HGRAY, CLR_BLACK, CLR_GRAY } )
oMenu:AddMdi()
oMenu:AddHelp( "Pruebas Menus", "(c) Cristobal Navarro 2015" )
ENDMENU
return oMenu
//----------------------------------------------------------------------------//
Function MenuDlg( oW )
Local oMenu
REDEFINE SYSMENU oMenu OF oW FONT oFontMenu ;
COLORSELECT RGB( 51, 153, 255 ), RGB( 51, 153, 255 ), RGB( 0, 0, 0) ;
COLORBMP RGB( 240, 240, 240 ), CLR_BLACK ;
COLORRIGHT CLR_BLACK, RGB( 240, 240, 240 ) ;
COLORSEPARATOR RGB( 200, 200, 200 ) 2013
SEPARATOR
MENUITEM "Primer Item" CHARICON 57605
SEPARATOR
MENUITEM "Segundo Item" ACTION MsgInfo( Len( oW:oSysMenu:aMenuitems ) ) CHARICON 57696
MENUITEM "Tercer Item" ACTION MsgInfo( Len( oW:oSysMenu:aMenuitems ) ) CHARICON 57736
SEPARATOR
MENUITEM "&Reset Menu" ACTION oMenu:Reset()
ENDSYSMENU
Return oMenu
//----------------------------------------------------------------------------//