Page 1 of 2

Template

Posted: Wed Nov 08, 2023 11:04 am
by richmond62
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.

Re: Template

Posted: Wed Nov 08, 2023 11:13 am
by Klaus
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.

Re: Template

Posted: Wed Nov 08, 2023 11:16 am
by richmond62
Ouch. Thank you, Klaus.

Re: Template

Posted: Wed Nov 08, 2023 11:35 am
by Klaus
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?
:-)

Re: Template

Posted: Wed Nov 08, 2023 11:37 am
by richmond62
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'

Re: Template

Posted: Wed Nov 08, 2023 11:59 am
by Klaus
Maybe that is handled by one of the gazillion other REV libs?
And what has that to do with my proposal? :-D

Re: Template

Posted: Wed Nov 08, 2023 12:45 pm
by richmond62
And what has that to do with my proposal?
Nothing much. 8)

Re: Template

Posted: Wed Nov 08, 2023 12:48 pm
by Klaus
:D :D :D

Re: Template

Posted: Wed Nov 08, 2023 1:06 pm
by bn
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

Re: Template

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

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

Re: Template

Posted: Wed Nov 08, 2023 1:37 pm
by bn
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

Re: Template

Posted: Wed Nov 08, 2023 1:39 pm
by Klaus
AHA, thanks for the hint, Bernd!

Re: Template

Posted: Wed Nov 08, 2023 1:41 pm
by bn
Richmond,

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

Kind regards
Bernd

Re: Template

Posted: Wed Nov 08, 2023 1:43 pm
by bn
I forgot:

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

Kind regards
Bernd

Re: Template

Posted: Wed Nov 08, 2023 1:47 pm
by richmond62
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.