conditionally formatting a field

SparkOut SparkOutYNY at gmail.com
Thu Dec 18 17:31:34 EST 2008



Mark Stuart wrote:
> 
> Hi Jan,
> 
> I tried the 'Appearance Manager'. It looks interesting, but for the gain
> in what it gives, I lose the real look and feel of the native platform.
> 
>  
> 
> I do have the 'threeD' property unchecked and the 'borderWidth' set to
> 1.
> 
>  
> 
> If you are on Windows, look at how Outlook behaves with the Find / 'Look
> for' and 'Search In' edit controls.
> 
> Mouse over and out of these controls. Now put the cursor in the 'Look
> for' edit control, and then mouse over and out again.
> 
> This is the behavior I'm looking to do. Kind of basic stuff, but can't
> get it with RunRev.
> 
>  
> 
> So here's a question that may help with this:
> 
> Programmatically, when do I know that a text field has focus?
> 
> Something like: 'if the Focus of me is true then'
> 
>  
> 
> - I tried the focusIn and focusOut - nothing from them.
> 
> - Obviously openField, exitField, and closeField work no problem
> 
> And mouseEnter and mouseLeave have to work with this also.
> 
>  
> 
> Anyone with and idea on this?
> 
>  
> 
> Regards,
> 
> Mark Stuart
> 
>  
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 
> 
This works for me:

on mouseEnter
   set the borderColor of me to "#000000"
end mouseEnter

on mouseLeave
   if the focusedObject is the long id of me then
      set the borderColor of me to "#000000"
   else
      set the borderColor of me to "#ffffff"
   end if
end mouseLeave

--you might think that focus in and out messages would be appropriate
on focusIn
   set the borderColor of me to "#000000"
end focusIn

on focusOut
   set the borderColor of me to "#ffffff"
end focusOut

--but for focusIn, Rev dictionary says:
Comments:
If the control is an unlocked field or a button whose menuMode is
"comboBox", the openField message is sent to it instead of the focusIn
message.

and for focusOut, Rev dictionary says:
Comments:
If the control is an unlocked field or a button whose menuMode is
"comboBox", the closeField or exitField message is sent to it instead of the
focusOut message.

--so check for both exit and close field messages instead
on exitField
   set the borderColor of me to "#ffffff"
end exitField

on closeField
   set the borderColor of me to "#ffffff"
end closeField

All that works fine for me in Rev Studio 3.0 on Windows XP.
-- 
View this message in context: http://www.nabble.com/conditionally-formatting-a-field-tp21067108p21082222.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the use-livecode mailing list