Hello,
I would like to get checkboxes in the middle of a line and not at the bottom. So I try to make my own :
#command @ <nGetRow> -.3 [,<nGetCol>] MYCHECKBOX [<uVar>] ...
but it does not work, invalid use of ... How can I get this working
regards
Rudolf
checkbox
Re: checkbox
I have used something like the following on a DCCHECKBOX line:
EVAL {|o| o:setPos({o:CurrentPos()[1],o:CurrentPos()[2]+((nRowHgt-o:currentsize()[2])/2)}) } ;
It is an attempt to centre the checkbox within a row using the actual height of the checkbox.
I often use a separate DCSAY for the prompt as well so you have more control over how it looks.
These and comboboxes don't have a standard height. They can look real odd if you don't adjust them.
EVAL {|o| o:setPos({o:CurrentPos()[1],o:CurrentPos()[2]+((nRowHgt-o:currentsize()[2])/2)}) } ;
It is an attempt to centre the checkbox within a row using the actual height of the checkbox.
I often use a separate DCSAY for the prompt as well so you have more control over how it looks.
These and comboboxes don't have a standard height. They can look real odd if you don't adjust them.
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com
Real Business Applications Ltd
http://www.rbauk.com
Re: checkbox
This may be what you are looking for:
Code: Select all
#INCLUDE "dcdialog.CH"
#INCLUDE "appevent.CH"
#command @ <row>, <col> MyCheckBox <lCheck> PROMPT <cPrompt> ;
=> ;
MyCheckBox( <row>, <col>, @<lCheck>, <cPrompt>, GetList )
FUNCTION Main()
LOCAL GetList[0], lCheck1 := .f., lCheck2 := .t.
@ 0,0 MyCheckBox lCheck1 PROMPT 'This is checkbox #1'
@ 2,0 MyCheckBox lCheck2 PROMPT 'This is checkbox #2'
DCREAD GUI FIT ADDBUTTONS TITLE 'Custom Checkbox command'
RETURN nil
* ---------
PROC appsys ; RETURN
* ---------
FUNCTION MyCheckBox( nRow, nCol, lCheck, cPrompt, GetList )
LOCAL oCheck
@ nRow, nCol DCCHECKBOX lCheck PROMPT '' OBJECT oCheck
@ DCGUI_ROW, DCGUI_COL DCSAY cPrompt SAYSIZE 0 SAYBOTTOM ;
EVAL {|o|o:lbUp := {|a,b,o|oCheck:setData(!oCheck:getData())}}
RETURN nil
The eXpress train is coming - and it has more cars.
Re: checkbox
Hello Roger,
thank you, exactly what I need
regards
Rudolf
thank you, exactly what I need
regards
Rudolf