Subject Re: Date mask
Author Marco Menardi
--- In IBObjects@yahoogroups.com, Ales Kahanek <akahanek@a...> wrote:
> Hi,
> when editing DATE column, there is a default mask ' . . ' (it is
> the dd.mm.yyyy mask by default). I do not want any edit mask to show
> while entering the date value, because I use my own entered value
> processing (I want to enter for example +14d - this mean + 14 days
> from today and my processing procedure changes this string
> appropriately). This scenario has worked perfectly but now users
> complain that due to the default mask they are not able to enter the
> plus sign etc. I do not know when and what was changed in the
> sources. How to achieve IBO not showing default date mask? I must
> add, that I do not use any FieldsEditMask or FieldsDisplayFormat
> property.
>
> Using D7, IBO 4.2e, WinXP Pro
>
> This is second attempt, the previous question 7 weeks ago nobody
> answered. I really appreciate your attention.
>
> Thank you
> Ales Kahanek


mmm don't know, but just to try a fix (I've not tried this, sorry,
hope it will work): edit IBC_Date.imp and try:
procedure TIB_CustomDate.UpdateMask( UnboundMask: string );
begin
if UnboundMask = '' then
UnboundMask := '!99' + DateSeparator + '99' + DateSeparator +
'9999;1; ';
inherited UpdateMask( UnboundMask );
end;

has to became:
procedure TIB_CustomDate.UpdateMask( UnboundMask: string );
begin
if (not Assigned( Field )) and (UnboundMask = '') then
UnboundMask := '!99' + DateSeparator + '99' + DateSeparator +
'9999;1; ';
inherited UpdateMask( UnboundMask );
end;

Let me know. If it's Ok, we can sent this patch to Jason for inclusion
in the official IBO tree.
regards
Marco Menardi