View Issue Details

IDProjectCategoryView StatusLast Update
0003580JEDI VCL99 Otherpublic2006-04-14 03:45
ReporterGrzegorz SkoczylasAssigned Toobones 
PrioritynormalSeverityfeatureReproducibilityN/A
Status resolvedResolutionfixed 
PlatformN/AOSN/AOS VersionN/A
Product Version 
Target VersionFixed in Version3.30 
Summary0003580: Improved DSA dialog
DescriptionTwo improvements in JEDI DSA dialogs:

1. More readable message when timeout is 60 seconds or longer.

2. Possibility to implement advanced timeout formatting.
Additional InformationPoint 0000001: Simple improvement in formatting timeout message when timeout is one minute or longer.

Point #2: Defaut behaviour is the same as so far. But, when needed, it is possible to implement more advanced timeout formatting. For example in Polish standard formatting is not good enough. For proper formatting timeout message we can use following functions:

function Odmiana(nCnt: integer;
                  const sInf1, sInf2: string;
                  const sInf5: string = '')
                  : string;
begin
  nCnt := Abs(nCnt);
  if nCnt = 1 then
    Result := sInf1
  else if (sInf5 = '')
           or (((nCnt mod 10) in [2..4])
               and not((nCnt mod 100) in [12..14])) then
    Result := sInf2
  else
    Result := sInf5
end;

function DSATimeFmt(nSecs: Integer)
                     : string;
var
  nMins: Integer;

begin { DSATimeFmt }
  nMins := nSecs div 60;
  nSecs := nSecs mod 60;
  if nMins <> 0 then
    Result := Format(RsCntdownTextMin,
                     [nMins,
                      Odmiana(nMins,
                              'minutę', 'minuty', 'minut'),
                      nSecs,
                      Odmiana(nSecs,
                              'sekundę', 'sekundy', 'sekund')])
  else
    Result := Format(RsCntdownTextSec,
                     [nSecs,
                      Odmiana(nSecs,
                              'sekundę', 'sekundy', 'sekund')])
end ;

initialization
  SetDSATimeFmt(DSATimeFmt);
TagsNo tags attached.

Activities

2006-03-14 15:29

 

JEDI DSA improved.zip (42,010 bytes)

obones

2006-04-07 06:56

administrator   ~0009023

Well, thanks for providing this, but I have no idea what you changed and what for. Please provide detailed explanations on where the changes occured.

Grzegorz Skoczylas

2006-04-11 15:37

reporter   ~0009065

Changes in "JvResources.pas":
- Constant "RsCntdownText" replaced with "RsCntdownTextMin" and "RsCntdownTextSec".
- Added constants "RsCntdownMinText" and "RsCntdownMinsText".

Reason: Constants used for formatting more readable countdown message in DSA dialogs, when countdown time is 60 seconds or longer.

Changes in "JvDSADialogs.pas":
- Changed protected method TimeoutUnit (added second parameter).
- Defined procedural type "TJvDSATimeFmt".
- New procedure "SetDSATimeFmt" allow to replace standard function for formatting countdown message with another one.
- New function "StdDSATimeFmt" - it is now default function for formatting countdown message in DSA dialogs.
- Implementation variable "FunctionTimeFmt" remember current function used for formatting countdown message.
- Small modyfication of implementation of "TimerEvent" method.

Reasons:
1. More readable standard countdown message in DSA dialogs when countdown time is 60 seconds or longer.
2. Possibility to replace standard function for formatting countdown message with function defined by application, e.g. for formmatting countdown message according to Polish rules.

obones

2006-04-14 03:45

administrator   ~0009104

Ok thanks.
This is now in CVS, but has been adpated to be slightly more flexible.
Basically, the RsCntdownText is still there, but has only one parameter which is the string representing the time. The standard formatter will do what it was doing in your modifications.
The names have also been expanded (TimeFormatter instead of TimeFmt) to make them clearer.
Finally, note that to do translation, we recommend you use DxGetText.

Issue History

Date Modified Username Field Change
2006-03-14 15:29 Grzegorz Skoczylas New Issue
2006-03-14 15:29 Grzegorz Skoczylas File Added: JEDI DSA improved.zip
2006-04-07 06:56 obones Note Added: 0009023
2006-04-07 06:56 obones Status new => feedback
2006-04-11 15:37 Grzegorz Skoczylas Note Added: 0009065
2006-04-12 01:07 obones Status feedback => acknowledged
2006-04-14 03:45 obones Status acknowledged => resolved
2006-04-14 03:45 obones Resolution open => fixed
2006-04-14 03:45 obones Assigned To => obones
2006-04-14 03:45 obones Note Added: 0009104