checkbox

This forum is for eXpress++ general support.
Post Reply
Message
Author
c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

checkbox

#1 Post by c-tec »

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
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

reganc
Posts: 259
Joined: Thu Jan 28, 2010 3:08 am
Location: Hersham, Surrey, UK
Contact:

Re: checkbox

#2 Post by reganc »

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.
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: checkbox

#3 Post by rdonnay »

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.

c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Re: checkbox

#4 Post by c-tec »

Hello Roger,
thank you, exactly what I need
regards
Rudolf
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

Post Reply