Line customisation

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
glenn9
Posts: 234
Joined: Wed Jan 15, 2020 10:45 pm

Line customisation

Post by glenn9 » Sat Nov 07, 2020 8:55 am

Hi everyone,

For a list field I'd like to customise the appearance of the lines within a field.

For the background colour I can simply set the 'backcolor' property for the lines by script, but I was wanting to set some kind of border property for the lines, eg colour, either by script or via the property inspector (not that I can see this option for lines in the inspector).

Just wanted to check if anyone had any information on how to do this?

Many thanks,

Kind regards,

Glenn

glenn9
Posts: 234
Joined: Wed Jan 15, 2020 10:45 pm

Re: Line customisation

Post by glenn9 » Sat Nov 07, 2020 10:24 am

... or is it possible to insert a LINEGRAPHIC by script after a LINE is added to the list field?

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

Re: Line customisation

Post by dunbarx » Sun Nov 08, 2020 4:40 am

Hi.

I think you will have to roll your own if you want anything more than:

Code: Select all

set the textStyle of line 3 of fld 1 to "box"
You will have to create a line or rectangular graphic and place it over the line(s) of interest. Easy enough, and then you have complete control over how those graphics look, line weight, color, blend level, whatever.

Craig

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10048
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Line customisation

Post by FourthWorld » Sun Nov 08, 2020 9:36 am

Version 5.5 introduced a number of paragraph-level properties, including borderWidth and borderColor:

https://livecode.fandom.com/search?query=Paragraph
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: Line customisation

Post by bn » Sun Nov 08, 2020 10:52 pm

have a look at the stack I posted recently that demonstrates the formatting addition introduced in LC 5.5 Richard mentioned.
It was done by Livecode's Benjamin Beaumont at the time.

I think it is a nice demo that unfortunately was never really given the publicity it deserves.

http://forums.livecode.com/viewtopic.ph ... 44#p197942

Kind regards
Bernd

glenn9
Posts: 234
Joined: Wed Jan 15, 2020 10:45 pm

Re: Line customisation

Post by glenn9 » Mon Nov 09, 2020 11:20 am

Craig, Richard, Bernd,

Many thanks for all these tips, these were really helpful and I've now solved the headache I was having!

(Bernd, I thought the stack that you shared was a real goldmine of useful utilities - thanks for this.)

Kind regards, Glenn

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

Re: Line customisation

Post by dunbarx » Mon Nov 09, 2020 2:52 pm

Hi.

Glad you seem to have a solution. but I thought you wanted something like this:
linetest.livecode.zip
(859 Bytes) Downloaded 222 times
Craig

glenn9
Posts: 234
Joined: Wed Jan 15, 2020 10:45 pm

Re: Line customisation

Post by glenn9 » Tue Nov 10, 2020 11:02 am

dunbarx wrote:
Mon Nov 09, 2020 2:52 pm
Hi.

Glad you seem to have a solution. but I thought you wanted something like this:

linetest.livecode.zip

Craig
Hi Craig,

It started off as exactly as you described, but then on learning of the additional capabilities, and with the extra understanding, I've expanded the scope a little!

but thank you for your help and suggestions,

Regards,

Glenn

Post Reply