Página 1 de 1

Control with array List 'tick' boxes ....

Publicado: Mié Mar 09, 2011 2:01 pm
por ChrisGillard
Hi,
I want to create a list of say 'Clubs' or 'Interests' that a person has and
allow them to 'tick' the 'Cluds or 'Interests' they have. The List of
'Clubs' or 'Interests' are maintained in a .dbf.
I have loaded an array browse from the dbf with the necessary columns and an
extra column for the 'ticks' ... see image.
I have made column 3 editable ..... so I can type say an X in the column
where necessary.
My questions are ....
1. Is there a Xailer control that would do this for me more easily? Maybe
a Column edit type of 'CheckBox'?
2. If I do use an arraybrowse like here ...... I want to set the X just
with the Spacebar ... I can add code to the oGridEdit:onChar event and
detect nKey=32 but dont know how to return an X to the screen.
3. If I do use an arraybrowse like here ...... I want to minimise keypresses
and EXIT my get using the UP/DOWN keys but I think these are captured at the
browse level and I cannot find an event to capture them and force the
oGridEdit to exit.
Any suggestions would be appreciated.
Regards, Chris


Attached files

Control with array List 'tick' boxes ....

Publicado: Mié Mar 09, 2011 2:35 pm
por ChrisGillard
Hi,
I have solved my own Questio 2 ... Setting to X ... I need to set the
oGridEdit:Value to X ... simple.
Question 3, detecting UP/DOWN arrows and exiting the oGridEdit ... still
struggling on that.
Chris
"Chris Gillard" <chris@bluesquare.co.uk> wrote in message
news:4d777a45$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
> Hi,
>
> I want to create a list of say 'Clubs' or 'Interests' that a person has
> and allow them to 'tick' the 'Cluds or 'Interests' they have. The List of
> 'Clubs' or 'Interests' are maintained in a .dbf.
>
> I have loaded an array browse from the dbf with the necessary columns and
> an extra column for the 'ticks' ... see image.
>
> I have made column 3 editable ..... so I can type say an X in the column
> where necessary.
>
> My questions are ....
>
> 1. Is there a Xailer control that would do this for me more easily?
> Maybe a Column edit type of 'CheckBox'?
>
> 2. If I do use an arraybrowse like here ...... I want to set the X just
> with the Spacebar ... I can add code to the oGridEdit:onChar event and
> detect nKey=32 but dont know how to return an X to the screen.
>
> 3. If I do use an arraybrowse like here ...... I want to minimise
> keypresses and EXIT my get using the UP/DOWN keys but I think these are
> captured at the browse level and I cannot find an event to capture them
> and force the oGridEdit to exit.
>
> Any suggestions would be appreciated.
>
> Regards, Chris
>
>
>
>
>
>

Control with array List 'tick' boxes ....

Publicado: Mié Mar 09, 2011 4:47 pm
por ignacio
Hi,
1) In case is not a row edition (check the method IsMultipleEdit) I suggest
you use two images for checked & unchecked and change its value on the
TBrwColumn:OnEdit event and returning false. In case is a row edition I
suggest you use a listbox with the values 'Yes' & 'No'
2) It seems you already got this working
3) The keys are first processed by the TBrwColumn:oGridEdit and you can trap
them with oGridEdit:KeyDown() if you want. BTW the Key down and key up are
stopped on the control to avoid the propagation to its container browse.
You may overload TGridEdit to receive those events:
CLASS TGridEdit FROM XGridEdit
METHOD WMKeyDown( nKey, nFlags, hWnd )
END CLASS
METHOD WMKeyDown( nKey, nFlags, hWnd ) CLASS TGridEdit
IF nKey == VK_UP .OR. nKey == VK_DOWN
::OnKeyDown( nKey, nFlags )
ENDIF
RETURN Super:WMKeyDown( nKey, nFlags, hWnd )
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
http://www.xailer.com/forum
http://www.xailer.com/dokuwiki
"Chris Gillard" escribió en el mensaje de
noticias:4d777a45$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
Hi,
I want to create a list of say 'Clubs' or 'Interests' that a person has and
allow them to 'tick' the 'Cluds or 'Interests' they have. The List of
'Clubs' or 'Interests' are maintained in a .dbf.
I have loaded an array browse from the dbf with the necessary columns and an
extra column for the 'ticks' ... see image.
I have made column 3 editable ..... so I can type say an X in the column
where necessary.
My questions are ....
1. Is there a Xailer control that would do this for me more easily? Maybe
a Column edit type of 'CheckBox'?
2. If I do use an arraybrowse like here ...... I want to set the X just
with the Spacebar ... I can add code to the oGridEdit:onChar event and
detect nKey=32 but dont know how to return an X to the screen.
3. If I do use an arraybrowse like here ...... I want to minimise keypresses
and EXIT my get using the UP/DOWN keys but I think these are captured at the
browse level and I cannot find an event to capture them and force the
oGridEdit to exit.
Any suggestions would be appreciated.
Regards, Chris

Control with array List 'tick' boxes ....

Publicado: Mié Mar 09, 2011 5:23 pm
por jlalin
Chris,
you can do it with a Treeview control.
Drop a TTreeview on a form and set lLinesAtRoot to .F. and lCheckBoxes to
.F., add the items and you are done.
To check what items are selected just loop the :aItems property:
AEval( ::oTreeview:aItems, {|oItem| IIf( oItem:lChecked, ...
Saludos,
José Lalí­n

Control with array List 'tick' boxes ....

Publicado: Mié Mar 09, 2011 5:24 pm
por jlalin
Chris,
> lCheckBoxes to .F., add the items and you are done.
ups, I meant .T.
Regards,
José Lalí­n

Control with array List 'tick' boxes ....

Publicado: Jue Mar 10, 2011 6:31 pm
por ChrisGillard
Ignacio,
Thanks for your time in explaining some of the inner workings.
The overloading of Methods is something I need to remember particularly for
key handling in special cases.
I will see how I get on.
Thanks
Chris
"Ignacio Ortiz de Zúñiga" <NoNameToAvoidSpam@xailer.com> wrote in message
news:[email=4d77a10a@svctag-j7w3v3j....]4d77a10a@svctag-j7w3v3j....[/email]
> Hi,
>
> 1) In case is not a row edition (check the method IsMultipleEdit) I
> suggest you use two images for checked & unchecked and change its value on
> the TBrwColumn:OnEdit event and returning false. In case is a row edition
> I suggest you use a listbox with the values 'Yes' & 'No'
>
> 2) It seems you already got this working
>
> 3) The keys are first processed by the TBrwColumn:oGridEdit and you can
> trap them with oGridEdit:KeyDown() if you want. BTW the Key down and key
> up are stopped on the control to avoid the propagation to its container
> browse.
>
> You may overload TGridEdit to receive those events:
>
> CLASS TGridEdit FROM XGridEdit
>
> METHOD WMKeyDown( nKey, nFlags, hWnd )
>
> END CLASS
>
> METHOD WMKeyDown( nKey, nFlags, hWnd ) CLASS TGridEdit
>
> IF nKey == VK_UP .OR. nKey == VK_DOWN
> ::OnKeyDown( nKey, nFlags )
> ENDIF
>
> RETURN Super:WMKeyDown( nKey, nFlags, hWnd )
>
>
>
>
> Ignacio Ortiz de Zúñiga
> [Equipo de Xailer / Xailer team]
> http://www.xailer.com
> http://www.xailer.info
> http://www.xailer.com/forum
> http://www.xailer.com/dokuwiki
> "Chris Gillard" escribió en el mensaje de
> noticias:4d777a45$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
>
> Hi,
>
> I want to create a list of say 'Clubs' or 'Interests' that a person has
> and
> allow them to 'tick' the 'Cluds or 'Interests' they have. The List of
> 'Clubs' or 'Interests' are maintained in a .dbf.
>
> I have loaded an array browse from the dbf with the necessary columns and
> an
> extra column for the 'ticks' ... see image.
>
> I have made column 3 editable ..... so I can type say an X in the column
> where necessary.
>
> My questions are ....
>
> 1. Is there a Xailer control that would do this for me more easily?
> Maybe
> a Column edit type of 'CheckBox'?
>
> 2. If I do use an arraybrowse like here ...... I want to set the X just
> with the Spacebar ... I can add code to the oGridEdit:onChar event and
> detect nKey=32 but dont know how to return an X to the screen.
>
> 3. If I do use an arraybrowse like here ...... I want to minimise
> keypresses
> and EXIT my get using the UP/DOWN keys but I think these are captured at
> the
> browse level and I cannot find an event to capture them and force the
> oGridEdit to exit.
>
> Any suggestions would be appreciated.
>
> Regards, Chris
>
>
>
>
>

Control with array List 'tick' boxes ....

Publicado: Jue Mar 10, 2011 6:32 pm
por ChrisGillard
Jose,
Thanks for guiding me towards a TTreeview with check boxes.
I am experimenting with that and it is almost perfect.
Thanks
Chris
"José Lalín" <dezac@corevia.com> wrote in message
news:4d77a99a$[email=2@svctag-j7w3v3j....]2@svctag-j7w3v3j....[/email]
Chris,
you can do it with a Treeview control.
Drop a TTreeview on a form and set lLinesAtRoot to .F. and lCheckBoxes to
..F., add the items and you are done.
To check what items are selected just loop the :aItems property:
AEval( ::oTreeview:aItems, {|oItem| IIf( oItem:lChecked, ...
Saludos,
José Lalín

Control with array List 'tick' boxes ....

Publicado: Jue Mar 10, 2011 9:01 pm
por jlalin
Chris,
you are welcome!
Regards,
José Lalí­n