Timestamp support in DateTimePicker

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

Timestamp support in DateTimePicker

Yar Hwee Boon-3
Hi all,

Looking at DateTimePicker/DatePresenter, it seems that it does not support  
editing of Timestamp (which I believe SysDateTimePick32 control should).  
Did I missed it?

I tried to add this functionality by adding the methods #isDateTimeMode  
and #isDateTimeMode: along with an instance variable isDateTimeMode for  
storing a boolean, and changed #modelClass to return TimeStamp accordingly  
(working similarly to the #isTimeMode aspect). I also modified  
DateTimePicker>>publishedAspectsOfInstances to add in the new  
#isDateTimeMode aspect.

But where do I put the isDateTimeMode instance variable? Do I simply move  
the whole DateTimePicker class to my own package? Or should I create a  
subclass instead. In that case, how do I add a view subclass and make it  
usable with DatePresenter?

If I just did it my current way (no subclass), is there also a way to add  
an aspect instead of replacing  
DateTimePicker>>publishedAspectsOfInstances? Thanks.

--
Regards
Hwee Boon
MotionObj


Reply | Threaded
Open this post in threaded view
|

Re: Timestamp support in DateTimePicker

Chris Uppal-3
Yar Hwee Boon wrote:

> But where do I put the isDateTimeMode instance variable? Do I simply move
> the whole DateTimePicker class to my own package? Or should I create a
> subclass instead. In that case, how do I add a view subclass and make it
> usable with DatePresenter?

I haven't made much (if any) use of DateTimePicker, so I may be missing
something that's built-in, but in general, for such cases I'd make my own
subclass.  Once you have created it you can execute an expression like:

    DatePresenter addView: MyDateTimePicker asResource: 'Default view'.

which will create a new instance of your class, convert it into a ViewResource
and associate it with DatePresenter.  During development you'll probably end up
changing the instvars of you new class, if you do then re-executing the above
expression will be easier than messing about with STB conversion methods.

    -- chris


Reply | Threaded
Open this post in threaded view
|

Re: Timestamp support in DateTimePicker

Blair McGlashan-3
"Chris Uppal" <[hidden email]> wrote in message
news:[hidden email]...

> Yar Hwee Boon wrote:
>
>> But where do I put the isDateTimeMode instance variable? Do I simply move
>> the whole DateTimePicker class to my own package? Or should I create a
>> subclass instead. In that case, how do I add a view subclass and make it
>> usable with DatePresenter?
>
> I haven't made much (if any) use of DateTimePicker, so I may be missing
> something that's built-in, but in general, for such cases I'd make my own
> subclass.  Once you have created it you can execute an expression like:
>
>    DatePresenter addView: MyDateTimePicker asResource: 'Default view'.
>
> which will create a new instance of your class, convert it into a
> ViewResource
> and associate it with DatePresenter.  During development you'll probably
> end up
> changing the instvars of you new class, if you do then re-executing the
> above
> expression will be easier than messing about with STB conversion methods.

Or simply keep your view resources open in a view composer when modifying
the instance variables, re-saving the view resource after you do so. This
will allow Dolphin's normal schema migration to keep your view resources up
to date in the simplest way, though of course you may need to initialise any
new instance variables you add.

Regards

Blair