| 1 | unit UFormMain;
|
|---|
| 2 |
|
|---|
| 3 | {$mode delphi}{$H+}
|
|---|
| 4 |
|
|---|
| 5 | interface
|
|---|
| 6 |
|
|---|
| 7 | uses
|
|---|
| 8 | Classes, SysUtils, Forms, Controls, Graphics, Dialogs, Menus, ComCtrls,
|
|---|
| 9 | ActnList, UDevice, fgl;
|
|---|
| 10 |
|
|---|
| 11 | type
|
|---|
| 12 |
|
|---|
| 13 | { TFormMain }
|
|---|
| 14 |
|
|---|
| 15 | TFormMain = class(TForm)
|
|---|
| 16 | ABridge: TAction;
|
|---|
| 17 | ARouterboard: TAction;
|
|---|
| 18 | ANewTerminal: TAction;
|
|---|
| 19 | AExit: TAction;
|
|---|
| 20 | AQueues: TAction;
|
|---|
| 21 | ASystem: TAction;
|
|---|
| 22 | ARouting: TAction;
|
|---|
| 23 | AIpv6: TAction;
|
|---|
| 24 | AMpls: TAction;
|
|---|
| 25 | AIp: TAction;
|
|---|
| 26 | AMesh: TAction;
|
|---|
| 27 | APpp: TAction;
|
|---|
| 28 | AWireless: TAction;
|
|---|
| 29 | AInterfaces: TAction;
|
|---|
| 30 | AQuickSet: TAction;
|
|---|
| 31 | ActionList1: TActionList;
|
|---|
| 32 | MenuItem1: TMenuItem;
|
|---|
| 33 | PopupMenuSystem: TPopupMenu;
|
|---|
| 34 | ToolBar1: TToolBar;
|
|---|
| 35 | ToolButton1: TToolButton;
|
|---|
| 36 | ToolButton10: TToolButton;
|
|---|
| 37 | ToolButton11: TToolButton;
|
|---|
| 38 | ToolButton12: TToolButton;
|
|---|
| 39 | ToolButton13: TToolButton;
|
|---|
| 40 | ToolButton14: TToolButton;
|
|---|
| 41 | ToolButton2: TToolButton;
|
|---|
| 42 | ToolButton3: TToolButton;
|
|---|
| 43 | ToolButton4: TToolButton;
|
|---|
| 44 | ToolButton5: TToolButton;
|
|---|
| 45 | ToolButton6: TToolButton;
|
|---|
| 46 | ToolButton7: TToolButton;
|
|---|
| 47 | ToolButton8: TToolButton;
|
|---|
| 48 | ToolButton9: TToolButton;
|
|---|
| 49 | procedure AExitExecute(Sender: TObject);
|
|---|
| 50 | procedure ANewTerminalExecute(Sender: TObject);
|
|---|
| 51 | procedure ARouterboardExecute(Sender: TObject);
|
|---|
| 52 | procedure FormActivate(Sender: TObject);
|
|---|
| 53 | procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
|---|
| 54 | procedure FormCreate(Sender: TObject);
|
|---|
| 55 | procedure FormDestroy(Sender: TObject);
|
|---|
| 56 | procedure FormShow(Sender: TObject);
|
|---|
| 57 | private
|
|---|
| 58 | Initialized: Boolean;
|
|---|
| 59 | public
|
|---|
| 60 | Device: TDevice;
|
|---|
| 61 | ChildWindows: TFPGObjectList<TForm>;
|
|---|
| 62 | end;
|
|---|
| 63 |
|
|---|
| 64 | var
|
|---|
| 65 | FormMain: TFormMain;
|
|---|
| 66 |
|
|---|
| 67 |
|
|---|
| 68 | implementation
|
|---|
| 69 |
|
|---|
| 70 | {$R *.lfm}
|
|---|
| 71 |
|
|---|
| 72 | uses
|
|---|
| 73 | UFormLogin, UFormTerminal, UFormRouterboard, URouterOS, ULinux;
|
|---|
| 74 |
|
|---|
| 75 | { TFormMain }
|
|---|
| 76 |
|
|---|
| 77 | procedure TFormMain.AExitExecute(Sender: TObject);
|
|---|
| 78 | begin
|
|---|
| 79 | Close;
|
|---|
| 80 | end;
|
|---|
| 81 |
|
|---|
| 82 | procedure TFormMain.ANewTerminalExecute(Sender: TObject);
|
|---|
| 83 | begin
|
|---|
| 84 | FormTerminal := TFormTerminal.Create(nil);
|
|---|
| 85 | FormTerminal.Terminal.Device := Device;
|
|---|
| 86 | FormTerminal.Show;
|
|---|
| 87 | FormTerminal.BringToFront;
|
|---|
| 88 | ChildWindows.Add(FormTerminal);
|
|---|
| 89 | end;
|
|---|
| 90 |
|
|---|
| 91 | procedure TFormMain.ARouterboardExecute(Sender: TObject);
|
|---|
| 92 | begin
|
|---|
| 93 | FormRouterboard := TFormRouterboard.Create(nil);
|
|---|
| 94 | FormRouterboard.Show;
|
|---|
| 95 | ChildWindows.Add(FormTerminal);
|
|---|
| 96 | end;
|
|---|
| 97 |
|
|---|
| 98 | procedure TFormMain.FormActivate(Sender: TObject);
|
|---|
| 99 | begin
|
|---|
| 100 | if not Initialized then begin
|
|---|
| 101 | Initialized := True;
|
|---|
| 102 | ANewTerminal.Execute;
|
|---|
| 103 | end;
|
|---|
| 104 | end;
|
|---|
| 105 |
|
|---|
| 106 | procedure TFormMain.FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
|---|
| 107 | begin
|
|---|
| 108 | FormLogin.Show;
|
|---|
| 109 | FormLogin.BringToFront;
|
|---|
| 110 | end;
|
|---|
| 111 |
|
|---|
| 112 | procedure TFormMain.FormCreate(Sender: TObject);
|
|---|
| 113 | begin
|
|---|
| 114 | ChildWindows := TFPGObjectList<TForm>.Create;
|
|---|
| 115 | Device := TRouterOS.Create;
|
|---|
| 116 | //Device := TLinux.Create;
|
|---|
| 117 | end;
|
|---|
| 118 |
|
|---|
| 119 | procedure TFormMain.FormDestroy(Sender: TObject);
|
|---|
| 120 | begin
|
|---|
| 121 | FreeAndNil(ChildWindows);
|
|---|
| 122 | FreeAndNil(Device);
|
|---|
| 123 | end;
|
|---|
| 124 |
|
|---|
| 125 | procedure TFormMain.FormShow(Sender: TObject);
|
|---|
| 126 | begin
|
|---|
| 127 | end;
|
|---|
| 128 |
|
|---|
| 129 | end.
|
|---|
| 130 |
|
|---|