CalendarWidget

Bob Sneidar bobs at twft.com
Tue Mar 27 11:53:25 EDT 2012


What I do is I put the dates I want to start with into the dialogData and then call the calendar stack as modal or as sheet (which is modal by nature). When I return from the calendar stack I get the dialogData, checking for empty in case the user cancelled. I let the calling stack handle what to do with the date. For instance, what if the user selected a date earlier than today, and your stack was scheduling a lodging reservation? That would clearly be an error. However you might be working with a to-do list in which case pre dating an event would be conceivable. The Calendar stack couldn't possibly know the difference, so I would not have the calendar stack populate anything if I were you. 

Bob


On Mar 26, 2012, at 7:21 PM, Charles Szasz wrote:

> on mouseUp
>   if dialogdata is not empty
>   then
>      put item 2 of dialogdata into t 
>      put "/" after t
>      put item 3 of dialogdata after t 
>      put "/" after t
>      put item 1 of dialogdata into s 
>      delete character 1 to 2 of s 
>      put s after t     
>      put t into field "date1" of stack "My app"
>   else
>      put the uMonth of group "calendarWidget" of card id 1002 into t
>      put "/" after t
>      put the uMonth of group "calendarWidget" of card id 1002 after t 
>      put "/" after t
>      put the uYear of group "calendarWidget" of card id 1002 into s
>      delete character 1 to 2 of s
>      put s after t
>      put t into field "date1" of stack "My app"
>   end if
>   close this stack
> end mouseUp
> 
> What changes do I need to make so calendarWidget 101 can insert dates in other fields?
> 
> Charles Szasz
> cszasz at mac.com
> 
> 
> 
> 
> _______________________________________________
> 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