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 | btnClear: TBitBtn;
|
---|
24 | procedure cmdPrevClick(Sender: TObject);
|
---|
25 | procedure cmdNextClick(Sender: TObject);
|
---|
26 | procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
---|
27 | procedure FormResize(Sender: TObject);
|
---|
28 | procedure FormCreate(Sender: TObject);
|
---|
29 | procedure FormKeyUp(Sender: TObject; var Key: Word;
|
---|
30 | Shift: TShiftState);
|
---|
31 | procedure btnRLTClick(Sender: TObject);
|
---|
32 | procedure btnClearClick(Sender: TObject);
|
---|
33 | private
|
---|
34 | { Private declarations }
|
---|
35 | FRetained: Integer;
|
---|
36 | FCurrent: Integer;
|
---|
37 | public
|
---|
38 | { Public declarations }
|
---|
39 | end;
|
---|
40 |
|
---|
41 | procedure ShowBroker;
|
---|
42 |
|
---|
43 | implementation
|
---|
44 |
|
---|
45 | {$R *.DFM}
|
---|
46 |
|
---|
47 | procedure ShowBroker;
|
---|
48 | var
|
---|
49 | frmBroker: TfrmBroker;
|
---|
50 | begin
|
---|
51 | frmBroker := TfrmBroker.Create(Application);
|
---|
52 | try
|
---|
53 | ResizeAnchoredFormToFont(frmBroker);
|
---|
54 | with frmBroker do
|
---|
55 | begin
|
---|
56 | FRetained := RetainedRPCCount - 1;
|
---|
57 | FCurrent := FRetained;
|
---|
58 | LoadRPCData(memData.Lines, FCurrent);
|
---|
59 | memData.SelStart := 0;
|
---|
60 | // lblCallID.Caption := 'Last Call Minus: ' + IntToStr(FRetained - FCurrent); <-- original line. //kt 8/7/2007
|
---|
61 | lblCallID.Caption := DKLangConstW('fxBroker_Last_Call_Minusx') + IntToStr(FRetained - FCurrent); //kt added 8/7/2007
|
---|
62 | ShowModal;
|
---|
63 | end;
|
---|
64 | finally
|
---|
65 | frmBroker.Release;
|
---|
66 | end;
|
---|
67 | end;
|
---|
68 |
|
---|
69 | procedure TfrmBroker.cmdPrevClick(Sender: TObject);
|
---|
70 | begin
|
---|
71 | FCurrent := HigherOf(FCurrent - 1, 0);
|
---|
72 | LoadRPCData(memData.Lines, FCurrent);
|
---|
73 | memData.SelStart := 0;
|
---|
74 | //lblCallID.Caption := 'Last Call Minus: ' + IntToStr(FRetained - FCurrent); <-- original line. //kt 8/7/2007
|
---|
75 | lblCallID.Caption := DKLangConstW('fxBroker_Last_Call_Minusx') + IntToStr(FRetained - FCurrent); //kt added 8/7/2007
|
---|
76 | end;
|
---|
77 |
|
---|
78 | procedure TfrmBroker.cmdNextClick(Sender: TObject);
|
---|
79 | begin
|
---|
80 | FCurrent := LowerOf(FCurrent + 1, FRetained);
|
---|
81 | LoadRPCData(memData.Lines, FCurrent);
|
---|
82 | memData.SelStart := 0;
|
---|
83 | //lblCallID.Caption := 'Last Call Minus: ' + IntToStr(FRetained - FCurrent); <-- original line. //kt 8/7/2007
|
---|
84 | lblCallID.Caption := DKLangConstW('fxBroker_Last_Call_Minusx') + IntToStr(FRetained - FCurrent); //kt added 8/7/2007
|
---|
85 | end;
|
---|
86 |
|
---|
87 | procedure TfrmBroker.FormClose(Sender: TObject; var Action: TCloseAction);
|
---|
88 | begin
|
---|
89 | SetRetainedRPCMax(StrToIntDef(txtMaxCalls.Text, 5))
|
---|
90 | end;
|
---|
91 |
|
---|
92 | procedure TfrmBroker.FormResize(Sender: TObject);
|
---|
93 | begin
|
---|
94 | Refresh;
|
---|
95 | end;
|
---|
96 |
|
---|
97 | procedure TfrmBroker.FormCreate(Sender: TObject);
|
---|
98 | begin
|
---|
99 | udMax.Position := GetRPCMax;
|
---|
100 | end;
|
---|
101 |
|
---|
102 | procedure TfrmBroker.FormKeyUp(Sender: TObject; var Key: Word;
|
---|
103 | Shift: TShiftState);
|
---|
104 | begin
|
---|
105 | if Key = VK_ESCAPE then
|
---|
106 | begin
|
---|
107 | Key := 0;
|
---|
108 | Close;
|
---|
109 | end;
|
---|
110 | end;
|
---|
111 |
|
---|
112 | procedure TfrmBroker.btnRLTClick(Sender: TObject);
|
---|
113 | var
|
---|
114 | startTime, endTime: tDateTime;
|
---|
115 | clientVer, serverVer, diffDisplay: string;
|
---|
116 | theDiff: integer;
|
---|
117 | disclaimer : string; //kt
|
---|
118 | const
|
---|
119 | TX_OPTION = 'OR CPRS GUI CHART';
|
---|
120 | //disclaimer = 'NOTE: Strictly relative indicator:'; <-- original line. //kt 8/7/2007
|
---|
121 | begin
|
---|
122 | disclaimer := DKLangConstW('fxBroker_NOTEx_Strictly_relative_indicatorx'); //kt added 8/7/2007
|
---|
123 |
|
---|
124 | clientVer := clientVersion(Application.ExeName); // Obtain before starting.
|
---|
125 |
|
---|
126 | // Check time lapse between a standard RPC call:
|
---|
127 | startTime := now;
|
---|
128 | serverVer := serverVersion(TX_OPTION, clientVer);
|
---|
129 | endTime := now;
|
---|
130 | theDiff := milliSecondsBetween(endTime, startTime);
|
---|
131 | diffDisplay := intToStr(theDiff);
|
---|
132 |
|
---|
133 | // Show the results:
|
---|
134 | //infoBox('Lapsed time (milliseconds) = ' + diffDisplay + '.', disclaimer, MB_OK); <-- original line. //kt 8/7/2007
|
---|
135 | infoBox(DKLangConstW('fxBroker_Lapsed_time_xmillisecondsx_x') + diffDisplay + '.', disclaimer, MB_OK); //kt added 8/7/2007
|
---|
136 |
|
---|
137 | end;
|
---|
138 |
|
---|
139 | procedure TfrmBroker.btnClearClick(Sender: TObject);
|
---|
140 | //kt added endtire function
|
---|
141 | begin
|
---|
142 | ORNet.RPCCallsClear;
|
---|
143 | FCurrent := 0;
|
---|
144 | FRetained := RetainedRPCCount - 1;
|
---|
145 | cmdNextClick(Sender);
|
---|
146 | end;
|
---|
147 |
|
---|
148 | end.
|
---|