TextEdit alignment and DateToText yearPivot

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

TextEdit alignment and DateToText yearPivot

Frank Sergeant
TextEdit alignment

I think #alignment should be a published aspect of TextEdit (so it can be
set easily from the ViewComposer).  I see that it is published in TextEdit's
subclass MultilineTextEdit.  I moved the code up a level (in the class
method #publishedAspectsOfInstances) by copying the following line to the
superclass and commenting it out in the subclass

add: (Aspect choice: #alignment from: AlignmentMap keys asSortedCollection);

I mention this in case anyone else wants to alter his image similarly or in
case OA would like to put it into the base system.

DateToText yearPivot

The several #yearPivot and #yearPivot: methods in DateToText and DateToText
class and their comments are not in agreement (in case OA would like to
change the code or the comments).  Part of the problem is just that the
century is now 20xx rather than 19xx.  I fixed things for my application's
initialization code by explicitly setting the year pivot to float 20 years
ahead of the current year (the ideal pivot depends upon the application, of
course):
    | pivotYear |

    pivotYear := (Date today year \\ 100) + 20.

    DateToText yearPivot: pivotYear.



-- Frank

[hidden email]