com.livecode.pi
com.livecode.pi
Hi,
where may I find information about "com.livecode.pi" ?
The dictionary hasn't that entry and I don't know how to deal with it.
where may I find information about "com.livecode.pi" ?
The dictionary hasn't that entry and I don't know how to deal with it.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
Re: com.livecode.pi
"com.livecode.pi" refers to the IDE Property Inspector. We use the same naming scheme for several components, not limited to things written in LiveCode Builder.
LiveCode Open Source Team — @PeterTBBrett — peter.brett@livecode.com
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: com.livecode.pi
https://github.com/livecode/livecode-id ... tyInfo.txt
There are, connected to that, also examples of usage
= in several LC 8 release notes
= in example widgets (search for metadata *.editor is "com.livecode.pi.")
And there is somewhere (in this subforum?) a post by LC-Ali about using an PI editor.
There are, connected to that, also examples of usage
= in several LC 8 release notes
= in example widgets (search for metadata *.editor is "com.livecode.pi.")
And there is somewhere (in this subforum?) a post by LC-Ali about using an PI editor.
shiftLock happens
Re: com.livecode.pi
The total lack of documentation for widgets leave me groping in the dark.
So if I create a create a widget, that has a property called coolProp, I should use this code:
Why do I have to repeat get and set after declaring it? What other options do I have?
If I want to permit to use the property inspector to set the coolProp, I have to use com.livecode.pi. Am I right?
If I want to leave the user to choose from a list, I use this code:
So option name can't have a comma in their names, because options are comma separated. Is it right?
If I want to use a simple field to set properties, what code should I use?
If I want to use a check box to set properties, what code should I use?
If I want to use a scroller to set properties, what code should I use?
What other options do I have?
So if I create a create a widget, that has a property called coolProp, I should use this code:
Code: Select all
property coolProp get coolProp set coolProp
If I want to permit to use the property inspector to set the coolProp, I have to use com.livecode.pi. Am I right?
If I want to leave the user to choose from a list, I use this code:
Code: Select all
metadata coolProp.editor is "com.livecode.pi.enum"
metadata coolProp.options is "first option, second option, third option,.."
If I want to use a simple field to set properties, what code should I use?
If I want to use a check box to set properties, what code should I use?
If I want to use a scroller to set properties, what code should I use?
What other options do I have?
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: com.livecode.pi
Here some short answers.
Generally:
Usual multiline text field:
Else read the release notes, read built-in examples or the community examples or, once again, use propertyInfo.txt.
Generally:
Code: Select all
property coolProp get <getter> set <setter>
- If you don't use set <setter> then the property is read only.
- The simplest form of "getter" or "setter" are variable names.
- A typical setter is a handler as follows.
This updates (if no timer is involved) the widget from the PI.Code: Select all
private handler setCoolProp(in pValue as optional any) set mCoolVariable to pValue redraw all end handler
This defines an option menu for property coolProp. Options are separated by comma, the typed spaces are used (you indent options 2 and 3 above).MaxV wrote:metadata coolProp.editor is "com.livecode.pi.enum"
metadata coolProp.options is "first option, second option, third option,.."
Yes, of course, as always. This is not special to LC Builder!MaxV wrote:So option name can't have a comma in their names, because options are comma separated. Is it right?
One-line field:MaxV wrote:If I want to use a simple field to set properties, what code should I use?
Code: Select all
metadata coolProp.editor is "com.livecode.pi.text"
Code: Select all
metadata coolProp.editor is "com.livecode.pi.string"
No special property editor (PI uses checkboxes for booleans) orMaxV wrote:If I want to use a check box to set properties, what code should I use?
Code: Select all
metadata coolProp.editor is "com.livecode.pi.boolean"
A full example:MaxV wrote:If I want to use a scroller to set properties, what code should I use?
Code: Select all
private variable mPercent
property "percent" get mPercent set setPercent
metadata percent.editor is "com.livecode.pi.number"
metadata percent.min is "0"
metadata percent.max is "100"
metadata percent.step is "1"
metadata percent.default is "50"
private handler setPercent(in pPercent as Number) returns nothing
put pPercent into mPercent
redraw all
end handler
A special case are colors, you need a getter and a setter for conversion to/from strings. You'll find an example in my Basic Template ( LCB snippet #51).MaxV wrote:What other options do I have?
Else read the release notes, read built-in examples or the community examples or, once again, use propertyInfo.txt.
shiftLock happens
Re: com.livecode.pi
Stunding the propertyInfo.txt file seems that the option available are:
com.livecode.pi.imageID
com.livecode.pi.image_id
com.livecode.pi.imageid
are the same?
- com.livecode.pi.boolean
- com.livecode.pi.color
- com.livecode.pi.colorwithalpha
- com.livecode.pi.customprops
- com.livecode.pi.decorations
- com.livecode.pi.enum
- com.livecode.pi.file
- com.livecode.pi.font
- com.livecode.pi.gradient
- com.livecode.pi.gradientramp
- com.livecode.pi.graphicEffect
- com.livecode.pi.imageID
- com.livecode.pi.image_id
- com.livecode.pi.imageid
- com.livecode.pi.integer
- com.livecode.pi.nubmber
- com.livecode.pi.number
- com.livecode.pi.pattern
- com.livecode.pi.point
- com.livecode.pi.propertyProfile
- com.livecode.pi.script
- com.livecode.pi.stackfiles
- com.livecode.pi.string
- com.livecode.pi.styledText
- com.livecode.pi.text
- com.livecode.pi.textalign
- com.livecode.pi.textstyle
com.livecode.pi.imageID
com.livecode.pi.image_id
com.livecode.pi.imageid
are the same?
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: com.livecode.pi
Yes, this is (besides your typos) available in the PI for LC as a whole.
Great work was done for the new PI! Perhaps we should always recall:
A widget is a control just like other controls in LiveCode.
All editors for properties that a control can have are available, not yet all implemented (for example 'gradient properties') for widgets. Of course you have to implement the properties that use those editors by your own. Reading github shows, they are working on better support for 'standard' properties (that other controls have) for widgets.
Code for using the editor 'file' can be found for example here:
http://forums.livecode.com/viewtopic.ph ... a8#p145027
[And the different names for imageID are probably serving different stackfile versions].
LCB is still experimental, we all are testing and trying, why not you?
Great work was done for the new PI! Perhaps we should always recall:
A widget is a control just like other controls in LiveCode.
All editors for properties that a control can have are available, not yet all implemented (for example 'gradient properties') for widgets. Of course you have to implement the properties that use those editors by your own. Reading github shows, they are working on better support for 'standard' properties (that other controls have) for widgets.
Code for using the editor 'file' can be found for example here:
http://forums.livecode.com/viewtopic.ph ... a8#p145027
Case sensitivity is the default in LCB, exceptions (for example with array keys) are denoted.MaxV wrote:Are they case sensitive?
com.livecode.pi.imageID
com.livecode.pi.image_id
com.livecode.pi.imageid
are the same?
[And the different names for imageID are probably serving different stackfile versions].
LCB is still experimental, we all are testing and trying, why not you?
shiftLock happens
Re: com.livecode.pi
Actually, LCB is case sensitive for string operations, but _not_ for identifiers (such as the name of a module, handler or variable). In this case, all of MaxV's examples would be considered identical.[-hh] wrote:Case sensitivity is the default in LCB, exceptions (for example with array keys) are denoted.MaxV wrote:Are they case sensitive?
com.livecode.pi.imageID
com.livecode.pi.image_id
com.livecode.pi.imageid
are the same?
[And the different names for imageID are probably serving different stackfile versions].
LiveCode Open Source Team — @PeterTBBrett — peter.brett@livecode.com
Re: com.livecode.pi
What is the difference between com.livecode.pi.imageID and com.livecode.pi.image_id?
Is just a mistyping on the file?
Is just a mistyping on the file?
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
Re: com.livecode.pi
The second one is a mis-typing. The first one is correct.MaxV wrote:What is the difference between com.livecode.pi.imageID and com.livecode.pi.image_id?
Is just a mistyping on the file?
LiveCode Open Source Team — @PeterTBBrett — peter.brett@livecode.com