Custom Properties

Thomas McGrath III 3mcgrath at adelphia.net
Thu Apr 13 07:59:59 EDT 2006


David,

I think I am starting to see the main goodness in this. The code you  
wrote would be fine in my opinion But if the object has a custom prop  
and you want the 'state' to travel with that object then you can do  
it all at once i.e. set the state of that object and it's attributes  
and store that by the very nature of the setProp in the object  
itself. Then in polling that object/group you then can know if it was  
set to a certain state and that is unique to that object. The actual  
function below might be better in this case and may not be the best  
way to show the usefulness of setProp but I think I am starting to  
see setProps in a better light.

Thanks
Tom
On Apr 13, 2006, at 5:55 AM, David Burgun wrote:

> Hi,
>
> I don't see what is to be gained using setProp's in this example?  
> Surely:
>
> function setEditMode 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
> end setEditMode
>
> ---------------
>
> get setEditMode(true/false)
>
> Would do the same job with less lines of code and be much easier to  
> follow?
>
> All the Best
> Dave
>
>
>
>
> On 12 Apr 2006, at 22:26, Devin Asay wrote:
>> 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

Thomas J McGrath III
3mcgrath at adelphia.net

Lazy River Software™ - http://www.lazyriversoftware.com

Lazy River Metal Art™ - http://www.lazyriversoftware.com/metal.html

Meeting Wear™ - http://www.cafepress.com/meetingwear

Semantic Compaction Systems - http://www.minspeak.com

SCIconics, LLC - http://www.sciconics.com/sciindex.html










More information about the use-livecode mailing list