Standalone won't run

Peter M. Brigham pmbrig at gmail.com
Tue Jun 26 22:26:44 EDT 2012


The templatexxx (eg, the templatebutton, the templatefield) governs the properties of newly created controls only. Changing a property of the template<control> will not change anything in already-created controls. Nonetheless, setting the properties of the template<control> before creating a new control is a good way of generating a new control that looks and acts the way you need it to. You should remember to "reset" it when you're done.

You could, I suppose, do something like what you're proposing by creating a template control with a customprop that is a list of long IDs and a mouseup handler that sets the properties of each of the listed controls to the properties of the template control. Then all you have to do is adjust your template's properties and click it, and... voila. Maybe require a control-shift-click to guard against accidental changes. Hmmmm... interesting idea. You could build in a way of storing the long IDs by script, maybe a repeat loop that waits for a mouseclick on a control then stores the long ID of the target, and exit the repeat loop by pressing the commandkey when you're done storing. Hey, this has possibilities!

-- Peter

Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig

On Jun 26, 2012, at 7:46 PM, Peter Haworth wrote:

> You can do that now I believe. There are templates for every object.
> There's a keyword for each named "Templatexxx" where xxx is the type of
> object - card, button, field, etc. See the dictionary for details.
> 
> Pete
> lcSQL Software <http://www.lcsql.com>
> 
> 
> 
> On Tue, Jun 26, 2012 at 4:36 PM, Bob Sneidar <bobs at twft.com> wrote:
> 
>> I was actually thinking it could be even more granular in that you could
>> have any number of "template" objects for different things. Let's say you
>> wanted labels to be one font and size and style, but the editable fields to
>> be another, and buttons to be yet another. Wouldn't it be cool if you could
>> change the properties of a "template" object for each, and everything that
>> was "owned" by that object that didn't have it's property set explicitly
>> would inherit it's properties from it's "owner"? You could change the look
>> and feel of an entire application with a few script commands. As is,
>> everything including buttons would change when the parent changed, unless
>> explicitly set. Just a pipe dream tho'.
>> 
>> Bob
>> 
>> 
>> On Jun 26, 2012, at 4:10 PM, Peter Haworth wrote:
>> 
>>> That is what happens. An object's properties are inherited from it's
>> owner
>>> unless  you specify a different value either in the inspector or by
>> script.
>>> Controls are owned by a group or a card, a card is owned by a stack and a
>>> stack is owned by its main stack.
>>> 
>>> Assuming I'm not totally offbase, that's why I think I could just change
>>> the font of the main stack and not bother going through every control on
>>> every card.  Busy testing that out right now.
>>> 
>>> I believe it's also possible to use profiles to do this but I haven't got
>>> round to figuring profiles out yet.
>>> 
>>> Pete
>>> lcSQL Software <http://www.lcsql.com>
>>> 
>>> 
>>> 
>>> On Tue, Jun 26, 2012 at 3:30 PM, Bob Sneidar <bobs at twft.com> wrote:
>>> 
>>>> What is really needed is to be able to set the owner of an object, as in
>>>> set the owner of this field to field "tplDataEntryField" of card
>>>> "defaults". That way you could set the textfont of one object and have
>> all
>>>> the other objects that have it as an owner change. This could be the
>> basis
>>>> of a kind of OOP hierarchy.
>>>> 
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list