Template

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

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9388
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Template

Post by richmond62 » Wed Nov 08, 2023 11:04 am

I am aware of the template stack, and one can muck around with the settings of that so every stack one subsequently produces follows the properties of that.

I would like to know if, somewhere inwith the IDE there reside templates of other objects/controls, such as buttons or fields, and if so where they are, so, for instance, I can set things up so that, in future, in my LC IDE every button can appear with the textColor already set to British Racing Green, whether its 3D is set to true or not.

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Template

Post by Klaus » Wed Nov 08, 2023 11:13 am

I don't think there are more "templates" buried in the IDE, the tool palette does this "on the fly"
by setting all these props for the templateXXX before the actual control is created.

Maybe you could create a library (or front or backscript), but be aware that you need to create e.g.
a button only via the message box or script, since the tools palette will always overwrite your settings.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9388
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Template

Post by richmond62 » Wed Nov 08, 2023 11:16 am

Ouch. Thank you, Klaus.

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Template

Post by Klaus » Wed Nov 08, 2023 11:35 am

What about creating your own littel tools palette for this?
Where a doubleclick on a control in the palette would create a control with YOUR settings?
:-)

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9388
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Template

Post by richmond62 » Wed Nov 08, 2023 11:37 am

Poking around in the stackScript of the Tools palette I have found these:

templategraphic

templateGroup

#Reset the templates we are going to use

templatebutton

templateimage

BUT no 'templateField'

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Template

Post by Klaus » Wed Nov 08, 2023 11:59 am

Maybe that is handled by one of the gazillion other REV libs?
And what has that to do with my proposal? :-D

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9388
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Template

Post by richmond62 » Wed Nov 08, 2023 12:45 pm

And what has that to do with my proposal?
Nothing much. 8)

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Template

Post by Klaus » Wed Nov 08, 2023 12:48 pm

:D :D :D

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4003
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Template

Post by bn » Wed Nov 08, 2023 1:06 pm

Hi Richmond,

You could try to change the file for the field: com.livecode.interface.classic.Field.tsv

/Applications/LiveCode 9.X.X.app/Contents/Tools/Toolset/resources/supporting_files/property_definitions/com.livecode.interface.classic.Field.tsv

On a Mac you can open Livecode.app by right clicking on the icon and choose "Information". Then follow the path to com.livecode.interface.classic.Field.tsv above.

Try to edit that file and see if it does what you want and save it.

You might want to save the original file first and work on a copy.

Kind regards
Bernd

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9388
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Template

Post by richmond62 » Wed Nov 08, 2023 1:28 pm

Thank you, Bernd.

Is a .tsv file simply a text file or something more complicated?

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4003
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Template

Post by bn » Wed Nov 08, 2023 1:37 pm

richmond62 wrote:
Wed Nov 08, 2023 1:28 pm
Thank you, Bernd.

Is a .tsv file simply a text file or something more complicated?
It is a tab separated value file. All values of a line are separated by a tab. Similar to CSV which uses comma.

Every tab separated value goes into the respective column, empty values put empty into the respective column.

It is how you can feed data for a spreadsheet.

I _think_ this should work so that when you grab a "Field" from the toolbar it has the properties you define in the xxx.tsv file.

Kind regards
Bernd

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Template

Post by Klaus » Wed Nov 08, 2023 1:39 pm

AHA, thanks for the hint, Bernd!

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4003
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Template

Post by bn » Wed Nov 08, 2023 1:41 pm

Richmond,

Using a spreadsheet program is probably the easiest way, you would have to save the changes to a "TSV" file.

Kind regards
Bernd

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4003
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Template

Post by bn » Wed Nov 08, 2023 1:43 pm

I forgot:

TSV is a simple text file with the tabs as separators.

Kind regards
Bernd

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9388
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Template

Post by richmond62 » Wed Nov 08, 2023 1:47 pm

Well, I have 9 year olds importing delimited text files into table fields, altering them, and the exporting them: so there should be hope for me. 8)

Probably with the help of LibreOffice.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”