Changeset 6 for trunk/Forms


Ignore:
Timestamp:
Jan 20, 2015, 12:31:24 AM (10 years ago)
Author:
chronos
Message:
  • Added: Allow to create multiple database connections and set their parmaters.
  • Added: Defined database engines to support various database backends. Each supports different set of field data types.
Location:
trunk/Forms
Files:
6 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormRecord.lfm

    r5 r6  
    1919    Align = alTop
    2020    BorderSpacing.Around = 4
     21    BevelOuter = bvNone
    2122    TabOrder = 0
    2223  end
  • trunk/Forms/UFormTables.lfm

    r4 r6  
    1 object FormMain: TFormMain
    2   Left = 644
     1object FormTables: TFormTables
     2  Left = 659
    33  Height = 660
    4   Top = 420
     4  Top = 342
    55  Width = 978
    6   Caption = 'MyData'
     6  Caption = 'Tables'
    77  ClientHeight = 660
    88  ClientWidth = 978
  • trunk/Forms/UFormTables.pas

    r4 r6  
    1111type
    1212
    13   { TFormMain }
     13  { TFormTables }
    1414
    15   TFormMain = class(TForm)
     15  TFormTables = class(TForm)
    1616    AAdd: TAction;
    1717    AShowFields: TAction;
     
    5353
    5454var
    55   FormMain: TFormMain;
     55  FormTables: TFormTables;
    5656
    5757implementation
     
    6262{$R *.lfm}
    6363
    64 { TFormMain }
     64{ TFormTables }
    6565
    66 procedure TFormMain.ListView1Data(Sender: TObject; Item: TListItem);
     66procedure TFormTables.ListView1Data(Sender: TObject; Item: TListItem);
    6767begin
    6868  if (Item.Index >= 0) and (Item.Index < Database.Tables.Count) then
     
    7474end;
    7575
    76 procedure TFormMain.ListView1SelectItem(Sender: TObject; Item: TListItem;
     76procedure TFormTables.ListView1SelectItem(Sender: TObject; Item: TListItem;
    7777  Selected: Boolean);
    7878begin
     
    8080end;
    8181
    82 procedure TFormMain.UpdateInterface;
     82procedure TFormTables.UpdateInterface;
    8383begin
    8484  AModify.Enabled := Assigned(ListView1.Selected);
     
    8888end;
    8989
    90 procedure TFormMain.AAddExecute(Sender: TObject);
     90procedure TFormTables.AAddExecute(Sender: TObject);
    9191var
    9292  NewTable: TTable;
     
    102102end;
    103103
    104 procedure TFormMain.AModifyExecute(Sender: TObject);
     104procedure TFormTables.AModifyExecute(Sender: TObject);
    105105begin
    106106  if Assigned(ListView1.Selected) then begin
     
    113113end;
    114114
    115 procedure TFormMain.ARemoveExecute(Sender: TObject);
     115procedure TFormTables.ARemoveExecute(Sender: TObject);
    116116begin
    117117  if Assigned(ListView1.Selected) then begin
     
    124124end;
    125125
    126 procedure TFormMain.AShowFieldsExecute(Sender: TObject);
     126procedure TFormTables.AShowFieldsExecute(Sender: TObject);
    127127var
    128128  NewRecords: TRecords;
     
    166166end;
    167167
    168 procedure TFormMain.AShowRecordsExecute(Sender: TObject);
     168procedure TFormTables.AShowRecordsExecute(Sender: TObject);
    169169begin
    170170  if Assigned(ListView1.Selected) then begin
     
    175175end;
    176176
    177 procedure TFormMain.FormActivate(Sender: TObject);
     177procedure TFormTables.FormActivate(Sender: TObject);
    178178begin
    179   Core.Init;
    180179end;
    181180
    182 procedure TFormMain.FormClose(Sender: TObject; var CloseAction: TCloseAction);
     181procedure TFormTables.FormClose(Sender: TObject; var CloseAction: TCloseAction);
    183182begin
    184   Core.Done;
     183  Database.Save;
    185184end;
    186185
    187 procedure TFormMain.FormShow(Sender: TObject);
     186procedure TFormTables.FormShow(Sender: TObject);
    188187begin
    189   Database := Core.Database;
    190188  ReloadList;
    191189end;
    192190
    193 procedure TFormMain.ReloadList;
     191procedure TFormTables.ReloadList;
    194192begin
    195193  ListView1.Items.Count := Database.Tables.Count;
    196194  ListView1.Repaint;
    197   FormMain.UpdateInterface;
     195  UpdateInterface;
    198196end;
    199197
Note: See TracChangeset for help on using the changeset viewer.