I create this function to create buttons :
- Code: Select all Expand view
STATIC FUNCTION makebuttons(X,y,oCassa,oFont,oGet,oLBX)
LOCAL k
BOTTONI :=40
n := 1
aBtn := Array(BOTTONI)
X = 20
Y = 810
USE LISTBAR Alias LISTBAR
INDEX ON LISTBAR->PUSH TO LISTBAR
FOR k := 1 TO BOTTONI
cCaption := ""
nBottone:=n
LISTBAR->(DbSeek(nBottone))
cCaption := AllTrim(LISTBAR->CODICE)
IF !Empty( cCaption )
@ X+2 ,Y BUTTON aBtn[n] PROMPT cCaption OF oCassa FONT oFont ;
SIZE 140,85 PIXEL
ELSE
@ X+2 ,Y BUTTON aBtn[n] PROMPT Str(nBottone,3,0) OF oCassa FONT oFont ;
SIZE 140,85 PIXEL
ENDI
* SayNum(oGet,5)
aBtn[n]:bAction := {|oBtn| AddLbx(oGet,oBtn,oLbx) }
// SE C'è L'ARTICOLO SI OPPURE NO CHIARO?????
IF !Empty(cCaption )
aBtn[n]:cargo := { 'Full', n }
ELSE
aBtn[n]:cargo := { 'Empty', n }
ENDIF
X +=85
n++
LISTBAR->(dbskip())
IF n= 11 .OR. n=21 .OR. n=31
X=20
Y=Y+145
ENDIF
NEXT
y=810
@ X+2 ,Y BUTTON aPag1 PROMPT PAGINA1 OF oCassa FONT oFont ;
SIZE 140,50 PIXEL
Y=Y+145
@ X+2 ,Y BUTTON aPag2 PROMPT PAGINA2 OF oCassa FONT oFont ;
SIZE 140,50 PIXEL
Y=Y+145
@ X+2 ,Y BUTTON aPag1 PROMPT PAGINA3 OF oCassa FONT oFont ;
SIZE 140,50 PIXEL
Y=Y+145
@ X+2 ,Y BUTTON aPag1 PROMPT PAGINA4 OF oCassa FONT oFont ;
SIZE 140,50 PIXEL
RETURN NIL
Now I create only 40 buttons because I want insert on bottom another buttons
Page1,Page2,Page3 and Page4
when I clicked on pag2 the procedure must me show the interval from button number 41 to button number 80
How I can Make it ?
Regards[/b]