Can I put advisory text in an 'ask' dialog?
Mark Smith
Mark_Smith at cpe.umanitoba.ca
Wed Apr 11 21:53:26 EDT 2012
Hi Graham, when I need advisory text I often put it into a custom property
and use a set of routines I've written for a behavior to handle the display
(which can be used on any platform). Here's the routine that displays the
advisory text:
command ShowPrompt
if the cprompt of me is not empty then
set the forecolor of me to "lightgray"
set the text of me to the cPrompt of me
end if
end ShowPrompt
Now to manage it:
on openfield
if the text of me = the cprompt of me and the forecolor of me is
"lightgray" then
set the forecolor of me to black
put empty into me
else
select the text of me
end if
end open field
and
on exitField
if the text of me is empty then ShowPrompt
pass exitField
end exitField
I also do the same for closefield....
on closeField
if the text of me is empty then ShowPrompt
pass closeField
end closeField
or sometimes I'll initialize the advisory text from an opencard or
preopencard handler:
repeat with x = 1 to the number of fields of this card
if fld x is empty then
if the cprompt of fld x is not empty then
set the forecolor of fld x to "lightgray"
put the cprompt of fld x into fld x -- cprompt is a custom
property of the field
end if
end if
end repeat
I think this is pretty much what Hugh Senior was saying as well.
Hope it helps.....
-- Mark
--
View this message in context: http://runtime-revolution.278305.n4.nabble.com/Can-I-put-advisory-text-in-an-ask-dialog-tp4546291p4550733.html
Sent from the Revolution - User mailing list archive at Nabble.com.
More information about the use-livecode
mailing list