Datagrid, color a line without using backgroundcolor[SOLVED]

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
Nicke
Posts: 36
Joined: Thu Nov 28, 2013 11:19 am
Location: Helsinki, Finland

Datagrid, color a line without using backgroundcolor[SOLVED]

Post by Nicke » Tue May 20, 2014 10:06 am

Hi,

I posted about my issue in the beginners forum (http://forums.runrev.com/viewtopic.php?f=7&t=20320) but I didn't get an answer if it is possible in LC to do what I want.

Can I change the backgroundcolor of a line in a datagrid in the same way that "Alternate Row Colors" does? If I use backgroundcolor I can not see when I choose the row "hilite" because the hilite is not visible (probably because opaque is true).

I'm making an interface for a playout server and I want to show the line that is currrently playing to be marked with a darker red color so that the user can see it but still be able to scroll up/down in the datagrid (with the hilite on the chosen line).

Code: Select all

on mouseUp
   repeat with x = 1 to 4
      set the opaque of field ("Col" && x &&  "0002") of grp "DG1" to true
      set the backgroundColor of field ("Col" && x &&  "0002") of grp "DG1" to "green"
   end repeat
end mouseUp
BR Nicke
Last edited by Nicke on Fri May 23, 2014 7:51 am, edited 2 times in total.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9670
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Datagrid, color a line without using backgroundcolor

Post by dunbarx » Tue May 20, 2014 5:22 pm

Hi.

Does the topic on p. 165 of the DG user guide help?

Craig Newman

Nicke
Posts: 36
Joined: Thu Nov 28, 2013 11:19 am
Location: Helsinki, Finland

Re: Datagrid, color a line without using backgroundcolor

Post by Nicke » Wed May 21, 2014 4:09 pm

Craig,

not really since it only colors the text. I want to change the backgroundcolor and opacity so that it looks like "Alternate Row Colors" but with an other color.

Is it possible or should I forget about LC in cases like this and return to python/Qt?

BR Nicke

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Datagrid, color a line without using backgroundcolor

Post by Simon » Wed May 21, 2014 11:33 pm

Hi Nicke,
I've just had a thought :idea:
In the template row wouldn't you just add another graphic on top of the background?

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Nicke
Posts: 36
Joined: Thu Nov 28, 2013 11:19 am
Location: Helsinki, Finland

Re: Datagrid, color a line without using backgroundcolor

Post by Nicke » Thu May 22, 2014 8:32 pm

Hi Simon,

I have to look into that. Looked at a few tutorials about customizing the template row and it might be the right way to go. Datagrids are so hard to understand...

Thanks!

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: Datagrid, color a line without using backgroundcolor

Post by bangkok » Thu May 22, 2014 9:17 pm

Have a look at the enclosed stack.

It uses this lesson :
http://lessons.runrev.com/m/datagrid/l/ ... -to-a-cell

And changes the DGhilite.
Attachments
TESTDG.zip
(5.73 KiB) Downloaded 224 times

Nicke
Posts: 36
Joined: Thu Nov 28, 2013 11:19 am
Location: Helsinki, Finland

Re: Datagrid, color a line without using backgroundcolor

Post by Nicke » Fri May 23, 2014 7:49 am

Yes, that was the way to do it! Thanks bangkok!!!

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”