#include "FiveWin.ch"
Function Test()
local oFont,oBold
local oDlgSub,oBarSub
local nRecord
local oBtnAnnulla,oBtnAiuto,oBtnConferma
local oCursorBtn :=TCursor():New(,'HAND')
local nWd := GetSysMetrics(0) * .35
local nHt := (GetSysMetrics(1) / 5 )
local ddatacambio:=ctod(" / / "),cGiorno:="",nCambio:=""
local nRow:= 0,nCol:= 10
local nInterlinea := 30
local oBtnGetExchange
local cMoneta_azienda:="EUR"
local oSay:=array(2)
local aGet:=array(2)
oFont := TFont():New( "Tahoma", 0, 14,, )
oBold := TFont():New( "Tahoma", 0, 14,,.t. )
DEFINE DIALOG oDlgSub SIZE nWd, nHt PIXEL TRUEPIXEL ;
COLOR CLR_BLACK, RGB( 245,245,235) FONT oFont ;
TITLE "test"
//------------------------------------------ButtonBar
DEFINE BUTTONBAR oBarSub OF oDlgSub SIZE 80, 70 2015 BOTTOM NOBORDER
oBarSub:bRClicked = { || nil }
DEFINE BUTTON oBtnAnnulla OF oBarSub ;
FILENAME "DLG_NO";
PROMPT "Annulla" TOOLTIP "Esci" ;
ACTION ( oDlgSub:end( IDCANCEL ) )
DEFINE BUTTON oBtnAiuto OF oBarSub ;
FILENAME "HLP_DLG";
PROMPT "Aiuto" TOOLTIP "Aiuto" ;
ACTION NIL GROUP
DEFINE BUTTON oBtnConferma OF oBarSub BTNRIGHT ;
FILENAME "DLG_OK";
PROMPT "Conferma" ;
TOOLTIP "Conferma i dati" ;
ACTION ( oDlgSub:end( IDOK ) )
oBarSub:bClrGrad := { | lPressed | If( ! lPressed,;
{ { 1, RGB( 250,250,245), RGB( 250,250,245)} },;
{ { 1, RGB( 245,245,235), RGB( 245,245,235)} } ) }
//------------------------------------------ButtonBar
nRow+=8
@ nRow, 10 SAY oSay[1] PROMPT "Data " SIZE 100,25 PIXEL OF oDlgSub TRANSPARENT FONT oFont
nRow-=2
@ nRow, 70 GET aGet[1] VAR ddatacambio SIZE 100,24 PIXEL OF oDlgSub;
BITMAP "CALEND" ACTION NIL //msgdate(ddatacambio,"Seleziona una data",aGet[1])
nRow+=nInterlinea
@ nRow,10 SAY oSay[2] PROMPT "Cambio" SIZE 100,25 PIXEL OF oDlgSub TRANSPARENT FONT oFont
nRow-=2
@ nRow, 70 GET aGet[2] VAR nCambio SIZE 250,24 PIXEL OF oDlgSub RIGHT
@ nRow-0.2, 320 BTNBMP oBtnGetExchange ;
PROMPT "Aggiorna on line" OF oDlgSub;
SIZE 120, 24 PIXEL FLAT GDIPLUS ; //
BITMAP "BTN_INTERNET" LEFT NOROUND ;
ACTION (nCambio:= GetExchangeRates(cMoneta_azienda,cCode,ddatacambio),;
aGet[2]:refresh(), oBarSub:setfocus() ) WHEN !empty(ddatacambio)
oBtnGetExchange:bClrGrad := { | lPressed | If( ! lPressed,;
{ { 1, RGB( 250,250,245), RGB( 250,250,245)} },;
{ { 1, RGB( 245,245,235), RGB( 245,245,235)} } ) }
oBtnGetExchange:nClrBorder := RGB(195,195,185)
oBtnGetExchange:oCursor:= oCursorBtn
ACTIVATE DIALOG oDlgSub CENTER ;
ON INIT ( oDlgSub:resize(),;
ChangeButtons( oBarSub))
return nil
//----------------------------------------------------------------------------------------//
Function GetExchangeRates(cCurrency,cMoneta,dDate)
return "1.0807"
//----------------------------------------------------------------------------------------//
function ChangeButtons( oBar )
AEval( oBar:aControls, { | oCtrl | oCtrl:nTop += 4, oCtrl:nHeight -= 4 } )
return .T.
//----------------------------------------------------------------------------------------//