[830] | 1 | unit fIVRoutes;
|
---|
| 2 |
|
---|
| 3 | interface
|
---|
| 4 |
|
---|
| 5 | uses
|
---|
| 6 | Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
---|
| 7 | Dialogs, StdCtrls, ORCtrls, ExtCtrls, ORFn, rMisc, rODMeds, VA508AccessibilityManager, VAUtils, fAutoSz;
|
---|
| 8 |
|
---|
| 9 | type
|
---|
| 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 |
|
---|
| 27 | function ShowOtherRoutes(var Route: string): boolean;
|
---|
| 28 |
|
---|
| 29 | var
|
---|
| 30 | frmIVRoutes: TfrmIVRoutes;
|
---|
| 31 |
|
---|
| 32 | implementation
|
---|
| 33 |
|
---|
| 34 | {$R *.dfm}
|
---|
| 35 | function ShowOtherRoutes(var Route: string): boolean;
|
---|
| 36 | var
|
---|
| 37 | idx: integer;
|
---|
| 38 | begin
|
---|
| 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;
|
---|
| 56 | end;
|
---|
| 57 | { TfrmIVRoutes }
|
---|
| 58 |
|
---|
| 59 | procedure TfrmIVRoutes.btnCancelClick(Sender: TObject);
|
---|
| 60 | begin
|
---|
| 61 | frmIVRoutes.cboAllIVRoutes.ItemIndex := -1;
|
---|
| 62 | modalResult := mrOK;
|
---|
| 63 | end;
|
---|
| 64 |
|
---|
| 65 | procedure TfrmIVRoutes.BtnOKClick(Sender: TObject);
|
---|
| 66 | begin
|
---|
| 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;
|
---|
| 73 | end;
|
---|
| 74 |
|
---|
| 75 |
|
---|
| 76 | procedure TfrmIVRoutes.FormCreate(Sender: TObject);
|
---|
| 77 | begin
|
---|
| 78 | frmIVRoutes := nil;
|
---|
| 79 | LoadAllIVRoutes(cboAllIVRoutes.Items);
|
---|
| 80 | end;
|
---|
| 81 |
|
---|
| 82 | procedure TfrmIVRoutes.FormDestroy(Sender: TObject);
|
---|
| 83 | begin
|
---|
| 84 | inherited;
|
---|
| 85 | frmIVRoutes := nil;
|
---|
| 86 | end;
|
---|
| 87 |
|
---|
| 88 | end.
|
---|