why it is wrong ?
How I can Know if a checkbox is true or false ?
Please try this test , why I cannot change the state of checkboxes with select_All() )
- Code: Select all Expand view
#include "FiveWin.ch"
#include "Constant.ch"
Function test()
local oDlg,oFont
local aRuote := {"Bari","Cagliari","Firenze","Genova",;
"Milano","Napoli","Palermo","Roma","Torino",;
"Venezia","Nazionale","Tutte"}
local aValues := Array( 12 )
local nRow:=30
local nCol:= 5
local nSize1:= 50
local nSize2:= 10
local nBottom := 44
local nRight := 110
local nWidth := Max( nRight * DLG_CHARPIX_W, 180 )
local nHeight := nBottom * DLG_CHARPIX_H
AFill( aValues, .F. )
DEFINE FONT oFont NAME "Tahoma" SIZE 0, -11
DEFINE DIALOG oDlg ;
TITLE "test" ;
SIZE nWidth, nHeight PIXEL ;
COLOR CLR_BLACK,CLR_WHITE RESIZABLE
@ nRow,nCol CHECKBOX aValues[ 1 ] Prompt aRuote[1] SIZE nSize1, nSize2 PIXEL OF oDlg
nRow+=12
@ nRow,nCol CHECKBOX aValues[ 2 ] Prompt aRuote[2] SIZE nSize1, nSize2 PIXEL OF oDlg
nRow+=12
@ nRow,nCol CHECKBOX aValues[ 3 ] Prompt aRuote[3] SIZE nSize1, nSize2 PIXEL OF oDlg
nRow+=12
@ nRow,nCol CHECKBOX aValues[ 4 ] Prompt aRuote[4] SIZE nSize1, nSize2 PIXEL OF oDlg
nRow+=12
@ nRow,nCol CHECKBOX aValues[ 5 ] Prompt aRuote[5] SIZE nSize1, nSize2 PIXEL OF oDlg
nRow+=12
@ nRow,nCol CHECKBOX aValues[ 6 ] Prompt aRuote[6] SIZE nSize1, nSize2 PIXEL OF oDlg
nRow:=30
nCol:=60
@ nRow,nCol CHECKBOX aValues[ 7 ] Prompt aRuote[7] SIZE nSize1, nSize2 PIXEL OF oDlg
nRow+=12
@ nRow,nCol CHECKBOX aValues[ 8 ] Prompt aRuote[8] SIZE nSize1, nSize2 PIXEL OF oDlg
nRow+=12
@ nRow,nCol CHECKBOX aValues[ 9 ] Prompt aRuote[9] SIZE nSize1, nSize2 PIXEL OF oDlg
nRow+=12
@ nRow,nCol CHECKBOX aValues[ 10 ] Prompt aRuote[10] SIZE nSize1, nSize2 PIXEL OF oDlg
nRow+=12
@ nRow,nCol CHECKBOX aValues[ 11 ] Prompt aRuote[11] SIZE nSize1, nSize2 PIXEL OF oDlg
nRow+=12
@ nRow,nCol CHECKBOX aValues[ 12 ] Prompt aRuote[12] SIZE nSize1, nSize2 PIXEL OF oDlg;
ON CHANGE (Select_All(aValues,aValues[12]))
oDlg:bResized := <||
local oRect := oDlg:GetCliRect()
RETURN NIL
>
ACTIVATE DIALOG oDlg centered;
ON INIT ( Eval(oDlg:bResized) )
RETURN NIL
//--------------------------------------------------------------------------------//
Static Function Select_All(aChk,lValue)
? lValue
For n= 1 to len(aChk)
aChk[n]:SetCheck(lValue)
next
return nil
//--------------------------------------------------------------------------------//
I tried also with
@ nRow,nCol CHECKBOX aValues[ 12 ] Prompt aRuote[12] SIZE nSize1, nSize2 PIXEL OF oDlg;
ON CHANGE (Select_All(aValues))
Static Function Select_All(aChk)
local lValue:=aChk[12]:lchecked()
For n= 1 to 11 //len(aChk)
aChk[n]:SetCheck(lValue)
next
return nil