#include "fivewin.ch"
#define ORANGE nRGB( 255, 165, 0 )
#define LIGHTORANGE nRGB( 255, 160, 122 )
function Select90()
Local oBtnOK,oBtnCan,oDlg
DEFINE DIALOG oDlg SIZE 800,380 PIXEL TRUEPIXEL RESIZABLE;
TITLE "test button"
@ 100,10 BUTTON oBtnClose PROMPT "Chiudi" of oDlg SIZE 80,22 ACTION oDlg:End()
oDlg:bResized := <||
local oRect := oDlg:GetCliRect()
oBtnClose:nLeft := oRect:nRight - 100
oBtnClose:nTop := oRect:nBottom - 25
return nil
>
ACTIVATE DIALOG oDLG ;
ON INIT ( BuildTable90(oDlg),;
EVAL( oDlg:bResized))
return nil
Function BuildTable90(oDlg)
local k,j
local xWidth := 40
local xHeight := 30
local xSpace := 1
local nTotCol := 9
local nTotRow := 10
local oBtnNum:= Array( nTotCol, nTotRow )
local nRow:= 25,nCol:= 40
local nNumber:= 0
local oOpe[1]
local oSay
@ 5,4 GROUP oSay To 345,460 Label "0 selezionati e 0 Colonne" TRANSPARENT PIXEL
for t := 1 to nTotRow
for k := 1 to nTotCol
nNumber:= nTotRow * ( k -1) +t
MakeBtn( nrow, ncol, t,k, oDlg,oBtnNum,nNumber,oSay )
nrow+=xHeight +xSpace
next
ncol+=xWidth +xSpace
nrow:= 25
next
xRow:=25;xCol:= 6
@xRow,xCol BUTTONBMP oOpe[1] Prompt "GE" size 30,30 PIXEL FLAT OF oDlg TOOLTIP "Gemelli" ACTION Gemelli(oBtnNum,oSay)
return nil
Function Gemelli(oCmb,oSay)
local atemp:={}
local k,t
atemp:={11, 22, 33, 44, 55, 66, 77, 88}
For n= 1 to Len(atemp)
k:= val(Left(ltrim(str(atemp[n])),1))
t:= val(Right(ltrim(str(atemp[n])),1))
oCmb[k,t]:cargo:=1
SetStatus( oCmb[k,t],oSay)
next
return NIL
return NIL
PROCEDURE SetStatus( oBtn,oSay )
//-------------------------
local n:=0
switch oBtn:cargo[3]
case 1
oBtn:cargo[3] := 2
n++
oBtn:SetColor( CLR_WHITE, ORANGE )
EXIT
case 2
oBtn:cargo[3] := 3
oBtn:SetColor( CLR_BLACK, LIGHTORANGE )
EXIT
case 3
oBtn:cargo[3] := 1
n--
oBtn:SetColor( CLR_BLACK, CLR_WHITE )
end
oBtn:refresh()
RETURN
function MakeBtn( nrow, ncol, t, k, oDlg,oBtnNum,num ,oSay)
@ nrow,ncol BTNBMP oBtnNum[k,t] PROMPT ltrim(str(num)) ;
SIZE 40,30 FLAT PIXEL OF oDlg NOROUND
oBtnNum[k,t]:cargo :={k,t, 1 }
oBtnNum[k,t]:bAction := { | o | SetStatus( o,oSay) }
oBtnNum[k,t]:SetColor( CLR_BLACK, CLR_WHITE )
return nil