Table field

classic Classic list List threaded Threaded
23 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Table field

Peter Haworth
Bill Vlahos' lcTaskList and the Bernd's table stack have inspired me to
play around with tables more than I have in the past.

I've implemented coloring of alternate rows but I noticed that the
highlighting of the alternate rows starts a few pixels in from the left
side of the line and stops a few pixels short of the vertical scrollbar at
the right side of the line.  Any suggestions as to how to make the
highlight extend across the full width of a line?

Thanks,

Pete
lcSQL Software <http://www.lcsql.com>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Table field

BNig
Hi Peter,

here is my take on the alternating Lines. It uses a graphic with a fillgradient that is behind the non-opaque table field.
I made a demo stack:

berndniggemann.on-rev.com/alternatingLines/alternatingLines.livecode.zip

Kind regards

Bernd
Reply | Threaded
Open this post in threaded view
|

Re: Table field

slylabs13
Another approach would be to have a group of rectangles, and a script that would resize it and rearrange it so that the rows of rectangles always aligned with the rows. That way you could resize both the table field and the font, size and row height and the color grid would adapt.

But what would be even better is if someone could make a grid object, called, oh I don't know, a gridwithdata, or wait! A DATA GRID! erm... never mind! ;-)

Bob


On Jun 21, 2012, at 2:01 PM, BNig wrote:

> Hi Peter,
>
> here is my take on the alternating Lines. It uses a graphic with a
> fillgradient that is behind the non-opaque table field.
> I made a demo stack:
>
> berndniggemann.on-rev.com/alternatingLines/alternatingLines.livecode.zip
>
> Kind regards
>
> Bernd
>
>
> --
> View this message in context: http://runtime-revolution.278305.n4.nabble.com/Table-field-tp4651080p4651090.html
> Sent from the Revolution - User mailing list archive at Nabble.com.
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Table field

Peter Haworth
In reply to this post by BNig
Thanks Bernd, that looks very nice.
Pete
lcSQL Software <http://www.lcsql.com>



On Thu, Jun 21, 2012 at 2:01 PM, BNig <[hidden email]> wrote:

> Hi Peter,
>
> here is my take on the alternating Lines. It uses a graphic with a
> fillgradient that is behind the non-opaque table field.
> I made a demo stack:
>
> berndniggemann.on-rev.com/alternatingLines/alternatingLines.livecode.zip
>
> Kind regards
>
> Bernd
>
>
> --
> View this message in context:
> http://runtime-revolution.278305.n4.nabble.com/Table-field-tp4651080p4651090.html
> Sent from the Revolution - User mailing list archive at Nabble.com.
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Table field

Björnke von Gierke
To cook yourself the perfect scrolling field, you need:

A graphic:
32 pixels high
at least 1 pixel wide (or more for easier handling, width doesn't matter)
upper 16 pixels white
lower half very light blue or very light grey

Also a list type field (dontwrap= true) with:
textHeight = 16
fixedLineHeight = True
margins (on the "text formatting" part of the inspector): 8,4,8,8
set the backgroundPatter of this field to the image.


Result:
Perfect scrolling list of entries, where the background colors scroll along with the text.


Tip: a textHeight of 16 with the default 11 textSize looks a bit cramped, you can adjust the hight of the lines and the hight of the graphic for other linesizes.



On 21.06.2012, at 23:29, Peter Haworth wrote:

> Thanks Bernd, that looks very nice.
> Pete
> lcSQL Software <http://www.lcsql.com>
>
>
>
> On Thu, Jun 21, 2012 at 2:01 PM, BNig <[hidden email]> wrote:
>
>> Hi Peter,
>>
>> here is my take on the alternating Lines. It uses a graphic with a
>> fillgradient that is behind the non-opaque table field.
>> I made a demo stack:
>>
>> berndniggemann.on-rev.com/alternatingLines/alternatingLines.livecode.zip
>>
>> Kind regards
>>
>> Bernd
>>
>>
>> --
>> View this message in context:
>> http://runtime-revolution.278305.n4.nabble.com/Table-field-tp4651080p4651090.html
>> Sent from the Revolution - User mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


--

Use an alternative Dictionary viewer:
http://bjoernke.com/bvgdocu/

Chat with other RunRev developers:
http://bjoernke.com/chatrev/





_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Table field

Peter Haworth
Thank you Bjornke, that's another great solution.  I guess my attempt to do
this with a repeat loop to set the background of each line to either empty
or a color was way too simplistic.

I have to say that, now I'm learning more about what can be done with
tables, I'm less and less inclined to use datagrids.

Thanks to all the recent input, I now have a table with alternating colored
rows, resizable columns, drag and drop reordering of lines, and I've added
a field at the top of my tables to hold headings and allow the columns to
be sorted by clicking on them.

Datagrid tables still have their place if you need to have an option
menu/checkbox/radio button in a column and the LC tables can't emulate a
datagrid form but for simple, straightforward display of data, the tables
seem easier to use.

Pete
lcSQL Software <http://www.lcsql.com>



On Sat, Jun 23, 2012 at 6:28 AM, Björnke von Gierke <[hidden email]> wrote:

> To cook yourself the perfect scrolling field, you need:
>
> A graphic:
> 32 pixels high
> at least 1 pixel wide (or more for easier handling, width doesn't matter)
> upper 16 pixels white
> lower half very light blue or very light grey
>
> Also a list type field (dontwrap= true) with:
> textHeight = 16
> fixedLineHeight = True
> margins (on the "text formatting" part of the inspector): 8,4,8,8
> set the backgroundPatter of this field to the image.
>
>
> Result:
> Perfect scrolling list of entries, where the background colors scroll
> along with the text.
>
>
> Tip: a textHeight of 16 with the default 11 textSize looks a bit cramped,
> you can adjust the hight of the lines and the hight of the graphic for
> other linesizes.
>
>
>
> On 21.06.2012, at 23:29, Peter Haworth wrote:
>
> > Thanks Bernd, that looks very nice.
> > Pete
> > lcSQL Software <http://www.lcsql.com>
> >
> >
> >
> > On Thu, Jun 21, 2012 at 2:01 PM, BNig <[hidden email]> wrote:
> >
> >> Hi Peter,
> >>
> >> here is my take on the alternating Lines. It uses a graphic with a
> >> fillgradient that is behind the non-opaque table field.
> >> I made a demo stack:
> >>
> >>
> berndniggemann.on-rev.com/alternatingLines/alternatingLines.livecode.zip
> >>
> >> Kind regards
> >>
> >> Bernd
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://runtime-revolution.278305.n4.nabble.com/Table-field-tp4651080p4651090.html
> >> Sent from the Revolution - User mailing list archive at Nabble.com.
> >>
> >> _______________________________________________
> >> use-livecode mailing list
> >> [hidden email]
> >> Please visit this url to subscribe, unsubscribe and manage your
> >> subscription preferences:
> >> http://lists.runrev.com/mailman/listinfo/use-livecode
> >>
> > _______________________________________________
> > use-livecode mailing list
> > [hidden email]
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> --
>
> Use an alternative Dictionary viewer:
> http://bjoernke.com/bvgdocu/
>
> Chat with other RunRev developers:
> http://bjoernke.com/chatrev/
>
>
>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Table field

Peter Haworth
In reply to this post by Björnke von Gierke
Bjornke,
My grpahic skills being pretty much nonexistent, how do you do this?  I
made a graphic rectangle on my card and I'm assuming that the different
colors are achieved by using a gradient but try as I might, I cannot make
it work.  Any instructions greatly appreciated!
Thanks,
Pete
lcSQL Software <http://www.lcsql.com>



On Sat, Jun 23, 2012 at 6:28 AM, Björnke von Gierke <[hidden email]> wrote:

> A graphic:
> 32 pixels high
> at least 1 pixel wide (or more for easier handling, width doesn't matter)
> upper 16 pixels white
> lower half very light blue or very light grey
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Table field

Jacques Hausser
Hi Peter,

I followed this thread with interest (I am still intimidate by Datagrid's complexities) and for the graphic, I simply did it with another application (Pixelmator). Works great ! Thanks to Björnke !

Jacques


Le 24 juin 2012 à 03:43, Peter Haworth a écrit :

> Bjornke,
> My grpahic skills being pretty much nonexistent, how do you do this?  I
> made a graphic rectangle on my card and I'm assuming that the different
> colors are achieved by using a gradient but try as I might, I cannot make
> it work.  Any instructions greatly appreciated!
> Thanks,
> Pete
> lcSQL Software <http://www.lcsql.com>
>
>
>
> On Sat, Jun 23, 2012 at 6:28 AM, Björnke von Gierke <[hidden email]> wrote:
>
>> A graphic:
>> 32 pixels high
>> at least 1 pixel wide (or more for easier handling, width doesn't matter)
>> upper 16 pixels white
>> lower half very light blue or very light grey
>>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

******************************************
Prof. Jacques Hausser
Department of Ecology and Evolution
Biophore / Sorge
University of Lausanne
CH 1015 Lausanne
please use my private address:
6 route de Burtigny
CH-1269 Bassins
tel: ++ 41 22 366 19 40
mobile: ++ 41 79 757 05 24
E-Mail: [hidden email]
*******************************************


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Table field

Peter Haworth
Hi Jacques,
Thanks for the tip!
Pete
lcSQL Software <http://www.lcsql.com>



On Sun, Jun 24, 2012 at 11:40 AM, Jacques Hausser
<[hidden email]>wrote:

> Hi Peter,
>
> I followed this thread with interest (I am still intimidate by Datagrid's
> complexities) and for the graphic, I simply did it with another application
> (Pixelmator). Works great ! Thanks to Björnke !
>
> Jacques
>
>
> Le 24 juin 2012 à 03:43, Peter Haworth a écrit :
>
> > Bjornke,
> > My grpahic skills being pretty much nonexistent, how do you do this?  I
> > made a graphic rectangle on my card and I'm assuming that the different
> > colors are achieved by using a gradient but try as I might, I cannot make
> > it work.  Any instructions greatly appreciated!
> > Thanks,
> > Pete
> > lcSQL Software <http://www.lcsql.com>
> >
> >
> >
> > On Sat, Jun 23, 2012 at 6:28 AM, Björnke von Gierke <[hidden email]> wrote:
> >
> >> A graphic:
> >> 32 pixels high
> >> at least 1 pixel wide (or more for easier handling, width doesn't
> matter)
> >> upper 16 pixels white
> >> lower half very light blue or very light grey
> >>
> > _______________________________________________
> > use-livecode mailing list
> > [hidden email]
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
> ******************************************
> Prof. Jacques Hausser
> Department of Ecology and Evolution
> Biophore / Sorge
> University of Lausanne
> CH 1015 Lausanne
> please use my private address:
> 6 route de Burtigny
> CH-1269 Bassins
> tel:    ++ 41 22 366 19 40
> mobile: ++ 41 79 757 05 24
> E-Mail: [hidden email]
> *******************************************
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Table field

Björnke von Gierke
Hey, did Jacques tip help you achieve what you want?

If not, here's an image that can be used as a line thingy:
http://i.imgur.com/AXVve.png

On 24.06.2012, at 15:55, Peter Haworth wrote:

> Hi Jacques,
> Thanks for the tip!
> Pete
> lcSQL Software <http://www.lcsql.com>
>
>
>
> On Sun, Jun 24, 2012 at 11:40 AM, Jacques Hausser
> <[hidden email]>wrote:
>
>> Hi Peter,
>>
>> I followed this thread with interest (I am still intimidate by Datagrid's
>> complexities) and for the graphic, I simply did it with another application
>> (Pixelmator). Works great ! Thanks to Björnke !
>>
>> Jacques
>>
>>
>> Le 24 juin 2012 à 03:43, Peter Haworth a écrit :
>>
>>> Bjornke,
>>> My grpahic skills being pretty much nonexistent, how do you do this?  I
>>> made a graphic rectangle on my card and I'm assuming that the different
>>> colors are achieved by using a gradient but try as I might, I cannot make
>>> it work.  Any instructions greatly appreciated!
>>> Thanks,
>>> Pete
>>> lcSQL Software <http://www.lcsql.com>
>>>
>>>
>>>
>>> On Sat, Jun 23, 2012 at 6:28 AM, Björnke von Gierke <[hidden email]> wrote:
>>>
>>>> A graphic:
>>>> 32 pixels high
>>>> at least 1 pixel wide (or more for easier handling, width doesn't
>> matter)
>>>> upper 16 pixels white
>>>> lower half very light blue or very light grey
>>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> [hidden email]
>>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>> ******************************************
>> Prof. Jacques Hausser
>> Department of Ecology and Evolution
>> Biophore / Sorge
>> University of Lausanne
>> CH 1015 Lausanne
>> please use my private address:
>> 6 route de Burtigny
>> CH-1269 Bassins
>> tel:    ++ 41 22 366 19 40
>> mobile: ++ 41 79 757 05 24
>> E-Mail: [hidden email]
>> *******************************************
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


--

Use an alternative Dictionary viewer:
http://bjoernke.com/bvgdocu/

Chat with other RunRev developers:
http://bjoernke.com/chatrev/





_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Table field

Peter Haworth
Thanks Bjornke.  Jacques' idea wouyld work but I'd prefere a Livecode
approach so I can alter it to deal with, e.g., different line heights and
colors.  I'm glad this came up because it's an opportunity for me to learn
yet another area of Livecode - gradients - for which there is precious
little published information.
Pete
lcSQL Software <http://www.lcsql.com>



On Mon, Jun 25, 2012 at 3:41 AM, Björnke von Gierke <[hidden email]> wrote:

> Hey, did Jacques tip help you achieve what you want?
>
> If not, here's an image that can be used as a line thingy:
> http://i.imgur.com/AXVve.png
>
> On 24.06.2012, at 15:55, Peter Haworth wrote:
>
> > Hi Jacques,
> > Thanks for the tip!
> > Pete
> > lcSQL Software <http://www.lcsql.com>
> >
> >
> >
> > On Sun, Jun 24, 2012 at 11:40 AM, Jacques Hausser
> > <[hidden email]>wrote:
> >
> >> Hi Peter,
> >>
> >> I followed this thread with interest (I am still intimidate by
> Datagrid's
> >> complexities) and for the graphic, I simply did it with another
> application
> >> (Pixelmator). Works great ! Thanks to Björnke !
> >>
> >> Jacques
> >>
> >>
> >> Le 24 juin 2012 à 03:43, Peter Haworth a écrit :
> >>
> >>> Bjornke,
> >>> My grpahic skills being pretty much nonexistent, how do you do this?  I
> >>> made a graphic rectangle on my card and I'm assuming that the different
> >>> colors are achieved by using a gradient but try as I might, I cannot
> make
> >>> it work.  Any instructions greatly appreciated!
> >>> Thanks,
> >>> Pete
> >>> lcSQL Software <http://www.lcsql.com>
> >>>
> >>>
> >>>
> >>> On Sat, Jun 23, 2012 at 6:28 AM, Björnke von Gierke <[hidden email]>
> wrote:
> >>>
> >>>> A graphic:
> >>>> 32 pixels high
> >>>> at least 1 pixel wide (or more for easier handling, width doesn't
> >> matter)
> >>>> upper 16 pixels white
> >>>> lower half very light blue or very light grey
> >>>>
> >>> _______________________________________________
> >>> use-livecode mailing list
> >>> [hidden email]
> >>> Please visit this url to subscribe, unsubscribe and manage your
> >> subscription preferences:
> >>> http://lists.runrev.com/mailman/listinfo/use-livecode
> >>
> >> ******************************************
> >> Prof. Jacques Hausser
> >> Department of Ecology and Evolution
> >> Biophore / Sorge
> >> University of Lausanne
> >> CH 1015 Lausanne
> >> please use my private address:
> >> 6 route de Burtigny
> >> CH-1269 Bassins
> >> tel:    ++ 41 22 366 19 40
> >> mobile: ++ 41 79 757 05 24
> >> E-Mail: [hidden email]
> >> *******************************************
> >>
> >>
> >> _______________________________________________
> >> use-livecode mailing list
> >> [hidden email]
> >> Please visit this url to subscribe, unsubscribe and manage your
> >> subscription preferences:
> >> http://lists.runrev.com/mailman/listinfo/use-livecode
> >>
> > _______________________________________________
> > use-livecode mailing list
> > [hidden email]
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> --
>
> Use an alternative Dictionary viewer:
> http://bjoernke.com/bvgdocu/
>
> Chat with other RunRev developers:
> http://bjoernke.com/chatrev/
>
>
>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Gradients (was "Re: Table field")

ScottR
Hi Peter:

Execute the following in your LiveCode message box:

go url
"http://www.tactilemedia.com/site_files/downloads/gradient_explorer.rev"

Regards,

Scott Rossi
Creative Director
Tactile Media, UX Design



Recently, Peter Haworth wrote:

> I'm glad this came up because it's an opportunity for me to learn
> yet another area of Livecode - gradients - for which there is precious
> little published information.



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Gradients (was "Re: Table field")

slylabs13
Scott, that is just a magnificent tool. You never cease to amaze me!

Bob


On Jun 25, 2012, at 10:31 AM, Scott Rossi wrote:

> Hi Peter:
>
> Execute the following in your LiveCode message box:
>
> go url
> "http://www.tactilemedia.com/site_files/downloads/gradient_explorer.rev"
>
> Regards,
>
> Scott Rossi
> Creative Director
> Tactile Media, UX Design
>
>
>
> Recently, Peter Haworth wrote:
>
>> I'm glad this came up because it's an opportunity for me to learn
>> yet another area of Livecode - gradients - for which there is precious
>> little published information.
>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Gradients (was "Re: Table field")

Peter Haworth
In reply to this post by ScottR
Thanks Scott.  As usual, a very useful learning tool.

Here's what I can't figure out though.  Your stack fades in the colors from
top to bottom. How can I get the graphic to contain two separate colors,
one that fills the top half of the graphic and another that fills in the
bottom half, with no fading just a clean horizontal break between them.

Maybe gradients are not the way to do this, although Bern'ds table stack
uses them for the graphic involved in coloring alternate lines - I just
can't figure out all the values for the different gradient array keys.

Pete
lcSQL Software <http://www.lcsql.com>



On Mon, Jun 25, 2012 at 10:31 AM, Scott Rossi <[hidden email]>wrote:

> Hi Peter:
>
> Execute the following in your LiveCode message box:
>
> go url
> "http://www.tactilemedia.com/site_files/downloads/gradient_explorer.rev"
>
> Regards,
>
> Scott Rossi
> Creative Director
> Tactile Media, UX Design
>
>
>
> Recently, Peter Haworth wrote:
>
> > I'm glad this came up because it's an opportunity for me to learn
> > yet another area of Livecode - gradients - for which there is precious
> > little published information.
>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Gradients (was "Re: Table field")

Jan Schenkel
Hi Peter,

You can do it all from code if you like. Create a new stack, drop a button onto it, and set its script to:

##
on mouseUp
   CreateTwoColorGraphic "Peter", "10,50,110,85", "255,0,0", "0,0,255"
   answer"Created:"&& theresult
end mouseUp

private command CreateTwoColorGraphic pName, pRectangle, pTopColor, pBottomColor
   --> prepare the fillGradient array
   local tFillGradientA
   put "linear" into tFillGradientA["type"]
   put (item 1 of pRectangle),(item 2 of pRectangle) into tFillGradientA["from"]
   put (item 1 of pRectangle),(item 4 of pRectangle) into tFillGradientA["to"]
   put (item 3 of pRectangle),(item 2 of pRectangle) into tFillGradientA["via"]
   put   0.00000,pTopColor & return & \
         0.49999,pTopColor & return & \
         0.50000,pBottomColor & return & \
         1.00000,pBottomColor \
         into tFillGradientA["ramp"]
   --> now create the graphic
   local tGraphicLongId
   resetthetemplateGraphic
   settherectangleofthetemplateGraphictopRectangle
   settheopaqueofthetemplateGraphictotrue
   setthefillGradientofthetemplateGraphictotFillGradientA
   create graphic pName
   put it into tGraphicLongId
   --> and cleanup before returning the long id of the graphic
   resetthetemplateGraphic
   return tGraphicLongId
end CreateTwoColorGraphic
##

Then click the button, and you'll get a graphic named "Peter" in the specified rectangle, with the two colors each taking up half of the height of the graphic, even when you resize it.

HTH,

Jan Schenkel.
 
=====
Quartam Reports & PDF Library for LiveCode
www.quartam.com


=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)


----- Original Message -----
From: Peter Haworth <[hidden email]>
To: How to use LiveCode <[hidden email]>
Cc:
Sent: Tuesday, June 26, 2012 10:08 PM
Subject: Re: Gradients (was "Re: Table field")

Thanks Scott.  As usual, a very useful learning tool.

Here's what I can't figure out though.  Your stack fades in the colors from
top to bottom. How can I get the graphic to contain two separate colors,
one that fills the top half of the graphic and another that fills in the
bottom half, with no fading just a clean horizontal break between them.

Maybe gradients are not the way to do this, although Bern'ds table stack
uses them for the graphic involved in coloring alternate lines - I just
can't figure out all the values for the different gradient array keys.

Pete
lcSQL Software <http://www.lcsql.com>


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Gradients (was "Re: Table field")

Jan Schenkel
Sorry, it seems YahooMail mangled the spaces: here's the script again...

##
on mouseUp
   CreateTwoColorGraphic "Peter", "10,50,110,85", "255,0,0", "0,0,255"
   answer"Created:"&& the result
end mouseUp

private command CreateTwoColorGraphic pName, pRectangle, pTopColor, pBottomColor
   --> prepare the fillGradient array
   local tFillGradientA
   put "linear" into tFillGradientA["type"]
   put (item 1 of pRectangle),(item 2 of pRectangle) into tFillGradientA["from"]
   put (item 1 of pRectangle),(item 4 of pRectangle) into tFillGradientA["to"]
   put (item 3 of pRectangle),(item 2 of pRectangle) into tFillGradientA["via"]
   put   0.00000,pTopColor & return & \
         0.49999,pTopColor & return & \
         0.50000,pBottomColor & return & \
         1.00000,pBottomColor \
         into tFillGradientA["ramp"]
   --> now create the graphic
   local tGraphicLongId
   reset the templateGraphic
   set the rectangle of the templateGraphic to pRectangle
   set the opaque of the templateGraphic to true
   set the fillGradient of the templateGraphic to tFillGradientA
   create graphic pName
   put it into tGraphicLongId
   --> and cleanup before returning the long id of the graphic
   reset the templateGraphic
   return tGraphicLongId
end CreateTwoColorGraphic
##

Jan.
 
=====
Quartam Reports & PDF Library for LiveCode
www.quartam.com


=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)


----- Original Message -----
From: Jan Schenkel <[hidden email]>
To: How to use LiveCode <[hidden email]>
Cc:
Sent: Tuesday, June 26, 2012 10:57 PM
Subject: Re: Gradients (was "Re: Table field")

Hi Peter,

You can do it all from code if you like. Create a new stack, drop a button onto it, and set its script to:

##
...
##

Then click the button, and you'll get a graphic named "Peter" in the specified rectangle, with the two colors each taking up half of the height of the graphic, even when you resize it.

HTH,

Jan Schenkel.
 
=====
Quartam Reports & PDF Library for LiveCode
www.quartam.com


=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)


----- Original Message -----
From: Peter Haworth <[hidden email]>
To: How to use LiveCode <[hidden email]>
Cc:
Sent: Tuesday, June 26, 2012 10:08 PM
Subject: Re: Gradients (was "Re: Table field")

Thanks Scott.  As usual, a very useful learning tool.

Here's what I can't figure out though.  Your stack fades in the colors from
top to bottom. How can I get the graphic to contain two separate colors,
one that fills the top half of the graphic and another that fills in the
bottom half, with no fading just a clean horizontal break between them.

Maybe gradients are not the way to do this, although Bern'ds table stack
uses them for the graphic involved in coloring alternate lines - I just
can't figure out all the values for the different gradient array keys.

Pete
lcSQL Software <http://www.lcsql.com>


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Gradients (was "Re: Table field")

ScottR
In reply to this post by Peter Haworth
Hi Pete:

Use duplicate gradient stops in the ramp:

0.00000,255,0,0 -- red 0%
0.50000,255,0,0 -- red 50%
0.50000,0,255,0 -- green 50%, same position as above
1.00000,0,255,0 -- green 100%

Regards,

Scott Rossi
Creative Director
Tactile Media, UX Design



Recently, Peter Haworth wrote:

> Thanks Scott.  As usual, a very useful learning tool.
>
> Here's what I can't figure out though.  Your stack fades in the colors from
> top to bottom. How can I get the graphic to contain two separate colors,
> one that fills the top half of the graphic and another that fills in the
> bottom half, with no fading just a clean horizontal break between them.
>
> Maybe gradients are not the way to do this, although Bern'ds table stack
> uses them for the graphic involved in coloring alternate lines - I just
> can't figure out all the values for the different gradient array keys.
>
> Pete
> lcSQL Software <http://www.lcsql.com>
>
>
>
> On Mon, Jun 25, 2012 at 10:31 AM, Scott Rossi <[hidden email]>wrote:
>
>> Hi Peter:
>>
>> Execute the following in your LiveCode message box:
>>
>> go url
>> "http://www.tactilemedia.com/site_files/downloads/gradient_explorer.rev"
>>
>> Regards,
>>
>> Scott Rossi
>> Creative Director
>> Tactile Media, UX Design
>>
>>
>>
>> Recently, Peter Haworth wrote:
>>
>>> I'm glad this came up because it's an opportunity for me to learn
>>> yet another area of Livecode - gradients - for which there is precious
>>> little published information.
>>
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>





_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Gradients (was "Re: Table field")

BNig
In reply to this post by Peter Haworth
Pete,

the ramp of the gradient has 4 positons. 1 at 0, 2 at .50001 and 1 at 1.0000
the ramp is what you work on in the inspector.

the first two define the first color and the other two the second color. By setting the color of the pair of the positions to the same color and making the middle position the same you get the homogenous colors and the sharp dividing line.

in Ken's wonderful stack you could fill these values in

Type: linear
To: 377,400
Quality: good
Ramp: 0.00000,255,255,255
        0.50001,255,255,255
        0.50001,241,245,250
        1.00000,241,245,250
From: 374,191
Via: 469,191
Mirror: false
Repeat: 1
Wrap: true

That is the fillgradient from the graphic alternatingLines. The To, Via, and From values are for Ken's stack.

It is helpful to make a little script that gets the fillgradient (or strokegradient) of a graphic:

----------------
put the fillgradient of grc "myGraphic" into tData
combine tData by return and tab
put tData into field "myField"
---------------------

Kind regards
Bernd
Reply | Threaded
Open this post in threaded view
|

Re: Gradients (was "Re: Table field")

Peter Haworth
In reply to this post by Jan Schenkel
Great, Thanks Jan.  I see it's ramp that determines how the colors are
displayed.  Finally beginning to uderstand this!

What I'm aiming for is to allow the user to select the background color of
the alternate lines in the table and I think I can do that by getting the
gradient array and changing the color in the ramp.  Also sounds like thew
graphic can be adjusted to the height of the lines
Pete
lcSQL Software <http://www.lcsql.com>



On Tue, Jun 26, 2012 at 1:57 PM, Jan Schenkel <[hidden email]> wrote:

> Hi Peter,
>
> You can do it all from code if you like. Create a new stack, drop a button
> onto it, and set its script to:
>
> ##
> on mouseUp
>    CreateTwoColorGraphic "Peter", "10,50,110,85", "255,0,0", "0,0,255"
>    answer"Created:"&& theresult
> end mouseUp
>
> private command CreateTwoColorGraphic pName, pRectangle, pTopColor,
> pBottomColor
>    --> prepare the fillGradient array
>    local tFillGradientA
>    put "linear" into tFillGradientA["type"]
>    put (item 1 of pRectangle),(item 2 of pRectangle) into
> tFillGradientA["from"]
>    put (item 1 of pRectangle),(item 4 of pRectangle) into
> tFillGradientA["to"]
>    put (item 3 of pRectangle),(item 2 of pRectangle) into
> tFillGradientA["via"]
>    put   0.00000,pTopColor & return & \
>          0.49999,pTopColor & return & \
>          0.50000,pBottomColor & return & \
>          1.00000,pBottomColor \
>          into tFillGradientA["ramp"]
>    --> now create the graphic
>    local tGraphicLongId
>    resetthetemplateGraphic
>    settherectangleofthetemplateGraphictopRectangle
>    settheopaqueofthetemplateGraphictotrue
>    setthefillGradientofthetemplateGraphictotFillGradientA
>    create graphic pName
>    put it into tGraphicLongId
>    --> and cleanup before returning the long id of the graphic
>    resetthetemplateGraphic
>    return tGraphicLongId
> end CreateTwoColorGraphic
> ##
>
> Then click the button, and you'll get a graphic named "Peter" in the
> specified rectangle, with the two colors each taking up half of the height
> of the graphic, even when you resize it.
>
> HTH,
>
> Jan Schenkel.
>
> =====
> Quartam Reports & PDF Library for LiveCode
> www.quartam.com
>
>
> =====
> "As we grow older, we grow both wiser and more foolish at the same time."
>  (La Rochefoucauld)
>
>
> ----- Original Message -----
> From: Peter Haworth <[hidden email]>
> To: How to use LiveCode <[hidden email]>
> Cc:
> Sent: Tuesday, June 26, 2012 10:08 PM
> Subject: Re: Gradients (was "Re: Table field")
>
> Thanks Scott.  As usual, a very useful learning tool.
>
> Here's what I can't figure out though.  Your stack fades in the colors from
> top to bottom. How can I get the graphic to contain two separate colors,
> one that fills the top half of the graphic and another that fills in the
> bottom half, with no fading just a clean horizontal break between them.
>
> Maybe gradients are not the way to do this, although Bern'ds table stack
> uses them for the graphic involved in coloring alternate lines - I just
> can't figure out all the values for the different gradient array keys.
>
> Pete
> lcSQL Software <http://www.lcsql.com>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Gradients (was "Re: Table field")

Peter Haworth
In reply to this post by BNig
Thanks Bernd.  I think I'm finally beginning to understand at least some of
the gradient parameters. I still can't figure out how to do this in the
Inspector though but that's OK, the scripts from everyone work great.
Pete
lcSQL Software <http://www.lcsql.com>



On Tue, Jun 26, 2012 at 2:07 PM, BNig <[hidden email]> wrote:

> Pete,
>
> the ramp of the gradient has 4 positons. 1 at 0, 2 at .50001 and 1 at
> 1.0000
> the ramp is what you work on in the inspector.
>
> the first two define the first color and the other two the second color. By
> setting the color of the pair of the positions to the same color and making
> the middle position the same you get the homogenous colors and the sharp
> dividing line.
>
> in Ken's wonderful stack you could fill these values in
>
> Type:   linear
> To:     377,400
> Quality:        good
> Ramp:   0.00000,255,255,255
>        0.50001,255,255,255
>        0.50001,241,245,250
>        1.00000,241,245,250
> From:   374,191
> Via:    469,191
> Mirror: false
> Repeat: 1
> Wrap:   true
>
> That is the fillgradient from the graphic alternatingLines. The To, Via,
> and
> From values are for Ken's stack.
>
> It is helpful to make a little script that gets the fillgradient (or
> strokegradient) of a graphic:
>
> ----------------
> put the fillgradient of grc "myGraphic" into tData
> combine tData by return and tab
> put tData into field "myField"
> ---------------------
>
> Kind regards
> Bernd
>
> --
> View this message in context:
> http://runtime-revolution.278305.n4.nabble.com/Table-field-tp4651080p4651323.html
> Sent from the Revolution - User mailing list archive at Nabble.com.
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
12