VID: Check problem
[1/4] from: kpeters::otaksoft::com at: 1-Oct-2007 9:48
I use the code below to "lock" faces on data entry screens to prevent
users from accidentally changing things.
II just noticed that I cannot seem to update checks when they are
locked
- that workd fine for all other faces.
How can I handle this?
Thanks
Kai
lock-fields: func[ pane [block!] flag [logic!] ][
either flag
[ unfocus
foreach face pane [
if any [ face/style = 'field
face/style = 'fld
face/style = 'btn
face/style = 'defbtn
face/style = 'rotary
face/style = 'rot
face/style = 'choice
face/style = 'sel
face/style = 'check ] [ face/feel: none ]
]
][ foreach face pane [
if face/style = 'check [
face/feel: svvf/check ]
if any [ face/style = 'field face/style = 'fld ] [
face/feel: ctx-text/edit ]
if any [ face/style = 'rotary face/style = 'rot ] [
face/feel: svvf/rotary ]
if any [ face/style = 'choice face/style = 'sel ] [
face/feel: svvf/choice ]
if any [ face/style = 'btn face/style = 'defbtn] [
face/feel: svvf/btn ]
]
]
]
[2/4] from: sant4::wanadoo::fr at: 1-Oct-2007 21:59
Hi,
What are you doing to update check boxes ?
Did you notice that when you remove the feel object, then the face can't be redrawed
even if it has been updated ?
I would try to remove the feel/engage function only (not the whole feel object)
A better solution is to not modify the sub-faces but the face container to block the
'down event (using the detect function) for all sub-faces. But in that case, the action
buttons should not stay in the same container.
==Steeve
[3/4] from: anton::wilddsl::net::au at: 2-Oct-2007 17:48
Hi Kai,
Just a small optimization.
These are equivalent (in your lock-fields function, anyway):
any [ face/style == 'field
face/style == 'fld
face/style == 'btn
face/style == 'defbtn
face/style == 'rotary
face/style == 'rot
face/style == 'choice
face/style == 'sel
face/style == 'check ]
find [
field fld btn defbtn rotary rot choice sel check
] face/style
Anton.
[4/4] from: kpeters::otaksoft::com at: 1-Oct-2007 18:46
On Mon, 1 Oct 2007 23:21:13 +0200 (CEST), Steeve ANTOINE wrote:
> A better solution
> is to not modify the sub-faces but the face container to block the 'down event (using
the detect
> function) for all sub-faces. But in that case, the action buttons should not stay in
the same
> container.
>
> ==Steeve
>
Hi Steeve ~
that strikes me as a far better solution than what I have. Alas, I have no clue as to
how to do what
you suggest.
Would you mind helping me out with a few lines?
Thanks,
Kai