Changeset 6 for trunk/Forms/UFormTables.pas
- Timestamp:
- Jan 20, 2015, 12:31:24 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormTables.pas
r4 r6 11 11 type 12 12 13 { TForm Main}13 { TFormTables } 14 14 15 TForm Main= class(TForm)15 TFormTables = class(TForm) 16 16 AAdd: TAction; 17 17 AShowFields: TAction; … … 53 53 54 54 var 55 Form Main: TFormMain;55 FormTables: TFormTables; 56 56 57 57 implementation … … 62 62 {$R *.lfm} 63 63 64 { TForm Main}64 { TFormTables } 65 65 66 procedure TForm Main.ListView1Data(Sender: TObject; Item: TListItem);66 procedure TFormTables.ListView1Data(Sender: TObject; Item: TListItem); 67 67 begin 68 68 if (Item.Index >= 0) and (Item.Index < Database.Tables.Count) then … … 74 74 end; 75 75 76 procedure TForm Main.ListView1SelectItem(Sender: TObject; Item: TListItem;76 procedure TFormTables.ListView1SelectItem(Sender: TObject; Item: TListItem; 77 77 Selected: Boolean); 78 78 begin … … 80 80 end; 81 81 82 procedure TForm Main.UpdateInterface;82 procedure TFormTables.UpdateInterface; 83 83 begin 84 84 AModify.Enabled := Assigned(ListView1.Selected); … … 88 88 end; 89 89 90 procedure TForm Main.AAddExecute(Sender: TObject);90 procedure TFormTables.AAddExecute(Sender: TObject); 91 91 var 92 92 NewTable: TTable; … … 102 102 end; 103 103 104 procedure TForm Main.AModifyExecute(Sender: TObject);104 procedure TFormTables.AModifyExecute(Sender: TObject); 105 105 begin 106 106 if Assigned(ListView1.Selected) then begin … … 113 113 end; 114 114 115 procedure TForm Main.ARemoveExecute(Sender: TObject);115 procedure TFormTables.ARemoveExecute(Sender: TObject); 116 116 begin 117 117 if Assigned(ListView1.Selected) then begin … … 124 124 end; 125 125 126 procedure TForm Main.AShowFieldsExecute(Sender: TObject);126 procedure TFormTables.AShowFieldsExecute(Sender: TObject); 127 127 var 128 128 NewRecords: TRecords; … … 166 166 end; 167 167 168 procedure TForm Main.AShowRecordsExecute(Sender: TObject);168 procedure TFormTables.AShowRecordsExecute(Sender: TObject); 169 169 begin 170 170 if Assigned(ListView1.Selected) then begin … … 175 175 end; 176 176 177 procedure TForm Main.FormActivate(Sender: TObject);177 procedure TFormTables.FormActivate(Sender: TObject); 178 178 begin 179 Core.Init;180 179 end; 181 180 182 procedure TForm Main.FormClose(Sender: TObject; var CloseAction: TCloseAction);181 procedure TFormTables.FormClose(Sender: TObject; var CloseAction: TCloseAction); 183 182 begin 184 Core.Done;183 Database.Save; 185 184 end; 186 185 187 procedure TForm Main.FormShow(Sender: TObject);186 procedure TFormTables.FormShow(Sender: TObject); 188 187 begin 189 Database := Core.Database;190 188 ReloadList; 191 189 end; 192 190 193 procedure TForm Main.ReloadList;191 procedure TFormTables.ReloadList; 194 192 begin 195 193 ListView1.Items.Count := Database.Tables.Count; 196 194 ListView1.Repaint; 197 FormMain.UpdateInterface;195 UpdateInterface; 198 196 end; 199 197
Note:
See TracChangeset
for help on using the changeset viewer.