source: cprs/trunk/CPRS-Chart/Orders/fIVRoutes.pas@ 924

Last change on this file since 924 was 830, checked in by Kevin Toppenberg, 14 years ago

Upgrading to version 27

File size: 2.1 KB
Line 
1unit fIVRoutes;
2
3interface
4
5uses
6 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
7 Dialogs, StdCtrls, ORCtrls, ExtCtrls, ORFn, rMisc, rODMeds, VA508AccessibilityManager, VAUtils, fAutoSz;
8
9type
10 TfrmIVRoutes = class(TfrmAutoSz)
11 pnlTop: TPanel;
12 cboAllIVRoutes: TORComboBox;
13 pnlBottom: TORAutoPanel;
14 BtnOK: TButton;
15 btnCancel: TButton;
16 procedure BtnOKClick(Sender: TObject);
17 procedure btnCancelClick(Sender: TObject);
18 procedure FormCreate(Sender: TObject);
19 procedure FormDestroy(Sender: TObject);
20 private
21 { Private declarations }
22
23 public
24 { Public declarations }
25 end;
26
27function ShowOtherRoutes(var Route: string): boolean;
28
29var
30 frmIVRoutes: TfrmIVRoutes;
31
32implementation
33
34{$R *.dfm}
35function ShowOtherRoutes(var Route: string): boolean;
36var
37idx: integer;
38begin
39 Result := false;
40 frmIVRoutes := TfrmIVRoutes.Create(Application);
41 ResizeFormToFont(TForm(frmIVRoutes));
42 SetFormPosition(frmIVRoutes);
43 //LoadAllIVRoutes(frmIVRoutes.cboAllIVRoutes.Items);
44 if frmIVRoutes.ShowModal = mrOK then
45 begin
46 idx := frmIVRoutes.cboAllIVRoutes.ItemIndex;
47 if idx > -1 then
48 begin
49 Route := frmIVRoutes.cboAllIVRoutes.Items.Strings[idx];
50 setPiece(Route,U,5,'1');
51 end
52 else Route := '';
53 Result := True;
54 end;
55 frmIVRoutes.Free;
56end;
57{ TfrmIVRoutes }
58
59procedure TfrmIVRoutes.btnCancelClick(Sender: TObject);
60begin
61 frmIVRoutes.cboAllIVRoutes.ItemIndex := -1;
62 modalResult := mrOK;
63end;
64
65procedure TfrmIVRoutes.BtnOKClick(Sender: TObject);
66begin
67 if frmIVRoutes.cboAllIVRoutes.ItemIndex = -1 then
68 begin
69 infoBox('A route from the list must be selected','Warning', MB_OK);
70 Exit;
71 end;
72 modalResult := mrOK;
73end;
74
75
76procedure TfrmIVRoutes.FormCreate(Sender: TObject);
77begin
78 frmIVRoutes := nil;
79 LoadAllIVRoutes(cboAllIVRoutes.Items);
80end;
81
82procedure TfrmIVRoutes.FormDestroy(Sender: TObject);
83begin
84 inherited;
85 frmIVRoutes := nil;
86end;
87
88end.
Note: See TracBrowser for help on using the repository browser.