#include 'Fivewin.ch'
#include 'TSbutton.ch'
#include 'Image.ch'
Static oWnd, nWndWidth, nWndHeight, oFont40
*------------------------------*
Function Main
local oBtn[4]
local aImage1
nWndWidth := GetSysMetrics(0)
nWndHeight := GetSysMetrics(1)
DEFINE FONT oFont40 NAME 'Tahoma' SIZE 0, -40
DEFINE WINDOW oWnd TITLE 'Test Button on Image Background' ;
STYLE nOr( WS_POPUP, WS_VISIBLE ) ;
COLOR CLR_WHITE, CLR_HGRAY
aImage1 := oWnd:ReadImage( '.\TESTSBTN.JPG' )
@ 200, 400 SBUTTON oBtn[1] PROMPT 'Check-Out' OF oWnd ;
SIZE 460,460 PIXEL ;
RESOURCE "CHECKIN" ;
FONT oFont40 ;
W97 ;
ROUNDRECT ;
TEXT ON_BOTTOM ; // COLORS CLR_BLACK, CLR_GRAY ;
COLORS CLR_WHITE ;
ACTION (MsgInfo('ok1'))
@ 200,1000 SBUTTON oBtn[2] PROMPT 'Check-In' OF oWnd ;
SIZE 460,460 PIXEL ;
RESOURCE "CHECKOUT" ;
FONT oFont40 ;
LOOK W97 ;
ROUNDRECT ;
TEXT ON_BOTTOM ;
COLORS CLR_WHITE ;
ACTION CheckIn()
@ 700, 800 SBUTTON oBtn[2] PROMPT 'Exit' OF oWnd ;
SIZE 150,100 PIXEL ;
FONT oFont40 ;
LOOK W97 ;
ROUNDRECT ;
TEXT ON_BOTTOM ;
COLORS CLR_WHITE ;
ACTION oWnd:End()
ACTIVATE WINDOW oWnd MAXIMIZED ;
ON PAINT oWnd:DrawImage( aImage1, {120, 0, nWndHeight-100, nWndWidth }, nil, .T., 40, nil )
RELEASE FONT oFont40
return nil
*-----------------*
Function CheckIn()
local oFnt, oDlg, oBtn[4], oSay, oBmp, oDlgCLose, oImg, aImage1, oBrush
DEFINE DIALOG oDlg SIZE nWndWidth, nWndHeight ;
STYLE nOr( WS_CHILD, WS_POPUP ) ;
COLOR CLR_BLACK, CLR_WHITE ;
oDlg:lHelpIcon := .F.
ACTIVATE DIALOG oDlg CENTER ON INIT (ShowImg( oDlg, oBtn ))
return .T.
*-------------------------------------*
Function ShowImg( oDlg, oBtn )
local oImg
local cImage := '.\TESTSBTN.JPG'
@ 120, 0 XIMAGE oImg SOURCE cImage NOBORDER SIZE nWndWidth, nWndHeight-220 OF oDlg UPDATE
oImg:FitWidth()
oImg:FitHeight()
oImg:lBmpTransparent := .T.
@ 200, 400 SBUTTON oBtn[1] PROMPT 'Walk-In' OF oImg ;
SIZE 460, 460 PIXEL ;
RESOURCE "WALKIN" ;
FONT oFont40 ;
LOOK W97 ;
TEXT POSITION ON_BOTTOM ;
ACTION MsgInfo('ok')
@ 200,1000 SBUTTON oBtn[2] PROMPT 'Booking' OF oImg ;
SIZE 460, 460 PIXEL ;
RESOURCE "BOOKING" ;
FONT oFont40 ;
LOOK W97 ;
TEXT POSITION ON_BOTTOM ;
ACTION MsgInfo('ok')
@ 700, 800 SBUTTON oBtn[2] PROMPT 'Back' OF oImg ;
SIZE 150,150 PIXEL ;
FONT oFont40 ;
LOOK W97 ;
ROUNDRECT ;
TEXT ON_BOTTOM ;
COLORS CLR_BLACK ;
ACTION oDlg:End()
return .T.