New to LiveCode- Issue with Documentation

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
TheMexican
Posts: 1
Joined: Fri Feb 16, 2018 5:53 pm

New to LiveCode- Issue with Documentation

Post by TheMexican » Fri Feb 16, 2018 6:00 pm

I am new to LiveCode. My background in programming comes from Python and also Javascript.
The main issue I have is reading the documentation. For example, I am working with a Table Field. I would like to know all of the properties and actions of a Table Field. I cannot find anything on the Doc API where it shows me all of the properties and actions of the Table Field.

Is there a way to find out what properties/methods an object contains?
Am I missing something?

Thanks!!

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: New to LiveCode- Issue with Documentation

Post by jmburnod » Fri Feb 16, 2018 6:41 pm

Welcome to this forum,
This should be useful:
http://lessons.livecode.com/m/datagrid/ ... -s-columns
Best regards
Jean-Marc
https://alternatic.ch

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

Re: New to LiveCode- Issue with Documentation

Post by dunbarx » Fri Feb 16, 2018 7:55 pm

Every control has a property, "the properties". You must know, though, that this is in array form, so you would need to:

Code: Select all

on mouseUp
   put the properties of fld "yourtableField" into temp
   combine temp with return and comma
   replace comma with "  - has a value of: " in temp
   answer temp
end mouseUp
Um, that third line is just for grins. :wink: Hey, can you see that you can merge lines 2 and 3?

Craig Newman
Last edited by dunbarx on Sat Feb 17, 2018 10:38 pm, edited 1 time in total.

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: New to LiveCode- Issue with Documentation

Post by bogs » Fri Feb 16, 2018 8:19 pm

Thanks Craig, that is neat to know :D You know, somewhere I seem to remember having found all the properties for all the objects in the docs, but danged if I remember where I was looking at the time. Probably when I was going through Mc :roll:

This may work for you as well, and can be executed from the message box, multi line section (remember to hit ctrl/Enter) -

Code: Select all

  put the properties of [object] "name" into arrayVariable
  put the keys of arrayVariable into propertiesList
  put propertiesList
So for example, a card with one button on it, you want the buttons properties --

Code: Select all

  put the properties of button 1 into arrayVariable
  put the keys of arrayVariable into propertiesList
  put propertiesList
returns below -

Code: Select all

traversalOn
ink
threeD
hiliteBorder
rect
mnemonic
armFill
visitedIcon
patterns
showName
showIcon
colors
hilited
sharedHilite
shadow
textAlign
armed
menuMouseButton
id
altId
labelWidth
accelKey
armedIcon
textStyle
lockLoc
visited
showHilite
label
autoHilite
style
disabledIcon
armBorder
name
icon
toolTip
layer
accelText
visible
cantSelect
borderWidth
menuLines
margins
opaque
accelMods
text
shadowOffset
default
menuName
hiliteFill
showBorder
textSize
hiliteIcon
disabled
autoArm
menuMode
family
textFont
showFocusBorder
menuHistory
As well, you want to keep in mind the following -
Comments:
Not every property is included in the properties property. The following types of properties are excluded:
  • Read-only properties
  • The script property and custom properties
  • Synonyms: Only one synonym for each property is included.
  • Duplicates: Properties that are functionally duplicated by other properties are not included. For example, the rectangle property is included, but not the height, width, top, bottom, left, right, or location properties, because you can derive all of them from the object's rectangle.
  • Properties other than object properties: Global properties, local properties, properties of a character or chunk in a field, and adjectives such as short that are implemented internally as properties are all excluded.
  • Others: Some other properties are excluded.
Image

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: New to LiveCode- Issue with Documentation

Post by bogs » Fri Feb 16, 2018 9:57 pm

As I was poking around (like I am wont to do on occasion), I did think of another way to see all the properties of an object without having to write any code.

If you open the property inspector for the object your curious about, you can go to the 'property profiles' section. If you click the + sign to the right of 'Profiles', you can add a profile set, in this case I added 'oneTwo', but it doesn't matter as I will be deleting it when done.

In the middle section, after you select the profile you just made, you'll see 'oneTwo profile properties'. If you click the + there, you'll see the list 'Add Property', which effectively shows you all the properties you can put in.
Image
Again, this is just another way to view them, The way Craig listed, or through the message box as I put above is far more versatile.
Image

livecodeali
Livecode Staff Member
Livecode Staff Member
Posts: 192
Joined: Thu Apr 18, 2013 2:48 pm

Re: New to LiveCode- Issue with Documentation

Post by livecodeali » Sat Feb 17, 2018 10:23 am

If you go to the dictionary entry for the field object, you will find a table of associated properties and messages beneath it:
Screen Shot 2018-02-17 at 09.15.58.png
I can't remember off the top of my head what version this was added in, it's definitely in 9 and probably in 8.
Unfortunately this is not a list of properties that are specific to list fields, just fields in general. At some point I think it would be good to split these out into the specific sub-types of object. This has been done to some extent in the IDE with the property inspector, so that is probably the best place to look as others have said.

The following might be the best at-a-glance guide to the properties that apply to a list field (this file is used to generate the property inspector). Although beware that this file is manually maintained, and might have things in that are not actually engine properties but custom properties that are handled in the IDE.
https://github.com/livecode/livecode-id ... tField.tsv

jameshale
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 474
Joined: Thu Sep 04, 2008 6:23 am
Location: Melbourne Australia

Re: New to LiveCode- Issue with Documentation

Post by jameshale » Sat Feb 17, 2018 10:37 pm

This is the same, I think, in the docset I make for Dash.
For each entry of type “object”, “widget”, “library” and “module” a search is performed for any other entry that lists this type as “Associated”.
The results of these are thus presented, sorted by type and name under each “object”, “widget”, “library” or “module” (and the Data Grid) entry.
BTW, module is a new category introduced in lc9dp11 for the widget utility scripts that were formerly called libraries.

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: New to LiveCode- Issue with Documentation

Post by bogs » Sat Feb 17, 2018 10:48 pm

bogs wrote:
Fri Feb 16, 2018 8:19 pm
You know, somewhere I seem to remember having found all the properties for all the objects in the docs, but danged if I remember where I was looking at the time. Probably when I was going through Mc :roll:
Heh, just came back to say apparently I was right :twisted:
Selection_006.png
Can't ask for more than that...
Image

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: New to LiveCode- Issue with Documentation

Post by bogs » Sun Feb 18, 2018 4:13 am

I started poking around in 6.x and 7.x, and found you could also get to what I saw in Mc by going to the dictionary -> object (field is the base object for a table field) -> then sort by [Type].
Selection_003.png
Field properties...
If your in 8.x, you can open the dictionary, go to associations: -> field
Selection_004.png
Selection_004.png (8.38 KiB) Viewed 5136 times
then sort the entries by 'type' and properties will fall right below 'messages'.
Selection_006.png
Image

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: New to LiveCode- Issue with Documentation

Post by MaxV » Mon Feb 19, 2018 11:38 am

See http://livecode.wikia.com/wiki/Field#All_properties

and on the top of the page there is:
Pay attention to the basic table object option, since it creates "phantom fields", one per cell like field "revCell-2,3" (row,column); this way you can intercept messages easily when working with cells.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”