[453] | 1 | //kt -- Modified with SourceScanner on 8/7/2007
|
---|
| 2 | unit fxBroker;
|
---|
| 3 |
|
---|
| 4 | interface
|
---|
| 5 |
|
---|
| 6 | uses
|
---|
| 7 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
---|
| 8 | StdCtrls, DateUtils, ORNet, ORFn, rMisc, ComCtrls, Buttons, ExtCtrls,
|
---|
| 9 | ORCtrls, ORSystem, DKLang;
|
---|
| 10 |
|
---|
| 11 | type
|
---|
| 12 | TfrmBroker = class(TForm)
|
---|
| 13 | pnlTop: TORAutoPanel;
|
---|
| 14 | lblMaxCalls: TLabel;
|
---|
| 15 | txtMaxCalls: TCaptionEdit;
|
---|
| 16 | cmdPrev: TBitBtn;
|
---|
| 17 | cmdNext: TBitBtn;
|
---|
| 18 | udMax: TUpDown;
|
---|
| 19 | memData: TRichEdit;
|
---|
| 20 | lblCallID: TStaticText;
|
---|
| 21 | btnRLT: TButton;
|
---|
| 22 | DKLanguageController1: TDKLanguageController;
|
---|
| 23 | procedure cmdPrevClick(Sender: TObject);
|
---|
| 24 | procedure cmdNextClick(Sender: TObject);
|
---|
| 25 | procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
---|
| 26 | procedure FormResize(Sender: TObject);
|
---|
| 27 | procedure FormCreate(Sender: TObject);
|
---|
| 28 | procedure FormKeyUp(Sender: TObject; var Key: Word;
|
---|
| 29 | Shift: TShiftState);
|
---|
| 30 | procedure btnRLTClick(Sender: TObject);
|
---|
| 31 | private
|
---|
| 32 | { Private declarations }
|
---|
| 33 | FRetained: Integer;
|
---|
| 34 | FCurrent: Integer;
|
---|
| 35 | public
|
---|
| 36 | { Public declarations }
|
---|
| 37 | end;
|
---|
| 38 |
|
---|
| 39 | procedure ShowBroker;
|
---|
| 40 |
|
---|
| 41 | implementation
|
---|
| 42 |
|
---|
| 43 | {$R *.DFM}
|
---|
| 44 |
|
---|
| 45 | procedure ShowBroker;
|
---|
| 46 | var
|
---|
| 47 | frmBroker: TfrmBroker;
|
---|
| 48 | begin
|
---|
| 49 | frmBroker := TfrmBroker.Create(Application);
|
---|
| 50 | try
|
---|
| 51 | ResizeAnchoredFormToFont(frmBroker);
|
---|
| 52 | with frmBroker do
|
---|
| 53 | begin
|
---|
| 54 | FRetained := RetainedRPCCount - 1;
|
---|
| 55 | FCurrent := FRetained;
|
---|
| 56 | LoadRPCData(memData.Lines, FCurrent);
|
---|
| 57 | memData.SelStart := 0;
|
---|
| 58 | // lblCallID.Caption := 'Last Call Minus: ' + IntToStr(FRetained - FCurrent); <-- original line. //kt 8/7/2007
|
---|
| 59 | lblCallID.Caption := DKLangConstW('fxBroker_Last_Call_Minusx') + IntToStr(FRetained - FCurrent); //kt added 8/7/2007
|
---|
| 60 | ShowModal;
|
---|
| 61 | end;
|
---|
| 62 | finally
|
---|
| 63 | frmBroker.Release;
|
---|
| 64 | end;
|
---|
| 65 | end;
|
---|
| 66 |
|
---|
| 67 | procedure TfrmBroker.cmdPrevClick(Sender: TObject);
|
---|
| 68 | begin
|
---|
| 69 | FCurrent := HigherOf(FCurrent - 1, 0);
|
---|
| 70 | LoadRPCData(memData.Lines, FCurrent);
|
---|
| 71 | memData.SelStart := 0;
|
---|
| 72 | //lblCallID.Caption := 'Last Call Minus: ' + IntToStr(FRetained - FCurrent); <-- original line. //kt 8/7/2007
|
---|
| 73 | lblCallID.Caption := DKLangConstW('fxBroker_Last_Call_Minusx') + IntToStr(FRetained - FCurrent); //kt added 8/7/2007
|
---|
| 74 | end;
|
---|
| 75 |
|
---|
| 76 | procedure TfrmBroker.cmdNextClick(Sender: TObject);
|
---|
| 77 | begin
|
---|
| 78 | FCurrent := LowerOf(FCurrent + 1, FRetained);
|
---|
| 79 | LoadRPCData(memData.Lines, FCurrent);
|
---|
| 80 | memData.SelStart := 0;
|
---|
| 81 | //lblCallID.Caption := 'Last Call Minus: ' + IntToStr(FRetained - FCurrent); <-- original line. //kt 8/7/2007
|
---|
| 82 | lblCallID.Caption := DKLangConstW('fxBroker_Last_Call_Minusx') + IntToStr(FRetained - FCurrent); //kt added 8/7/2007
|
---|
| 83 | end;
|
---|
| 84 |
|
---|
| 85 | procedure TfrmBroker.FormClose(Sender: TObject; var Action: TCloseAction);
|
---|
| 86 | begin
|
---|
| 87 | SetRetainedRPCMax(StrToIntDef(txtMaxCalls.Text, 5))
|
---|
| 88 | end;
|
---|
| 89 |
|
---|
| 90 | procedure TfrmBroker.FormResize(Sender: TObject);
|
---|
| 91 | begin
|
---|
| 92 | Refresh;
|
---|
| 93 | end;
|
---|
| 94 |
|
---|
| 95 | procedure TfrmBroker.FormCreate(Sender: TObject);
|
---|
| 96 | begin
|
---|
| 97 | udMax.Position := GetRPCMax;
|
---|
| 98 | end;
|
---|
| 99 |
|
---|
| 100 | procedure TfrmBroker.FormKeyUp(Sender: TObject; var Key: Word;
|
---|
| 101 | Shift: TShiftState);
|
---|
| 102 | begin
|
---|
| 103 | if Key = VK_ESCAPE then
|
---|
| 104 | begin
|
---|
| 105 | Key := 0;
|
---|
| 106 | Close;
|
---|
| 107 | end;
|
---|
| 108 | end;
|
---|
| 109 |
|
---|
| 110 | procedure TfrmBroker.btnRLTClick(Sender: TObject);
|
---|
| 111 | var
|
---|
| 112 | startTime, endTime: tDateTime;
|
---|
| 113 | clientVer, serverVer, diffDisplay: string;
|
---|
| 114 | theDiff: integer;
|
---|
| 115 | disclaimer : string; //kt
|
---|
| 116 | const
|
---|
| 117 | TX_OPTION = 'OR CPRS GUI CHART';
|
---|
| 118 | //disclaimer = 'NOTE: Strictly relative indicator:'; <-- original line. //kt 8/7/2007
|
---|
| 119 | begin
|
---|
| 120 | disclaimer := DKLangConstW('fxBroker_NOTEx_Strictly_relative_indicatorx'); //kt added 8/7/2007
|
---|
| 121 |
|
---|
| 122 | clientVer := clientVersion(Application.ExeName); // Obtain before starting.
|
---|
| 123 |
|
---|
| 124 | // Check time lapse between a standard RPC call:
|
---|
| 125 | startTime := now;
|
---|
| 126 | serverVer := serverVersion(TX_OPTION, clientVer);
|
---|
| 127 | endTime := now;
|
---|
| 128 | theDiff := milliSecondsBetween(endTime, startTime);
|
---|
| 129 | diffDisplay := intToStr(theDiff);
|
---|
| 130 |
|
---|
| 131 | // Show the results:
|
---|
| 132 | //infoBox('Lapsed time (milliseconds) = ' + diffDisplay + '.', disclaimer, MB_OK); <-- original line. //kt 8/7/2007
|
---|
| 133 | infoBox(DKLangConstW('fxBroker_Lapsed_time_xmillisecondsx_x') + diffDisplay + '.', disclaimer, MB_OK); //kt added 8/7/2007
|
---|
| 134 |
|
---|
| 135 | end;
|
---|
| 136 |
|
---|
| 137 | end.
|
---|