#include "fivewin.ch"
FUNCTION test()
LOCAL oDlg, oBtn
LOCAL oFont, oBold
LOCAL pippo := "mmm"
LOCAL oGet
LOCAL oCursorBtn := TCursor():New(, 'HAND' )
LOCAL nWd := GetSysMetrics( 0 ) * .58
LOCAL nHt := ( GetSysMetrics( 1 ) / 2 ) - 20
oFont := TFont():New( "Tahoma", 0, 14,, )
oBold := TFont():New( "Tahoma", 0, 14,, .T. )
DEFINE DIALOG oDlg SIZE nWd, nHt PIXEL TRUEPIXEL;
FONT oFont COLOR CLR_BLACK, RGB( 245, 245, 235 ) ;
STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, ;
WS_MINIMIZEBOX )
@ 10, 450 BTNBMP oBtn ;
NAME "COMBOBMP" ;
SIZE 100, 25 PIXEL ;
PROMPT "testobutton" ;
FONT oFont FLAT RIGHT ;
COLOR CLR_BLACK, RGB( 245, 245, 235 );
ACTION ::ShowPopUp( {| oBtn, nRow, nCol | oBtnMenu( oBtn ) } )
/*
oBtn:bClrGrad := { | lInvert | If( ! lInvert, ;
{ { 1, nRGB( 255, 255, 255 ), nRGB( 207, 207, 207 ) } }, ;
{ { 1/3, nRGB( 255, 253, 222 ), nRGB( 255, 231, 151 ) }, ;
{ 2/3, nRGB( 255, 215, 84 ), nRGB( 255, 233, 162 ) } } ) }
*/
oBtn:bClrGrad = {| lInvert | If( ! lInvert, ;
{ { 0.25, RGB( 245, 245, 235 ), RGB( 250, 250, 245 ) }, ;
{ 0.75, RGB( 250, 250, 245 ), RGB( 245, 245, 235 ) } }, ;
{ { 0.25, RGB( 250, 250, 245 ), RGB( 245, 245, 235 ) }, ;
{ 0.75, RGB( 245, 245, 235 ), RGB( 250, 250, 245 ) } } ) }
oBtn:nClrBorder := iif( oBtn:lMOver, RGB( 219, 230, 244 ), RGB( 219, 230, 244 ) )
oBtn:oCursor := oCursorBtn
@ 5, 50 GET oget VAR pippo OF oDlg // ******************************
ACTIVATE DIALOG oDlg CENTERED ON INIT oGet:setfocus()
RETURN NIL
FUNCTION oBtnMenu( oBtn )
LOCAL oMenu
MENU oMenu POPUP
MenuItem "XXXXXXXXXXXXXXXXX"
MenuItem "XXXXXXXXXXXXXXXXX"
MenuItem "XXXXXXXXXXXXXXXXX"
ENDMENU
RETURN( oMenu )
// FIN / END