Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!oitnews.harvard.edu!yale!zip.eecs.umich.edu!newshost.marcam.com!news.mathworks.com!gatech!howland.reston.ans.net!ix.netcom.com!netcom.com!kthompso
From: kthompso@netcom.com (Kevin Thompson)
Subject: Re: VW2.0 - Inconsistent format of inputting dates??
Message-ID: <kthompsoDCAuCs.J44@netcom.com>
Organization: NETCOM On-line Communication Services (408 261-4700 guest)
References: <3v0bam$njj@hermes.is.co.za>
Date: Wed, 26 Jul 1995 01:19:39 GMT
Lines: 36
Sender: kthompso@netcom20.netcom.com

Rudi Engelbrecht <rudi@momentum.co.za> wrote:
>I am setting up an input field of type Date with the format dd/mm/yy in the
>Properties Tool.
>
>When the date field is displayed it is in the form dd/mm/yy BUT 
>when editing the field the date format is still mm/dd/yy.
>
>Why is this inconsistent?
>Do I have to set some other global system parameters...?

This is pretty deep in the VW2.0 InputField widget, in classes InputFieldView
and PrintConverter.  In particular, look at
InputFieldView>>redisplayFocusChange, the lines (cut-and-paste messiness,
sorry)

   self hasFocus
           ifTrue: [editTextCache == nil
                    ifFalse: [t := editTextCache]
                    ifTrue: [t := converter printStringFor: model value]]
           ifFalse: [editTextCache := displayContents text.
                     self hasEditValue ifFalse: [^self].
                     t := converter formatStringFor: self editValue].

e.g., use the formatted string (dd/mm/yy) when not in focus, but the
unformatted string (mm/dd/yy) when in focus.  This is a feature in other words
:).

I've never heard directly from PPS on this, but I suspect their motivation is
this: not all formatted strings are readable.  For example, you might select a
number format like '##,##', and default PPS Number>readFrom: doesn't handle
the comma properly.  It could be confusing to the user to have a displayed
value that you can't then read/accept.

Kevin Thompson
-- 
kthompso@netcom.com        
