source: cprs/branches/tmg-cprs/CPRS-Chart/fxBroker.pas@ 479

Last change on this file since 479 was 453, checked in by Kevin Toppenberg, 16 years ago

Initial upload of TMG-CPRS 1.0.26.69

File size: 4.1 KB
Line 
1//kt -- Modified with SourceScanner on 8/7/2007
2unit fxBroker;
3
4interface
5
6uses
7 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
8 StdCtrls, DateUtils, ORNet, ORFn, rMisc, ComCtrls, Buttons, ExtCtrls,
9 ORCtrls, ORSystem, DKLang;
10
11type
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
39procedure ShowBroker;
40
41implementation
42
43{$R *.DFM}
44
45procedure ShowBroker;
46var
47 frmBroker: TfrmBroker;
48begin
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;
65end;
66
67procedure TfrmBroker.cmdPrevClick(Sender: TObject);
68begin
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
74end;
75
76procedure TfrmBroker.cmdNextClick(Sender: TObject);
77begin
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
83end;
84
85procedure TfrmBroker.FormClose(Sender: TObject; var Action: TCloseAction);
86begin
87 SetRetainedRPCMax(StrToIntDef(txtMaxCalls.Text, 5))
88end;
89
90procedure TfrmBroker.FormResize(Sender: TObject);
91begin
92 Refresh;
93end;
94
95procedure TfrmBroker.FormCreate(Sender: TObject);
96begin
97 udMax.Position := GetRPCMax;
98end;
99
100procedure TfrmBroker.FormKeyUp(Sender: TObject; var Key: Word;
101 Shift: TShiftState);
102begin
103 if Key = VK_ESCAPE then
104 begin
105 Key := 0;
106 Close;
107 end;
108end;
109
110procedure TfrmBroker.btnRLTClick(Sender: TObject);
111var
112 startTime, endTime: tDateTime;
113 clientVer, serverVer, diffDisplay: string;
114 theDiff: integer;
115 disclaimer : string; //kt
116const
117 TX_OPTION = 'OR CPRS GUI CHART';
118//disclaimer = 'NOTE: Strictly relative indicator:'; <-- original line. //kt 8/7/2007
119begin
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
135end;
136
137end.
Note: See TracBrowser for help on using the repository browser.