Calendar fixes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Calendar fixes

Ricardo Moran
Hi guys,

Given the recent interest in the CalendarMorph, I've been working on it a little more (see the project attached). Now I find it much more responsive by just deferring the update of the GUI (which is expensive) in the #step method. I also fixed the issue with the translations not updating when changing languages. Now the month names and day initials should get updated but the problem is that we don't have translations for them yet in the database, so you won't notice this until we add them.

Important for developers: I changed the way the locale changes are notified to morphs. See Project>>#updateLocaleDependentsWithPreviousSupplies:gently: and Morph>>#localeChanged. Basically, I just send #localeChanged to all morphs and I have the default implementation in Morph doing nothing. I think this is much better than before because now any morph can get notified of locale changes by just implementing the #localeChanged method, but I wanted to ask for your opinion on this.

Cheers,
Richo

_______________________________________________
etoys-dev mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/etoys-dev

Calendario.005.pr (202K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Calendar fixes

Karl Ramberg
I can't get the arrows for changing month and year to work
Nice updates though :-)

Karl

On Wed, Jan 4, 2012 at 6:00 PM, Ricardo Moran <[hidden email]> wrote:
Hi guys,

Given the recent interest in the CalendarMorph, I've been working on it a little more (see the project attached). Now I find it much more responsive by just deferring the update of the GUI (which is expensive) in the #step method. I also fixed the issue with the translations not updating when changing languages. Now the month names and day initials should get updated but the problem is that we don't have translations for them yet in the database, so you won't notice this until we add them.

Important for developers: I changed the way the locale changes are notified to morphs. See Project>>#updateLocaleDependentsWithPreviousSupplies:gently: and Morph>>#localeChanged. Basically, I just send #localeChanged to all morphs and I have the default implementation in Morph doing nothing. I think this is much better than before because now any morph can get notified of locale changes by just implementing the #localeChanged method, but I wanted to ask for your opinion on this.

Cheers,
Richo

_______________________________________________
etoys-dev mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/etoys-dev



_______________________________________________
etoys-dev mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/etoys-dev
Reply | Threaded
Open this post in threaded view
|

Re: Calendar fixes

Ricardo Moran

On Fri, Jan 6, 2012 at 9:04 PM, karl ramberg <[hidden email]> wrote:
I can't get the arrows for changing month and year to work

That's weird. It works here.

Maybe the morph is not stepping for some reason? If that's the case, the date would be changed but the UI won't be updated.

Also, maybe you were trying the next month/year buttons. For this particular project I made imposible to choose a future date (to prevent an infinite loop when counting the days), see the script "preventFromChoosingAFutureDate".
 
Nice updates though :-)

Thanks. Do you think I should commit the locale notification change to etoys?

Richo


Karl

On Wed, Jan 4, 2012 at 6:00 PM, Ricardo Moran <[hidden email]> wrote:
Hi guys,

Given the recent interest in the CalendarMorph, I've been working on it a little more (see the project attached). Now I find it much more responsive by just deferring the update of the GUI (which is expensive) in the #step method. I also fixed the issue with the translations not updating when changing languages. Now the month names and day initials should get updated but the problem is that we don't have translations for them yet in the database, so you won't notice this until we add them.

Important for developers: I changed the way the locale changes are notified to morphs. See Project>>#updateLocaleDependentsWithPreviousSupplies:gently: and Morph>>#localeChanged. Basically, I just send #localeChanged to all morphs and I have the default implementation in Morph doing nothing. I think this is much better than before because now any morph can get notified of locale changes by just implementing the #localeChanged method, but I wanted to ask for your opinion on this.

Cheers,
Richo

_______________________________________________
etoys-dev mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/etoys-dev




_______________________________________________
etoys-dev mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/etoys-dev
Reply | Threaded
Open this post in threaded view
|

Re: [squeakland] Calendar fixes

Scott Wallace
In reply to this post by Ricardo Moran
Hi, Richo,

On Jan 4, 2012, at 9:00 AM, Ricardo Moran wrote:

> Important for developers: I changed the way the locale changes are notified to morphs. See Project>>#updateLocaleDependentsWithPreviousSupplies:gently: and Morph>>#localeChanged. Basically, I just send #localeChanged to all morphs and I have the default implementation in Morph doing nothing. I think this is much better than before because now any morph can get notified of locale changes by just implementing the #localeChanged method, but I wanted to ask for your opinion on this.

This seems a good thing -- much cleaner.

One thing that seems to be lost in your implementation however is that the existing code goes out of its way to defer the "localeChanged" sends for all top-level ScriptEditorMorphs until all the #localChanged sends have completed for morphs that are *not* top-level ScriptEditorMorphs.

I'm not 100% certain that this logic is still necessary, but obviously it was once necessary, probably for some infrequently-seen combination of conditions, and retaining the logic does no real harm, so I suggest that it not be discarded.  A small change to your method could preserve the existing order without losing the benefits of your improvement; I attach a little change-set incorporating that change for your consideration :)

Thank you!

  -- Scott



_______________________________________________
etoys-dev mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/etoys-dev

updateLocale-sw.3.cs.gz (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [squeakland] Calendar fixes

Ricardo Moran


On Wed, Jan 11, 2012 at 11:01 PM, Scott Wallace <[hidden email]> wrote:
Hi, Richo,

On Jan 4, 2012, at 9:00 AM, Ricardo Moran wrote:

> Important for developers: I changed the way the locale changes are notified to morphs. See Project>>#updateLocaleDependentsWithPreviousSupplies:gently: and Morph>>#localeChanged. Basically, I just send #localeChanged to all morphs and I have the default implementation in Morph doing nothing. I think this is much better than before because now any morph can get notified of locale changes by just implementing the #localeChanged method, but I wanted to ask for your opinion on this.

This seems a good thing -- much cleaner.

One thing that seems to be lost in your implementation however is that the existing code goes out of its way to defer the "localeChanged" sends for all top-level ScriptEditorMorphs until all the #localChanged sends have completed for morphs that are *not* top-level ScriptEditorMorphs.

Yes, you're right. I didn't notice the order.
 

I'm not 100% certain that this logic is still necessary, but obviously it was once necessary, probably for some infrequently-seen combination of conditions, and retaining the logic does no real harm, so I suggest that it not be discarded.  A small change to your method could preserve the existing order without losing the benefits of your improvement; I attach a little change-set incorporating that change for your consideration :)

Thanks, I'll commit the changes to etoys :)

Cheers,
Richo
 

Thank you!

 -- Scott



_______________________________________________
etoys-dev mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/etoys-dev



_______________________________________________
etoys-dev mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/etoys-dev