datagrid form background color by code

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
rinzwind
Posts: 135
Joined: Tue May 01, 2012 10:44 am

datagrid form background color by code

Post by rinzwind » Fri Sep 25, 2015 12:47 pm

How can I change the background color of a row depending on the data in form mode?
I see a graphic "Background". And in FillInData I can set the background, but seems it's overruled somewhere higher...
I can add an extra graphic "Background2", but then hi-lighting of the selected row stops working.

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

Re: datagrid form background color by code

Post by Klaus » Fri Sep 25, 2015 1:59 pm

Hi rinzwind,

I'm afraid you have to choose: custom background color or alternating row colors! 8)


Best

Klaus

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

Re: datagrid form background color by code

Post by dunbarx » Fri Sep 25, 2015 2:42 pm

Hi.

I was involved with a thread long ago where I suggested how useful it would be to have a "passThrough" property. One could overlay a control, like a transparent colored graphic, on top of another control, like a field, but any user action, like a mouseClick, would not be sent to that control, but would be sent to any underlying control.

This is different than simply passing "mouseUp", which works fine if there is nothing under the control; the message would pass naturally to the card. But if there is a control underneath, you currently have to kluge it.

I doubt I could find that thread. But I remember that the kluge was simply to pick up the clickLoc, and find a control whose rect contains it. With a dataGrid, you would loop through all the "fields". I believe in a DG those fields are the first ones in layer order, but in any case they are all named:

"Col 1 0001", "Col 1 002".."Col 2 001", "Col 2 002".etc.

You can then, in the graphic, send any message, or in your case "click at the loc of", the underlying control. Not too bad, really.

Craig Newman

rinzwind
Posts: 135
Joined: Tue May 01, 2012 10:44 am

Re: datagrid form background color by code

Post by rinzwind » Fri Sep 25, 2015 7:08 pm

Well, I just forget about the form datagrid and make one myself with a scrolling group since I don't need the datagrid features and I have full control that way. Works better to on mobile I think.

Post Reply