Custom Properties

David Vaughan dvk at dvkconsult.com.au
Wed Apr 12 17:55:25 EDT 2006


Thanks for the idea, Devin. I had looked at custom props previously,  
sufficiently to know what they do but without keeping them in mind  
for real applications.

You have just simplified a database system I am writing, where I  
employ what appears to the user to be modeless operation, tracking  
the state internally to decide whether create/update/delete/undo are  
logical continuations and setting button states accordingly. Now I  
will write this logic in one place rather than scattered about the  
buttons which are repeated across many data screens.

Consider happy thoughts to be floating in your general direction and  
enjoy your day :-)

cheers
David

On 13/04/2006, at 7:26, Devin Asay wrote:

>
> On Apr 12, 2006, at 11:44 AM, Thomas McGrath III wrote:
>
>> Does anyone have any examples on the get/setProps in real usage? I  
>> have been using custom props but not the setProp etc. I would love  
>> some more insightful ideas on it's usage.
>
> The way I use it is much more pedestrian than the Marks'. For me  
> it's a really easy way to make sure my interface objects get set to  
> the proper states. For example, let's say I want to toggle between  
> an 'editable' and 'noneditable' mode for a text editor:
>
> setProp editMode pMode
>   if pMode then
>     enable button "Save"
>     enable button "TextColor"
>     set the lockText of fld "myfld" to true
>     set the traversalOn of fld "myFld" to true
>   else
>     disable button "Save"
>     disable button "TextColor"
>     set the lockText of fld "myfld" to false
>     set the traversalOn of fld "myFld" to false
>   end if
>   pass editMode -- the docs say you have to explicitly pass it to  
> have it set the prop
> end editMode
>
> Anyway, this is a crude example, but illustrates how it's been most  
> useful to me. There may be several events in my program that could  
> trigger a change in edit mode for this field, but in each case all  
> I'd have to do would be to
>
>   set the editMode of cd "editor" to true ## or false
>
> Devin
>
> Devin Asay
> Humanities Technology and Research Support Center
> Brigham Young University
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution



More information about the use-livecode mailing list