DEFINE DIALOG oDlg SIZE Int( ScreenWidth() * 0.85 ), Int( ScreenHeight() * 0.85) PIXEL TRUEPIXEL;
FONT oFont TITLE "RIFORNIMENTO"
@ 0,0 XBROWSE oBrw SIZE -20,-90 PIXEL OF oDlg ;
DATASOURCE "RF" NOBORDER LINES FONT oFont
aBrowse := {{ { || RF->RFNUMERO }, i18n("Numero Mov."), 120, },;
{ { || RF->RFAUTO }, i18n("Automezzo"), 120, },;
{ { || RF->RFCISTERNA }, i18n("Cisterna"),250, },;
{ { || CF(RF->RFFECRIF) }, i18n("Data "),120, },;
{ { || RF->RFLITRI }, i18n("Litri"),80, },;
{ { || RF->RFTOTALE }, i18n("Totale"),80, },;
{ { || "" }, i18n("Pieno"),60, },;
{ { || RF->RFKMMEZZO }, i18n("Kilometri"),120, },;
{ { || RF->RFCOSTOLIT }, i18n("Costo/litro"),120, }}
FOR i := 1 TO Len(aBrowse)
oCol := oBrw:AddCol()
oCol:bEditValue := aBrowse[ i, 1 ]
* oCol:bStrData := aBrowse[ i, 1 ]
oCol:cHeader := aBrowse[ i, 2 ]
oCol:nWidth := aBrowse[ i, 3 ]
if !Empty(aBrowse[ i, 4 ])
oCol:cEditPicture:=aBrowse[ i, 4 ]
Endif
NEXT
WITH OBJECT oBrw
WITH OBJECT oBrw:aCols[7]
:AddResource("FLAG_GREEN")
:AddResource("FLAG_RED")
:bBmpData := { || IIF( RF->RFFULL,1,2) }
END
END
FOR i := 1 TO LEN(oBrw:aCols)
oCol := oBrw:aCols[ i ]
oCol:bClrSelFocus := { || { CLR_BLACK, nRGB(202,224,252) } }
NEXT
oBrw:nHeaderHeight := 45
oBrw:nRowHeight := 50
* oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROWRC
oBrw:l2007 := .f.
oBrw:l2015 := .t.
oBrw:SetRDD()
oBrw:CreateFromCode()
oBrw:nStretchCol := -1 //visione ottimale per tablet?
@ oBrw:nBottom+5, 5 BUTTONBMP aBtn[1] ;
BITMAP ".\bitmaps\up.ico" ;
SIZE 60, 60 PIXEL OF oDlg ;
ACTION ( oBrw:KeyDown(VK_UP, 0), oBrw:SetFocus() )
@ oBrw:nBottom+15, 75 BUTTONBMP aBtn[2];
BITMAP ".\bitmaps\DOWN.ico" ;
SIZE 60, 60 PIXEL OF oDlg ;
ACTION ( oBrw:KeyDown(VK_DOWN, 0), oBrw:SetFocus() )
@ oBrw:nBottom+5, 140 BUTTONBMP aBtn[3] ;
BITMAP ".\bitmaps\page_up.ico" ;
SIZE 60, 60 PIXEL OF oDlg ;
ACTION ( oBrw:GoTop(), oBrw:SetFocus() )
@ oBrw:nBottom+15, 210 BUTTONBMP aBtn[4];
BITMAP ".\bitmaps\page_down.ico" ;
SIZE 60, 60 PIXEL OF oDlg ;
ACTION ( oBrw:GoBottom(), oBrw:SetFocus() )
@ oBrw:nBottom+15, 280 BUTTONBMP aBtn[5];
BITMAP ".\BITMAPS\benzinasi.png" ;
SIZE 60, 60 PIXEL OF oDlg ;
ACTION RFEdita(oBrw, 1, oDlg,,aMezzi)
@ oBrw:nBottom+15, 350 BUTTONBMP aBtn[6];
BITMAP ".\BITMAPS\benzinamo.png" ;
SIZE 60, 60 PIXEL OF oDlg ;
ACTION RFEdita(oBrw, 2, oDlg,,aMezzi)
@ oBrw:nBottom+15, 420 BUTTONBMP aBtn[7];
BITMAP ".\BITMAPS\benzinano.png" ;
SIZE 60, 60 PIXEL OF oDlg ;
ACTION RFBorra(oBrw)
@ oBrw:nBottom+15, 490 BUTTONBMP aBtn[8];
BITMAP ".\BITMAPS\benzinacer.png" ;
SIZE 60, 60 PIXEL OF oDlg ;
ACTION NIL
@ oBrw:nBottom+15, 560 BUTTONBMP aBtn[9];
BITMAP ".\BITMAPS\benzinasta.png" ;
SIZE 60, 60 PIXEL OF oDlg ;
ACTION NIL
@ oBrw:nBottom+15, 630 BUTTONBMP aBtn[10];
BITMAP ".\BITMAPS\benzinaexi.png" ;
SIZE 60, 60 PIXEL OF oDlg ;
ACTION oDlg:end()
oDlg:bOnDisplayChange := { || DlgResize( oDlg,aBtn ) }
ACTIVATE DIALOG oDlg CENTERED ON INIT DlgResize( oDlg,aBtn )
DbCloseAll()
oFont:End()
return nil
STATIC function DlgResize( oDlg,aBtn )
local i, j, n, r, c, w, h
WITH OBJECT oDlg
:nWidth := Int( ScreenWidth() * 0.85 )
:nHeight := Int( ScreenHeight() * 0.85 )
w := ( :nWidth - 60 ) / 4
h := ( :nHeight - 80 ) / 3
END
for n= 1 to 10
aBtn[n]:nTop:= Int( ScreenHeight() * 0.85 ) - 100
next
aBtn[01]:nLeft:= Int( ScreenWidth() * 0.85 ) -676
aBtn[02]:nLeft:= Int( ScreenWidth() * 0.85 ) -612
aBtn[03]:nLeft:= Int( ScreenWidth() * 0.85 ) -548
aBtn[04]:nLeft:= Int( ScreenWidth() * 0.85 ) -484
aBtn[05]:nLeft:= Int( ScreenWidth() * 0.85 ) -420
aBtn[06]:nLeft:= Int( ScreenWidth() * 0.85 ) -356
aBtn[07]:nLeft:= Int( ScreenWidth() * 0.85 ) -292
aBtn[08]:nLeft:= Int( ScreenWidth() * 0.85 ) -228
aBtn[09]:nLeft:= Int( ScreenWidth() * 0.85 ) -164
aBtn[10]:nLeft:= Int( ScreenWidth() * 0.85 ) -100
oDlg:Center()
oDlg:Refresh()
return nil