How to inherit the borderWidth property from the engine?

LiveCode Builder is a language for extending LiveCode's capabilities, creating new object types as Widgets, and libraries that access lower-level APIs in OSes, applications, and DLLs.

Moderators: LCMark, LCfraser

Post Reply
PaulDaMacMan
Posts: 616
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

How to inherit the borderWidth property from the engine?

Post by PaulDaMacMan » Fri Sep 25, 2020 3:08 pm

In a widget how do I inherit the borderWidth property from the engine for use with canvas strokes? In the dictionary the signature widget (indy) is the only widget that has that property, but that doesn't come with source code. I already know how to inherit/convert color properties like borderColor, I just need an example for getting the borderWidth.
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

PaulDaMacMan
Posts: 616
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: How to inherit the borderWidth property from the engine?

Post by PaulDaMacMan » Fri Sep 25, 2020 4:49 pm

@LCMark answered my question on Gitter, pasting here for future reference:
The borderWidth isn't an inherited property and so isn't one which is excluded from being used as a widget property. The signature widget just does:
private variable mBorderWidth as Number
property "borderWidth" get mBorderWidth set SetBorderWidth
metadata borderWidth.editor is "com.livecode.pi.number"
metadata borderWidth.label is "Border width"
metadata borderWidth.step is "1"
metadata borderWidth.default is "1"
metadata borderWidth.min is "0"
metadata borderWidth.max is "10"

Paul McClernan @PaulMcClernan 11:40
@runrevmark Thanks (yet again), I was just about to go back to my custom get/set handlers too, I had tried all sorts of things like:
put the stroke width of this canvas into mStrokeSize
put the width of my stroke into mStrokeSize

I'd be great if there was a chart somewhere of what properties are inherited, next to an example of using them with their LCB counterparts.
Something a little more useful than slide 6 of this:
https://livecode.com/topic/accessing-li ... roperties/
I might just make that chart myself when I get a chance.
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

Post Reply

Return to “LiveCode Builder”