Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003580 [JEDI VCL] 99 Other feature N/A 2006-03-14 15:29 2006-04-14 03:45
Reporter Grzegorz Skoczylas View Status public  
Assigned To obones
Priority normal Resolution fixed  
Status resolved   Product Version
Summary 0003580: Improved DSA dialog
Description Two improvements in JEDI DSA dialogs:

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

2. Possibility to implement advanced timeout formatting.
Additional Information Point 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;
  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
    Result := sInf5

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

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

Tags No tags attached.
Attached Files zip file icon JEDI DSA [^] (42,010 bytes) 2006-03-14 15:29

- Relationships

-  Notes
obones (administrator)
2006-04-07 06:56

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 (reporter)
2006-04-11 15:37

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.

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 (administrator)
2006-04-14 03:45

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
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

Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker