Formatting of visual fields

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

Formatting of visual fields

Vaidas Didzbalis
I need a view for displaying decimal values (as implemented in standard
windows calculator). How can I set format to View for displaying decimals
with precision specified by user and decimal separator used according
windows settings? Requirements:

  1.. User shall not be allowed type nonnumeric value into such field.
  2.. User shall be able to enter values into view using numeric keypad even
if decimal separator is not #. .
  3.. Field shall format itself (to strip not needed precision or display
non typed zeroes and thousand separator) when user tabs form this view.
For example settings:

Decimal separator (windows settings): #,

Separator for thousands (windows settings): #.

Count of digits on the right side of the decimal separator: 3 (for this
specific field only).

User types: 1234.5 and tabs

View displays: 1.234,500

User types: 1234,5678

View displays: 1.234,568



What is easy way to create such a view with dolphin 4? May be dolphin 5
haves properties prepared for use?



Also, how can I set date picture format for view?



Thank you,

Vaidas


Reply | Threaded
Open this post in threaded view
|

Re: Formatting of visual fields

Ian Bartholomew-18
Vaidas,

> What is easy way to create such a view with dolphin 4?

On my web site is a CurrencyToText converter for Dolphin 4 (Go to the
Goodies for Dolphin4 page and look under Tweaks).  It's not what you
are looking for but it might give you ideas about how to proceed.

http://www.idb.me.uk

> Also, how can I set date picture format for view?

Not quite sure what you mean but

Date defaultLongPicture: true.
Date today

answers 29 October 2002

Date defaultLongPicture: false.
Date today

answers 29/10/2002

You can dynamically set the format that a date uses

s := String writeStream.
Date today printOn: s format: 'yy/MM/d'.
s contents

answers '02/10/29'

You can also use a DateToText converter and set the format there.

DateToText new
    format: 'yy/M/d';
    convertFromLeftToRight: Date today

answers '02/10/29'

Regards
    Ian


Reply | Threaded
Open this post in threaded view
|

Re: Formatting of visual fields

Blair McGlashan
In reply to this post by Vaidas Didzbalis
Vaidas

You wrote in message news:[hidden email]...
> I need a view for displaying decimal values (as implemented in standard
> windows calculator). How can I set format to View for displaying decimals
> with precision specified by user and decimal separator used according
> windows settings? Requirements:
>
>   1.. User shall not be allowed type nonnumeric value into such field.
>   2.. User shall be able to enter values into view using numeric keypad
even
> if decimal separator is not #. .
>   3.. Field shall format itself (to strip not needed precision or display
> non typed zeroes and thousand separator) when user tabs form this view.
>...etc...

You are describing the behaviour of the Masked Edit control. If you happen
to have a license for this Microsoft control (e.g. because you own a copy of
VB or some other MS development tool), then there is a already a complete
wrapping supplied as a standard component of Dolphin XP. I'm not sure
whether it is possible to use this control if you don't have an MS
development tool, but it is perhaps worth a little research on the web to
find out if you are interested.

Otherwise there are a number of free Masked Edit controls available from
various sources (just do a Google search for "Masked Edit"), and one of
these may fit the bill. Of course you may need to do some work to wrap up
the control, unless you can find one that emulates the MS control. Wrapping
an existing control will be significantly less work than writing your own.

Regards

Blair

> For example settings:
>
> Decimal separator (windows settings): #,
>
> Separator for thousands (windows settings): #.
>
> Count of digits on the right side of the decimal separator: 3 (for this
> specific field only).
>
> User types: 1234.5 and tabs
>
> View displays: 1.234,500
>
> User types: 1234,5678
>
> View displays: 1.234,568
>
>
>
> What is easy way to create such a view with dolphin 4? May be dolphin 5
> haves properties prepared for use?
>
>
>
> Also, how can I set date picture format for view?
>
>
>
> Thank you,
>
> Vaidas
>
>