Datagrid Line Color anomaly?

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10354
Joined: Wed May 06, 2009 2:28 pm

Datagrid Line Color anomaly?

Post by dunbarx » Thu May 08, 2014 2:43 pm

I was dealing with another thread, and noticed this when trying to set the color of a particular line in a datagrid.

Make a new datagrid and load several lines of data. In a button script:

Code: Select all

on mouseUp
   set the dgProp["hilite color"] of grp 1 to "red"
   if the optionKey is down then set the dgHilitedLines of grp 1 to "2,4"
    else set the dgHilitedLines of grp 1 to "3"   
end mouseUp
Click on the button a few times, with and without the optionKey, and all is well. But then if you click on a blank part of the card, the DG hilite changes to gray. This will persist back at the button until you do something directly to the DG, perhaps click on a line, or something external, like choose the edit tool, and then choose the browse tool again.

Can anyone else see this? Does anyone care? OS 10.6 on a PPC.

Craig Newman

Klaus
Posts: 14208
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Datagrid Line Color anomaly?

Post by Klaus » Thu May 08, 2014 2:50 pm

Hi Craig,

this is correct behavior!

It is the "unfocused" look of a datagrid and you maybe can also change that color,
not sure, need to check the datagrid docs again 8)

Found it:
########################################################################
dimmed hilite color
- Color that highlighted lines will be when control is not focused.
Prefix property name with "effective" to get the color being used when this property is set to empty.
#######################################################################
...
set the dgProps["dimmed hilite color"] of grp "xyz" to 1,200,240
...

Best

Klaus

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10354
Joined: Wed May 06, 2009 2:28 pm

Re: Datagrid Line Color anomaly?

Post by dunbarx » Thu May 08, 2014 5:16 pm

Klaus.

Thanks. I had forgotten about the focus of the DG. This can be permanently set, but has to be managed.

Craig

Post Reply