by Robert Frank » Wed Dec 05, 2007 9:51 pm
Creating a browse:
Function LISTA_BADAN()
Local oBTN:=Array(20)
Local xPOZB:= 0
Local yPOZB:= 0
Local xPOZE:=800 // szerokosc
Local yPOZE:=550 // wysokosc
Local xRECT
Local oBRUSH
DEFINE BRUSH oBRUSH FILENAME "BACKGRND\TLO_DG.BMP"
DEFINE DIALOG oWNDF ;
FROM yPOZB,xPOZB TO yPOZE,xPOZE PIXEL ;
BRUSH oBRUSH ;
TITLE AllTrim(OemToAnsi(RR->NAZW))+' '+AllTrim(OemToAnsi(RR->IMIE))+' '+AllTrim(Str(RR->RECNO,8,0))+' / '+AllTrim(Str(RR->BARCODE,8,0))
Select("FF")
TABBAD_INIT(RR->RECNO)
oBRWF := TXBrowse():New( oWNDF )
oBRWF :SetArray( xTABBAD,.F.) // nie szukaj po badaniach
oBRWF :nHeaderLines := 2
oBRWF :nDataLines := 1
oBRWF :lFooter :=.t.
oBRWF :aCols[3]:cHeader := "Nazwa"+sCRLF+"badania"
oBRWF :aCols[3]:cFooter := "RAZEM : "
oBRWF :aCols[4]:cHeader := "Cena"+sCRLF+"badania"
oBRWF :aCols[4]:cFooter := Transform(nRABAT,"#####.##")
oBRWF :aCols[6]:cHeader := "Cena"+sCRLF+"amb."
oBRWF :aCols[6]:cFooter := Transform(nRAZEM,"#####.##")
oBRWF :aCols[5]:cHeader := "Pracownia"
oBRWF :aCols[5]:cFooter := IIF(nRAZEM=0,"",AllTrim(Transform(ABS((nRABAT/nRAZEM)*100-100),"#####.##"))+"%")
oBRWF :aCols[7]:cHeader := "Data i godzina akceptacji"
oBRWF :aCols[7]:cFooter := "-"
oBRWF :aCols[8]:cHeader := "Tube"
oBRWF :aCols[8]:cFooter := "-"
oBRWF :aCols[9]:cHeader := "Pozycja"
oBRWF :aCols[9]:cFooter := "-"
oBRWF :bClrHeader := {|| { nRGB(0,0,0), nRGB(222,227,247) } }
oBRWF :bClrFooter := oBRWF:bClrHeader
oBRWF :bClrStd := oBRWF:bClrHeader
oBRWF :nMarqueeStyle := MARQSTYLE_HIGHLROW
oBRWF :nColDividerStyle := LINESTYLE_DARKGRAY
oBRWF :nRowDividerStyle := LINESTYLE_DARKGRAY
oBRWF :nHeaderHeight :=50
oBRWF :CreateFromCode()
oBRWF :nTop = 22
oBRWF :nLeft = 0
oBRWF :nWidth = 600
oBRWF :nHeight =300
oBRWF:bKeyDown:={|nKEY| JAKIFFDown(nKEY) }
//oBRWF:bKeyChar:={|nKEY| JAKIFFChar(nKEY) }
@0, 0 BTNBMP oBTN[ 1] FILE "BMP\B_REB_1.BMP" OF oWNDF NOBORDER ;
ACTION (F_EDYCJA("N"),oBRWF:SetFocus())
oBTN[ 1]:cToolTip:="Dodaj badanie"
oBTN[ 1]:lTransparent:=.T.
@0, 20 BTNBMP oBTN[ 2] FILE "BMP\B_REB_2.BMP" OF oWNDF NOBORDER ;
ACTION (F_DODAJP(),oBRWF:SetFocus())
oBTN[ 2]:cToolTip:="Dodaj profil"
oBTN[ 2]:lTransparent:=.T.
@0, 40 BTNBMP oBTN[ 3] FILE "BMP\B_REB_3.BMP" OF oWNDF NOBORDER ;
ACTION (F_SKASUJ(),oBRWF:SetFocus())
oBTN[ 3]:cToolTip:=Ptxt("Usu~n badanie")
oBTN[ 3]:lTransparent:=.T.
@0, 60 BTNBMP oBTN[ 4] FILE "BMP\B_REB_4.BMP" OF oWNDF NOBORDER ;
ACTION FAKTURA()
oBTN[ 4]:cToolTip:="Wydruk faktury"
oBTN[ 4]:lTransparent:=.T.
@0, 80 BTNBMP oBTN[ 5] FILE "BMP\B_REB_5.BMP" OF oWNDF NOBORDER ;
ACTION DRUKUJ()
oBTN[ 5]:cToolTip:="Wydruk KP"
oBTN[ 5]:lTransparent:=.T.
@0,100 BTNBMP oBTN[ 6] FILE "BMP\B_REB_6.BMP" OF oWNDF NOBORDER ;
ACTION FISZKA()
oBTN[ 6]:cToolTip:=Ptxt("Wydruk przyj~etych zlece~n")
oBTN[ 6]:lTransparent:=.T.
@0,120 BTNBMP oBTN[ 7] FILE "BMP\B_REB_7.BMP" OF oWNDF NOBORDER ;
ACTION DAJ_RABAT()
oBTN[ 7]:cToolTip:=Ptxt("Udzielenie rabatu za wykonywane us~lugi")
oBTN[ 7]:lTransparent:=.T.
@0,140 BTNBMP oBTN[ 8] FILE "BMP\B_REB_8.BMP" OF oWNDF NOBORDER ;
ACTION COFNIJ_RABAT()
oBTN[ 8]:cToolTip:=Ptxt("Przywr~ocenie cen pierwotnych")
oBTN[ 8]:lTransparent:=.T.
@0,160 BTNBMP oBTN[ 9] FILE "BMP\ILOSC.BMP" OF oWNDF NOBORDER ;
ACTION ILOSC_BADAN()
oBTN[ 9]:cToolTip:=Ptxt("Ilo~s~c bada~n")
oBTN[ 9]:lTransparent:=.T.
@0,180 BTNBMP oBTN[10] FILE "BMP\B_REB_9.BMP" OF oWNDF NOBORDER ;
ACTION oWNDF:End()
oBTN[10]:cToolTip:=Ptxt("Zamkni~ecie bie~z~acego okna")
oBTN[10]:lTransparent:=.T.
@0,200 BTNBMP oBTN[11] FILE "BMP\DRUKKK.BMP" OF oWNDF NOBORDER ;
ACTION REJ_KK('',Str(RR->RECNO),{RR->NAZW,RR->IMIE},xTABBAD)
oBTN[11]:cToolTip:=Ptxt("Drukuj kod kreskowy dla punktu pobra~n")
oBTN[11]:lTransparent:=.T.
@0,220 BTNBMP oBTN[12] FILE "BMP\DRUKKKM.BMP" OF oWNDF NOBORDER ;
ACTION FF_WYDRUKUJ_KODY(RR->RECNO,RR->BARCODE,xTABBAD)
oBTN[12]:cToolTip:=Ptxt("Drukuj kody kreskowy dla zlecenia")
oBTN[12]:lTransparent:=.T.
If .NOT. CZY_MA_PRAWO(17)
oBTN[7]:Disable()
oBTN[8]:Disable()
oBTN[9]:Disable()
EndIf
ACTIVATE DIALOG oWNDF VALID ZWOLNIJ() ON INIT (ODSWIEZ(),oBRWF:SetSize( 799, 490 ),oBRWF:SetFocus()) CENTERED
Return NIL
Robert Frank