Changeset 9


Ignore:
Timestamp:
Dec 26, 2010, 8:12:59 PM (13 years ago)
Author:
george
Message:
  • Modified: Non-visual functions moved to USystem unit.
  • Modified: Loading of object, properties and values rebuilded to general structures.
Location:
trunk
Files:
1 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        22Config.xml
        33chronis
         4heaptrclog.trc
  • trunk/Forms/UItemAdd.lfm

    r7 r9  
    44  Top = 130
    55  Width = 567
     6  ActiveControl = Panel1
    67  Caption = 'Add item'
    78  ClientHeight = 421
    89  ClientWidth = 567
    910  OnClose = FormClose
     11  OnCreate = FormCreate
     12  OnDestroy = FormDestroy
    1013  OnShow = FormShow
    1114  LCLVersion = '0.9.29'
  • trunk/Forms/UItemAdd.pas

    r7 r9  
    11unit UItemAdd;
    22
    3 {$mode objfpc}{$H+}
     3{$mode Delphi}{$H+}
    44
    55interface
     
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
    9    StdCtrls, Spin, EditBtn, MaskEdit, USqlDatabase;
     9   StdCtrls, Spin, EditBtn, MaskEdit, USqlDatabase, USystem;
    1010
    1111type
     
    2020    procedure ButtonSaveClick(Sender: TObject);
    2121    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     22    procedure FormCreate(Sender: TObject);
     23    procedure FormDestroy(Sender: TObject);
    2224    procedure FormShow(Sender: TObject);
    2325  private
     
    2527    { private declarations }
    2628  public
    27     { public declarations }
     29    Report: TReport;
    2830  end;
    2931
     
    5658end;
    5759
     60procedure TItemAddForm.FormCreate(Sender: TObject);
     61begin
     62  Report := TReport.Create;
     63  Report.Base := MainForm.System;
     64end;
     65
     66procedure TItemAddForm.FormDestroy(Sender: TObject);
     67begin
     68  Report.Free;
     69end;
     70
    5871procedure TItemAddForm.FormShow(Sender: TObject);
    5972begin
     
    6477procedure TItemAddForm.BuildControls;
    6578var
    66   Properties: TDbRows;
    67   Values: TDbRows;
    6879  NewControl: TControl;
    6980  LastTop: Integer;
    7081  I: Integer;
    7182  Column: Integer;
    72   ObjectInfo: TDbRows;
    7383  ValueType: Integer;
    7484const
     
    7787  LastTop := 8;
    7888  Column := 0;
    79   try
    80   ObjectInfo := TDbRows.Create;
    81   MainForm.Database.Query(ObjectInfo, 'SELECT * FROM `Object` WHERE `Id`=' + IntToStr(MainForm.SelectedObject));
    82   if ObjectInfo.Count = 1 then begin
    8389
    84     for I := Panel1.ControlCount - 1 downto 0 do
    85       Panel1.Controls[I].Free;
     90  for I := Panel1.ControlCount - 1 downto 0 do
     91    Panel1.Controls[I].Free;
    8692
    87     // Load column names
    88     try
    89     Properties := TDbRows.Create;
    90     MainForm.Database.Query(Properties, 'SELECT * FROM `Property` WHERE `Object`=' +
    91       IntToStr(MainForm.SelectedObject));
    92     for I := 0 to Properties.Count - 1 do begin
     93  Report.Load(MainForm.SelectedObject, MainForm.SelectedObject.PrimaryKey + ' = ' +
     94    IntToStr(MainForm.SelectedItem));
     95
     96  // Load column names
     97    for I := 0 to Report.Columns.Count - 1 do
     98    if TReportColumn(Report.Columns[I]).ColumnName <> 'Id' then begin
    9399      NewControl := TLabel.Create(Panel1);
    94100      NewControl.Parent := Panel1;
    95101      NewControl.Top := LastTop;
    96102      NewControl.Left := Column * Width div ColumnCount + 10;
    97       TLabel(NewControl).Caption := Properties[I].Values['Name'] + ':';
     103      TLabel(NewControl).Caption := TReportColumn(Report.Columns[I]).Caption + ':';
    98104
    99       ValueType := StrToInt(Properties[I].Values['Type']);
     105      ValueType := TReportColumn(Report.Columns[I]).TypeId;
    100106      if ValueType = Integer(vtInteger) then begin
    101107        NewControl := TSpinEdit.Create(Panel1);
     
    149155      if Column = 0 then LastTop := LastTop + NewControl.Height + 4;
    150156    end;
    151 
    152     finally
    153       Properties.Free;
    154     end;
    155   end else ShowMessage(SObjectNotFound);
    156   finally
    157     ObjectInfo.Free;
    158   end;
    159157end;
    160158
  • trunk/Forms/UItemEdit.lfm

    r7 r9  
    99  ClientWidth = 558
    1010  OnClose = FormClose
     11  OnCreate = FormCreate
     12  OnDestroy = FormDestroy
    1113  OnShow = FormShow
    1214  LCLVersion = '0.9.29'
  • trunk/Forms/UItemEdit.pas

    r7 r9  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
    9   StdCtrls, Spin, EditBtn, USqlDatabase, MaskEdit;
     9  StdCtrls, Spin, EditBtn, USqlDatabase, MaskEdit, USystem;
    1010
    1111type
     
    2020    procedure ButtonSaveClick(Sender: TObject);
    2121    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     22    procedure FormCreate(Sender: TObject);
     23    procedure FormDestroy(Sender: TObject);
    2224    procedure FormShow(Sender: TObject);
    2325  private
    2426    { private declarations }
    2527  public
     28    Report: TReport;
    2629    procedure BuildControls;
    2730  end;
     
    5760end;
    5861
     62procedure TItemEditForm.FormCreate(Sender: TObject);
     63begin
     64  Report := TReport.Create;
     65  Report.Base := MainForm.System;
     66end;
     67
     68procedure TItemEditForm.FormDestroy(Sender: TObject);
     69begin
     70  Report.Free;
     71end;
     72
    5973procedure TItemEditForm.FormShow(Sender: TObject);
    6074begin
     
    6579procedure TItemEditForm.BuildControls;
    6680var
    67   Properties: TDbRows;
    6881  Values: TDbRows;
    6982  NewControl: TControl;
     
    7184  I: Integer;
    7285  Column: Integer;
    73   ObjectInfo: TDbRows;
    7486  ValueType: Integer;
    7587const
     
    7890  LastTop := 8;
    7991  Column := 0;
    80   try
    81   ObjectInfo := TDbRows.Create;
    82   MainForm.Database.Query(ObjectInfo, 'SELECT * FROM `Object` WHERE `Id`=' + IntToStr(MainForm.SelectedObject));
    83   if ObjectInfo.Count = 1 then begin
     92  Report.Load(MainForm.SelectedObject, MainForm.SelectedObject.PrimaryKey + ' = ' +
     93    IntToStr(MainForm.SelectedItem));
    8494
    85     for I := Panel1.ControlCount - 1 downto 0 do
    86       Panel1.Controls[I].Free;
     95  for I := Panel1.ControlCount - 1 downto 0 do
     96    Panel1.Controls[I].Free;
    8797
    88     // Load column names
    89     try
    90     Properties := TDbRows.Create;
    91     MainForm.Database.Query(Properties, 'SELECT * FROM `Property` WHERE `Object`=' +
    92       IntToStr(MainForm.SelectedObject));
    93     Values := TDbRows.Create;
    94     MainForm.Database.Query(Values, 'SELECT * FROM `' + ObjectInfo[0].Values['Schema'] + '`.`' +
    95       ObjectInfo[0].Values['Table'] + '` WHERE ' + ObjectInfo[0].Values['PrimaryKey'] + ' = ' +
    96       IntToStr(MainForm.SelectedItem));
    97     if Values.Count = 1 then
    98     for I := 0 to Properties.Count - 1 do begin
     98  if Report.Count = 1 then
     99    for I := 0 to Report.Columns.Count - 1 do
     100    if TReportColumn(Report.Columns[I]).ColumnName <> 'Id' then begin
     101
    99102      NewControl := TLabel.Create(Panel1);
    100103      NewControl.Parent := Panel1;
    101104      NewControl.Top := LastTop;
    102105      NewControl.Left := Column * Width div ColumnCount + 10;
    103       TLabel(NewControl).Caption := Properties[I].Values['Name'] + ':';
     106      TLabel(NewControl).Caption := TReportColumn(Report.Columns[I]).Caption + ':';
    104107
    105       ValueType := StrToInt(Properties[I].Values['Type']);
     108      ValueType := TReportColumn(Report.Columns[I]).TypeId;
    106109      if ValueType = Integer(vtInteger) then begin
    107110        NewControl := TSpinEdit.Create(Panel1);
     
    109112        NewControl.Top := LastTop;
    110113        NewControl.Left := Column * Width div ColumnCount + (Width div ColumnCount) div 2;
    111         TSpinEdit(NewControl).Value := StrToInt(Values[0].Values[Properties[I].Values['ColumnName']]);
     114        TSpinEdit(NewControl).Value := StrToInt(TReportLine(Report[0]).Items[I]);
    112115        TSpinEdit(NewControl).Width := (Width div ColumnCount) div 2 - 20;
    113116      end else
     
    117120        NewControl.Top := LastTop;
    118121        NewControl.Left := Column * Width div ColumnCount + (Width div ColumnCount) div 2;
    119         TDateEdit(NewControl).Date := StrToDate(Values[0].Values[Properties[I].Values['ColumnName']]);
     122        TDateEdit(NewControl).Date := StrToDate(TReportLine(Report[0]).Items[I]);
    120123        TDateEdit(NewControl).Width := (Width div ColumnCount) div 2 - 20;
    121124      end else
     
    125128        NewControl.Top := LastTop;
    126129        NewControl.Left := Column * Width div ColumnCount + (Width div ColumnCount) div 2;
    127         TFloatSpinEdit(NewControl).Value := StrToFloat(Values[0].Values[Properties[I].Values['ColumnName']]);
     130        TFloatSpinEdit(NewControl).Value := StrToFloat(TReportLine(Report[0]).Items[I]);
    128131        TFloatSpinEdit(NewControl).Width := (Width div ColumnCount) div 2 - 20;
    129132      end else
     
    133136        NewControl.Top := LastTop;
    134137        NewControl.Left := Column * Width div ColumnCount + (Width div ColumnCount) div 2;
    135         TEdit(NewControl).Text := Values[0].Values[Properties[I].Values['ColumnName']];
     138        TEdit(NewControl).Text := TReportLine(Report[0]).Items[I];
    136139        TEdit(NewControl).Width := (Width div ColumnCount) div 2 - 20;
    137140      end else
     
    148151        NewControl.Top := LastTop;
    149152        NewControl.Left := Column * Width div ColumnCount + (Width div ColumnCount) div 2;
    150         TCheckBox(NewControl).Checked := Boolean(StrToInt(Values[0].Values[Properties[I].Values['ColumnName']]));
     153        TCheckBox(NewControl).Checked := Boolean(StrToInt(TReportLine(Report[0]).Items[I]));
    151154      end else begin
    152155        NewControl := TEdit.Create(Panel1);
     
    155158        NewControl.Left := Column * Width div ColumnCount + (Width div ColumnCount) div 2;
    156159        TEdit(NewControl).Width := (Width div ColumnCount) div 2 - 20;
    157         TEdit(NewControl).Text := Values[0].Values[Properties[I].Values['ColumnName']];
     160        TEdit(NewControl).Text := TReportLine(Report[0]).Items[I];
    158161      end;
    159162
    160163      Column := (Column + 1) mod 2;
    161164      if Column = 0 then LastTop := LastTop + NewControl.Height + 4;
    162     end else ShowMessage(SItemNotFound);
    163     finally
    164       Values.Free;
    165       Properties.Free;
    166     end;
    167   end else ShowMessage(SObjectNotFound);
    168   finally
    169     ObjectInfo.Free;
    170   end;
     165   end;
    171166end;
    172167
  • trunk/Forms/UItemView.lfm

    r7 r9  
    11object ItemViewForm: TItemViewForm
    2   Left = 337
    3   Height = 416
    4   Top = 135
    5   Width = 552
     2  Left = 311
     3  Height = 469
     4  Top = 110
     5  Width = 626
    66  Caption = 'View item'
    7   ClientHeight = 416
    8   ClientWidth = 552
     7  ClientHeight = 469
     8  ClientWidth = 626
    99  OnClose = FormClose
     10  OnCreate = FormCreate
     11  OnDestroy = FormDestroy
    1012  OnShow = FormShow
    1113  LCLVersion = '0.9.29'
    1214  object ButtonClose: TButton
    13     Left = 472
     15    Left = 546
    1416    Height = 25
    15     Top = 386
     17    Top = 439
    1618    Width = 75
    1719    Anchors = [akRight, akBottom]
     
    2022    TabOrder = 0
    2123  end
    22   object Panel1: TPanel
    23     Left = 0
    24     Height = 378
    25     Top = 0
    26     Width = 552
    27     Align = alTop
    28     Anchors = [akLeft, akRight, akBottom]
    29     BevelOuter = bvNone
    30     TabOrder = 1
    31   end
    3224  object ButtonEdit: TButton
    33     Left = 384
     25    Left = 458
    3426    Height = 25
    35     Top = 386
     27    Top = 439
    3628    Width = 75
    3729    Anchors = [akRight, akBottom]
    3830    Caption = 'Edit'
    3931    OnClick = ButtonEditClick
     32    TabOrder = 1
     33  end
     34  object Panel1: TPanel
     35    Left = 0
     36    Height = 433
     37    Top = 0
     38    Width = 626
     39    Align = alTop
     40    Anchors = [akTop, akLeft, akRight, akBottom]
     41    BevelOuter = bvNone
     42    ClientHeight = 433
     43    ClientWidth = 626
    4044    TabOrder = 2
     45    object Panel2: TPanel
     46      Left = 0
     47      Height = 200
     48      Top = 233
     49      Width = 626
     50      Align = alBottom
     51      BevelOuter = bvNone
     52      ClientHeight = 200
     53      ClientWidth = 626
     54      TabOrder = 0
     55      object TabControl1: TTabControl
     56        Left = 0
     57        Height = 32
     58        Top = 0
     59        Width = 626
     60        Align = alTop
     61        TabIndex = 0
     62        TabOrder = 0
     63        Tabs.Strings = (
     64          'Tab1'
     65          'Tab2'
     66          'Tab3'
     67        )
     68        TabStop = False
     69      end
     70      object ListView1: TListView
     71        Left = 0
     72        Height = 168
     73        Top = 32
     74        Width = 626
     75        Align = alClient
     76        Columns = <>
     77        TabOrder = 1
     78      end
     79    end
     80    object Splitter1: TSplitter
     81      Cursor = crVSplit
     82      Left = 0
     83      Height = 3
     84      Top = 230
     85      Width = 626
     86      Align = alBottom
     87      ResizeAnchor = akBottom
     88    end
     89    object PanelControls: TPanel
     90      Left = 0
     91      Height = 230
     92      Top = 0
     93      Width = 626
     94      Align = alClient
     95      Anchors = [akLeft, akRight, akBottom]
     96      BevelOuter = bvNone
     97      TabOrder = 2
     98    end
    4199  end
    42100end
  • trunk/Forms/UItemView.pas

    r7 r9  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   ExtCtrls, USqlDatabase;
     9  ExtCtrls, ComCtrls, USqlDatabase, USystem;
    1010
    1111type
     
    1616    ButtonClose: TButton;
    1717    ButtonEdit: TButton;
     18    ListView1: TListView;
    1819    Panel1: TPanel;
     20    Panel2: TPanel;
     21    PanelControls: TPanel;
     22    Splitter1: TSplitter;
     23    TabControl1: TTabControl;
    1924    procedure ButtonCancelClick(Sender: TObject);
    2025    procedure ButtonCloseClick(Sender: TObject);
    2126    procedure ButtonEditClick(Sender: TObject);
    2227    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     28    procedure FormCreate(Sender: TObject);
     29    procedure FormDestroy(Sender: TObject);
    2330    procedure FormShow(Sender: TObject);
    2431  private
    2532    { private declarations }
    2633  public
     34    Report: TReport;
    2735    procedure BuildControls;
    2836  end;
     
    4452begin
    4553  MainForm.PersistentForm.Save(Self);
     54end;
     55
     56procedure TItemViewForm.FormCreate(Sender: TObject);
     57begin
     58  Report := TReport.Create;
     59  Report.Base := MainForm.System;
     60end;
     61
     62procedure TItemViewForm.FormDestroy(Sender: TObject);
     63begin
     64  Report.Free;
    4665end;
    4766
     
    7089procedure TItemViewForm.BuildControls;
    7190var
    72   Properties: TDbRows;
    73   Values: TDbRows;
    7491  NewControl: TControl;
    7592  LastTop: Integer;
    7693  I: Integer;
    7794  Column: Integer;
    78   ObjectInfo: TDbRows;
    7995const
    8096  ColumnCount = 2;
     
    8298  LastTop := 8;
    8399  Column := 0;
    84   try
    85   ObjectInfo := TDbRows.Create;
    86   MainForm.Database.Query(ObjectInfo, 'SELECT * FROM `Object` WHERE `Id`=' + IntToStr(MainForm.SelectedObject));
    87   if ObjectInfo.Count = 1 then begin
     100  Report.Load(MainForm.SelectedObject, MainForm.SelectedObject.PrimaryKey + ' = ' +
     101    IntToStr(MainForm.SelectedItem));
     102  for I := PanelControls.ControlCount - 1 downto 0 do
     103    PanelControls.Controls[I].Free;
    88104
    89     for I := Panel1.ControlCount - 1 downto 0 do
    90       Panel1.Controls[I].Free;
     105  TabControl1.Tabs.Clear;
     106  // Load column names
    91107
    92     // Load column names
    93     try
    94     Properties := TDbRows.Create;
    95     MainForm.Database.Query(Properties, 'SELECT * FROM `Property` WHERE `Object`=' +
    96       IntToStr(MainForm.SelectedObject));
    97     Values := TDbRows.Create;
    98     MainForm.Database.Query(Values, 'SELECT * FROM `' + ObjectInfo[0].Values['Schema'] + '`.`' +
    99       ObjectInfo[0].Values['Table'] + '` WHERE ' + ObjectInfo[0].Values['PrimaryKey'] + ' = ' +
    100       IntToStr(MainForm.SelectedItem));
    101     if Values.Count = 1 then
    102     for I := 0 to Properties.Count - 1 do begin
    103       NewControl := TLabel.Create(Panel1);
    104       NewControl.Parent := Panel1;
    105       NewControl.Top := LastTop;
    106       NewControl.Left := Column * Width div ColumnCount + 10;
    107       TLabel(NewControl).Caption := Properties[I].Values['Name'] + ':';
     108  if Report.Count = 1 then
     109  for I := 0 to Report.Columns.Count - 1 do
     110  if TReportColumn(Report.Columns[I]).TypeId = 20 then begin
     111    TabControl1.Tabs.Add(TReportColumn(Report.Columns[I]).Caption);
     112  end else begin
     113    NewControl := TLabel.Create(PanelControls);
     114    NewControl.Parent := PanelControls;
     115    NewControl.Top := LastTop;
     116    NewControl.Left := Column * Width div ColumnCount + 10;
     117    TLabel(NewControl).Caption := TReportColumn(Report.Columns[I]).Caption + ':';
    108118
    109       NewControl := TLabel.Create(Panel1);
    110       NewControl.Parent := Panel1;
    111       NewControl.Top := LastTop;
    112       NewControl.Left := Column * Width div ColumnCount + (Width div ColumnCount) div 2;
    113       TLabel(NewControl).Caption := Values[0].Values[Properties[I].Values['ColumnName']];
     119    NewControl := TLabel.Create(PanelControls);
     120    NewControl.Parent := PanelControls;
     121    NewControl.Top := LastTop;
     122    NewControl.Left := Column * Width div ColumnCount + (Width div ColumnCount) div 2;
     123    TLabel(NewControl).Caption := TReportLine(Report[0]).Items[I];
    114124
    115       Column := (Column + 1) mod 2;
    116       if Column = 0 then LastTop := LastTop + NewControl.Height + 4;
    117     end else ShowMessage(SItemNotFound);
    118     finally
    119       Values.Free;
    120       Properties.Free;
    121     end;
    122   end else ShowMessage(SObjectNotFound);
    123   finally
    124     ObjectInfo.Free;
     125    Column := (Column + 1) mod 2;
     126    if Column = 0 then LastTop := LastTop + 24;
    125127  end;
     128  Panel2.Visible := TabControl1.Tabs.Count > 0;
    126129end;
    127130
  • trunk/Forms/UMainForm.lfm

    r8 r9  
    66  ActiveControl = Panel1
    77  Caption = 'ChronIS'
    8   ClientHeight = 422
     8  ClientHeight = 418
    99  ClientWidth = 649
    1010  Menu = MainMenu1
     
    1616  object Panel1: TPanel
    1717    Left = 0
    18     Height = 422
     18    Height = 418
    1919    Top = 0
    2020    Width = 184
    2121    Align = alLeft
    2222    BevelOuter = bvNone
    23     ClientHeight = 422
     23    ClientHeight = 418
    2424    ClientWidth = 184
    2525    TabOrder = 0
    2626    object Label1: TLabel
    2727      Left = 7
    28       Height = 14
     28      Height = 18
    2929      Top = 4
    30       Width = 44
     30      Width = 51
    3131      Caption = 'Groups:'
    3232      ParentColor = False
    3333    end
    3434    object TreeView1: TTreeView
    35       Left = 8
    36       Height = 398
     35      Left = 4
     36      Height = 394
    3737      Top = 19
    38       Width = 176
     38      Width = 180
    3939      Anchors = [akTop, akLeft, akRight, akBottom]
    40       DefaultItemHeight = 16
     40      DefaultItemHeight = 19
    4141      Images = ImageListActions
    4242      ReadOnly = True
     
    4848  object Panel2: TPanel
    4949    Left = 189
    50     Height = 422
     50    Height = 418
    5151    Top = 0
    5252    Width = 460
    5353    Align = alClient
    5454    BevelOuter = bvNone
    55     ClientHeight = 422
     55    ClientHeight = 418
    5656    ClientWidth = 460
    5757    TabOrder = 1
    5858    object Label2: TLabel
    59       Left = 11
    60       Height = 14
     59      Left = 2
     60      Height = 18
    6161      Top = 4
    62       Width = 46
     62      Width = 54
    6363      Caption = 'Reports:'
    6464      ParentColor = False
    6565    end
    6666    object ListView1: TListView
    67       Left = 3
    68       Height = 366
     67      Left = 2
     68      Height = 362
    6969      Top = 19
    70       Width = 450
     70      Width = 456
    7171      Anchors = [akTop, akLeft, akRight, akBottom]
    7272      Columns = <>
     
    8686      Left = 3
    8787      Height = 25
    88       Top = 393
     88      Top = 389
    8989      Width = 75
    9090      Action = AItemAdd
     
    9595      Left = 83
    9696      Height = 25
    97       Top = 393
     97      Top = 389
    9898      Width = 75
    9999      Action = AItemDelete
     
    104104  object Splitter1: TSplitter
    105105    Left = 184
    106     Height = 422
     106    Height = 418
    107107    Top = 0
    108108    Width = 5
  • trunk/Forms/UMainForm.pas

    r8 r9  
    66
    77uses
    8   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
     8  Registry, Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    99  StdCtrls, ActnList, Menus, ExtCtrls, USqlDatabase, DOM, XMLRead, XMLWrite,
    10   UPersistentForm, UTreeState, SpecializedList;
     10  UPersistentForm, UTreeState, SpecializedList, URegistry, USystem;
    1111
    1212const
     
    1414
    1515type
    16   TDbValueType = (vtNone, vtInteger, vtString, vtText, vtDateTime, vtFloat, vtImage, vtBoolean,
    17   vtIPv4, vtMAC, vtIPv6, vtFile, vtGPS, vtEnumeration, vtHyperlink, vtPassword,
    18   vtReference, vtDate, vtTime, vtColor);
    19 
    20   { TReportLine }
    21 
    22   TReportLine = class
    23     Id: Integer;
    24     Items: TListString;
    25     constructor Create;
    26     destructor Destroy; override;
    27   end;
    28 
    2916  { TMainForm }
    3017
     
    9683    OriginalWindowState: TWindowState;
    9784    ScreenBounds: TRect;
     85    RegistryKey: string;
     86    RegistryRootKey: HKEY;
    9887    procedure LoadConfiguration;
     88    procedure LoadFromRegistry;
     89    procedure SaveToRegistry;
    9990  public
    100     SelectedObject: Integer;
     91    SelectedObjectId: Integer;
     92    SelectedObject: TChronisObject;
    10193    SelectedItem: Integer;
    10294    PersistentForm: TPersistentForm;
    103     Database: TSQLDatabase;
    10495    TreeState: TTreeState;
    105     Report: TListObject;
     96    System: TChronisBase;
     97    Report: TReport;
    10698    procedure LoadTree;
    10799    procedure LoadItemList;
     
    121113uses
    122114  UItemView, UItemEdit, UItemAdd;
    123 
    124 { TReportLine }
    125 
    126 constructor TReportLine.Create;
    127 begin
    128   Items := TListString.Create;
    129 end;
    130 
    131 destructor TReportLine.Destroy;
    132 begin
    133   Items.Free;
    134   inherited Destroy;
    135 end;
    136115
    137116{$R *.lfm}
     
    157136        with ChildNodes[I3] do begin
    158137          if NodeName = 'hostname' then
    159             Database.HostName := TextContent;
     138            System.Database.HostName := TextContent;
    160139          if NodeName = 'schema' then
    161             Database.Database := TextContent;
     140            System.Database.Database := TextContent;
    162141          if NodeName = 'username' then
    163             Database.UserName := TextContent;
     142            System.Database.UserName := TextContent;
    164143          if NodeName = 'password' then
    165             Database.Password := TextContent;
     144            System.Database.Password := TextContent;
    166145        end;
    167146      end;
     
    172151end;
    173152
     153procedure TMainForm.LoadFromRegistry;
     154begin
     155  with TRegistryEx.Create do
     156  try
     157    RootKey := RegistryRootKey;
     158    OpenKey(RegistryKey, True);
     159    Panel1.Width := ReadIntegerWithDefault('GroupTreeWidth', 200);
     160  finally
     161    Free;
     162  end;
     163end;
     164
     165procedure TMainForm.SaveToRegistry;
     166begin
     167  with TRegistryEx.Create do
     168  try
     169    RootKey := RegistryRootKey;
     170    OpenKey(RegistryKey, True);
     171    WriteInteger('GroupTreeWidth', Panel1.Width);
     172  finally
     173    Free;
     174  end;
     175end;
     176
    174177procedure TMainForm.FormCreate(Sender: TObject);
    175178begin
    176   Database := TSqlDatabase.Create;
     179  System := TChronisBase.Create;
     180  System.Database := TSqlDatabase.Create;
    177181  LoadConfiguration;
    178   Database.Connect;
     182  System.Database.Connect;
    179183  TreeState := TTreeState.Create;
     184  Report := TReport.Create;
     185  Report.Base := System;
     186  SelectedObject := TChronisObject.Create;
     187  SelectedObject.Base := System;
     188  RegistryRootKey := HKEY_CURRENT_USER;
     189  RegistryKey := '\Software\Chronosoft\Chronis';
    180190  PersistentForm := TPersistentForm.Create;
    181   Report := TListObject.Create;
     191  PersistentForm.RegistryKey := RegistryKey;
    182192end;
    183193
     
    186196  Report.Free;
    187197  TreeState.Free;
    188   Database.Free;
    189198  PersistentForm.Free;
     199  System.Free;
    190200end;
    191201
     
    193203begin
    194204  PersistentForm.Save(Self);
     205  SaveToRegistry;
    195206end;
    196207
     
    208219begin
    209220  if Assigned(TreeView1.Selected) then begin
    210     SelectedObject := 9;
     221    SelectedObjectId := 9;
    211222    SelectedItem := Integer(TreeView1.Selected.Data);
    212223    ItemEditForm.Show;
     
    222233begin
    223234  if Assigned(TreeView1.Selected) then begin
    224     SelectedObject := 8;
     235    SelectedObjectId := 8;
    225236    SelectedItem := Integer(TreeView1.Selected.Data);
    226237    ItemEditForm.Show;
     
    274285  PersistentForm.Load(Self);
    275286  LoadTree;
     287  LoadFromRegistry;
    276288end;
    277289
     
    351363    try
    352364      DbRows := TDbRows.Create;
    353       Database.Query(DbRows, 'SELECT * FROM `ObjectGroup`');
     365      System.Database.Query(DbRows, 'SELECT * FROM `ObjectGroup`');
    354366      for I := 0 to DbRows.Count - 1 do begin
    355367        NewNode := AddChild(TopItem, DbRows[I].Values['Name']);
     
    359371        try
    360372          ObjectDbRows := TDbRows.Create;
    361           Database.Query(ObjectDbRows, 'SELECT * FROM `Object` WHERE `Group`=' + DbRows[I].Values['Id']);
     373          System.Database.Query(ObjectDbRows, 'SELECT * FROM `Object` WHERE `Group`=' + DbRows[I].Values['Id']);
    362374          for O := 0 to ObjectDbRows.Count - 1 do begin
    363375            NewObjectNode := AddChild(NewNode, ObjectDbRows[O].Values['Name']);
     
    380392procedure TMainForm.LoadItemList;
    381393var
    382   DbRows: TDbRows;
    383   Properties: TDbRows;
    384   Values: TDbRows;
     394  NewColumn: TListColumn;
    385395  I: Integer;
    386   C: Integer;
    387   NewItem: TReportLine;
    388   NewColumn: TListColumn;
    389 begin
    390   SelectedObject := 0;
     396begin
     397  SelectedObjectId := 0;
    391398  if Assigned(TreeView1.Selected) then
    392399  with ListView1 do begin
    393400    Visible := True;
    394     Report.Clear;
    395     try
    396     DbRows := TDbRows.Create;
    397     Database.Query(DbRows, 'SELECT * FROM `Object` WHERE `Id`=' + IntToStr(Integer(TreeView1.Selected.Data)));
    398     if DbRows.Count = 1 then begin
    399       SelectedObject := StrToInt(DbRows[0].Values['Id']);
    400 
    401       // Load column names
    402       try
    403         Properties := TDbRows.Create;
    404         Database.Query(Properties, 'SELECT * FROM `Property` WHERE `Object`=' +
    405           DbRows[0].Values['Id']);
    406         Columns.Clear;
    407         NewColumn := Columns.Add;
    408         NewColumn.Caption := 'Id';
    409         for I := 0 to Properties.Count - 1 do begin
    410           NewColumn := Columns.Add;
    411           NewColumn.Caption := Properties[I].Values['Name'];
    412         end;
    413 
    414         ListView1Resize(Self);
    415 
    416         // Load items
    417         Values := TDbRows.Create;
    418         Database.Query(Values, 'SELECT * FROM `' + DbRows[0].Values['Schema'] + '`.`' +
    419           DbRows[0].Values['Table'] + '`');
    420         for I := 0 to Values.Count - 1 do begin
    421           NewItem := TReportLine.Create;
    422           NewItem.Items.Add(Values[I].Values[DbRows[0].Values['PrimaryKey']]);
    423           NewItem.Id := StrToInt(Values[I].Values[DbRows[0].Values['PrimaryKey']]);
    424           for C := 0 to Properties.Count - 1 do begin
    425             NewItem.Items.Add(Values[I].Values[Properties[C].Values['ColumnName']]);
    426           end;
    427           Report.Add(NewItem);
    428         end;
    429         Items.Count := Values.Count;
    430         Refresh;
    431       finally
    432         Properties.Free;
    433         Values.Free;
    434       end;
     401    SelectedObject.Load(Integer(TreeView1.Selected.Data));
     402    Report.Load(SelectedObject);
     403
     404    Columns.Clear;
     405    for I := 0 to Report.Columns.Count - 1 do begin
     406      NewColumn := Columns.Add;
     407      NewColumn.Caption := TReportColumn(Report.Columns[I]).Caption;
    435408    end;
    436     finally
    437       DbRows.Free;
    438     end;
    439   end;
     409    Items.Count := Report.Count;
     410    Refresh;
     411  end;
     412  ListView1Resize(Self);
    440413end;
    441414
  • trunk/chronis.lpi

    r8 r9  
    4343      </Item2>
    4444    </RequiredPackages>
    45     <Units Count="18">
     45    <Units Count="24">
    4646      <Unit0>
    4747        <Filename Value="chronis.lpr"/>
    4848        <IsPartOfProject Value="True"/>
    4949        <UnitName Value="chronis"/>
    50         <IsVisibleTab Value="True"/>
    51         <EditorIndex Value="0"/>
    52         <WindowIndex Value="1"/>
    53         <TopLine Value="1"/>
    54         <CursorPos X="16" Y="5"/>
     50        <EditorIndex Value="10"/>
     51        <WindowIndex Value="0"/>
     52        <TopLine Value="1"/>
     53        <CursorPos X="21" Y="5"/>
    5554        <UsageCount Value="274"/>
    5655        <Loaded Value="True"/>
     
    6463        <TopLine Value="330"/>
    6564        <CursorPos X="1" Y="347"/>
    66         <UsageCount Value="52"/>
     65        <UsageCount Value="50"/>
    6766        <DefaultSyntaxHighlighter Value="Delphi"/>
    6867      </Unit1>
     
    7675        <TopLine Value="118"/>
    7776        <CursorPos X="25" Y="144"/>
    78         <UsageCount Value="106"/>
     77        <UsageCount Value="104"/>
    7978        <DefaultSyntaxHighlighter Value="Delphi"/>
    8079      </Unit2>
     
    8887        <TopLine Value="1"/>
    8988        <CursorPos X="24" Y="14"/>
    90         <UsageCount Value="106"/>
     89        <UsageCount Value="104"/>
    9190        <DefaultSyntaxHighlighter Value="Delphi"/>
    9291      </Unit3>
     
    9594        <IsPartOfProject Value="True"/>
    9695        <UnitName Value="UPersistentForm"/>
    97         <WindowIndex Value="0"/>
    98         <TopLine Value="42"/>
    99         <CursorPos X="33" Y="46"/>
     96        <EditorIndex Value="14"/>
     97        <WindowIndex Value="0"/>
     98        <TopLine Value="55"/>
     99        <CursorPos X="3" Y="84"/>
    100100        <UsageCount Value="264"/>
     101        <Loaded Value="True"/>
    101102        <DefaultSyntaxHighlighter Value="Delphi"/>
    102103      </Unit4>
     
    105106        <IsPartOfProject Value="True"/>
    106107        <UnitName Value="USqlDatabase"/>
    107         <EditorIndex Value="2"/>
    108         <WindowIndex Value="0"/>
    109         <TopLine Value="362"/>
    110         <CursorPos X="1" Y="424"/>
     108        <IsVisibleTab Value="True"/>
     109        <EditorIndex Value="8"/>
     110        <WindowIndex Value="0"/>
     111        <TopLine Value="204"/>
     112        <CursorPos X="43" Y="225"/>
    111113        <UsageCount Value="264"/>
    112114        <Loaded Value="True"/>
     
    117119        <IsPartOfProject Value="True"/>
    118120        <UnitName Value="URegistry"/>
    119         <WindowIndex Value="0"/>
    120         <TopLine Value="32"/>
    121         <CursorPos X="21" Y="13"/>
     121        <EditorIndex Value="11"/>
     122        <WindowIndex Value="0"/>
     123        <TopLine Value="1"/>
     124        <CursorPos X="10" Y="8"/>
    122125        <UsageCount Value="264"/>
     126        <Loaded Value="True"/>
    123127        <DefaultSyntaxHighlighter Value="Delphi"/>
    124128      </Unit6>
     
    131135        <EditorIndex Value="0"/>
    132136        <WindowIndex Value="0"/>
    133         <TopLine Value="1"/>
    134         <CursorPos X="32" Y="95"/>
     137        <TopLine Value="56"/>
     138        <CursorPos X="1" Y="60"/>
    135139        <UsageCount Value="327"/>
    136140        <Loaded Value="True"/>
     
    144148        <ResourceBaseClass Value="Form"/>
    145149        <UnitName Value="UItemEdit"/>
    146         <IsVisibleTab Value="True"/>
    147150        <EditorIndex Value="1"/>
    148151        <WindowIndex Value="0"/>
    149         <TopLine Value="89"/>
    150         <CursorPos X="1" Y="111"/>
     152        <TopLine Value="85"/>
     153        <CursorPos X="5" Y="100"/>
    151154        <UsageCount Value="318"/>
    152155        <Loaded Value="True"/>
     
    161164        <ResourceBaseClass Value="Form"/>
    162165        <UnitName Value="ULoginForm"/>
    163         <EditorIndex Value="10"/>
     166        <EditorIndex Value="16"/>
    164167        <WindowIndex Value="0"/>
    165168        <TopLine Value="1"/>
     
    177180        <ResourceBaseClass Value="Form"/>
    178181        <UnitName Value="UMainForm"/>
    179         <EditorIndex Value="5"/>
    180         <WindowIndex Value="0"/>
    181         <TopLine Value="300"/>
    182         <CursorPos X="69" Y="312"/>
     182        <EditorIndex Value="3"/>
     183        <WindowIndex Value="0"/>
     184        <TopLine Value="1"/>
     185        <CursorPos X="47" Y="17"/>
    183186        <UsageCount Value="317"/>
    184187        <Loaded Value="True"/>
     
    199202        <ResourceBaseClass Value="Form"/>
    200203        <UnitName Value="UItemAdd"/>
    201         <EditorIndex Value="9"/>
    202         <WindowIndex Value="0"/>
    203         <TopLine Value="69"/>
    204         <CursorPos X="41" Y="90"/>
     204        <EditorIndex Value="15"/>
     205        <WindowIndex Value="0"/>
     206        <TopLine Value="1"/>
     207        <CursorPos X="14" Y="3"/>
    205208        <UsageCount Value="313"/>
    206209        <Loaded Value="True"/>
     
    210213      <Unit13>
    211214        <Filename Value="/usr/share/fpcsrc/rtl/objpas/classes/classesh.inc"/>
    212         <EditorIndex Value="8"/>
    213215        <WindowIndex Value="0"/>
    214216        <TopLine Value="963"/>
    215217        <CursorPos X="3" Y="974"/>
    216         <UsageCount Value="11"/>
    217         <Loaded Value="True"/>
     218        <UsageCount Value="9"/>
     219        <DefaultSyntaxHighlighter Value="Delphi"/>
    218220      </Unit13>
    219221      <Unit14>
    220222        <Filename Value="../../PascalClassLibrary/Generics/TemplateGenerics/Generic/GenericDictionary.inc"/>
    221         <EditorIndex Value="3"/>
    222         <WindowIndex Value="0"/>
    223         <TopLine Value="75"/>
    224         <CursorPos X="1" Y="89"/>
    225         <UsageCount Value="10"/>
     223        <EditorIndex Value="2"/>
     224        <WindowIndex Value="0"/>
     225        <TopLine Value="43"/>
     226        <CursorPos X="1" Y="60"/>
     227        <UsageCount Value="16"/>
    226228        <Loaded Value="True"/>
    227229      </Unit14>
    228230      <Unit15>
    229231        <Filename Value="../../PascalClassLibrary/Generics/TemplateGenerics/Generic/GenericList.inc"/>
    230         <EditorIndex Value="4"/>
    231         <WindowIndex Value="0"/>
    232         <TopLine Value="387"/>
    233         <CursorPos X="1" Y="407"/>
    234         <UsageCount Value="10"/>
     232        <EditorIndex Value="5"/>
     233        <WindowIndex Value="0"/>
     234        <TopLine Value="68"/>
     235        <CursorPos X="1" Y="85"/>
     236        <UsageCount Value="13"/>
    235237        <Loaded Value="True"/>
    236238      </Unit15>
     
    238240        <Filename Value="../../../lazarus/trunk/lcl/forms.pp"/>
    239241        <UnitName Value="Forms"/>
    240         <EditorIndex Value="6"/>
    241242        <WindowIndex Value="0"/>
    242243        <TopLine Value="593"/>
    243244        <CursorPos X="15" Y="606"/>
    244         <UsageCount Value="10"/>
    245         <Loaded Value="True"/>
     245        <UsageCount Value="8"/>
    246246      </Unit16>
    247247      <Unit17>
    248248        <Filename Value="../../../lazarus/trunk/lcl/include/customform.inc"/>
    249         <EditorIndex Value="7"/>
    250249        <WindowIndex Value="0"/>
    251250        <TopLine Value="2104"/>
    252251        <CursorPos X="3" Y="2109"/>
    253         <UsageCount Value="10"/>
    254         <Loaded Value="True"/>
     252        <UsageCount Value="8"/>
    255253      </Unit17>
     254      <Unit18>
     255        <Filename Value="/usr/share/fpcsrc/2.4.0/packages/fcl-registry/src/registry.pp"/>
     256        <UnitName Value="registry"/>
     257        <EditorIndex Value="12"/>
     258        <WindowIndex Value="0"/>
     259        <TopLine Value="1"/>
     260        <CursorPos X="6" Y="1"/>
     261        <UsageCount Value="19"/>
     262        <Loaded Value="True"/>
     263        <DefaultSyntaxHighlighter Value="Delphi"/>
     264      </Unit18>
     265      <Unit19>
     266        <Filename Value="/usr/share/fpcsrc/2.4.0/packages/fcl-registry/src/regdef.inc"/>
     267        <EditorIndex Value="13"/>
     268        <WindowIndex Value="0"/>
     269        <TopLine Value="1"/>
     270        <CursorPos X="3" Y="21"/>
     271        <UsageCount Value="19"/>
     272        <Loaded Value="True"/>
     273        <DefaultSyntaxHighlighter Value="Delphi"/>
     274      </Unit19>
     275      <Unit20>
     276        <Filename Value="usystem.pas"/>
     277        <IsPartOfProject Value="True"/>
     278        <UnitName Value="USystem"/>
     279        <EditorIndex Value="7"/>
     280        <WindowIndex Value="0"/>
     281        <TopLine Value="21"/>
     282        <CursorPos X="15" Y="38"/>
     283        <UsageCount Value="36"/>
     284        <Loaded Value="True"/>
     285        <DefaultSyntaxHighlighter Value="Delphi"/>
     286      </Unit20>
     287      <Unit21>
     288        <Filename Value="../../../lazarus/lcl/comctrls.pp"/>
     289        <UnitName Value="ComCtrls"/>
     290        <EditorIndex Value="6"/>
     291        <WindowIndex Value="0"/>
     292        <TopLine Value="912"/>
     293        <CursorPos X="14" Y="929"/>
     294        <UsageCount Value="16"/>
     295        <Loaded Value="True"/>
     296      </Unit21>
     297      <Unit22>
     298        <Filename Value="../../PascalClassLibrary/Generics/TemplateGenerics/Generic/GenericListObject.inc"/>
     299        <EditorIndex Value="9"/>
     300        <WindowIndex Value="0"/>
     301        <TopLine Value="1"/>
     302        <CursorPos X="15" Y="18"/>
     303        <UsageCount Value="14"/>
     304        <Loaded Value="True"/>
     305      </Unit22>
     306      <Unit23>
     307        <Filename Value="/usr/share/fpcsrc/2.4.0/rtl/inc/ustringh.inc"/>
     308        <EditorIndex Value="4"/>
     309        <WindowIndex Value="0"/>
     310        <TopLine Value="1"/>
     311        <CursorPos X="11" Y="30"/>
     312        <UsageCount Value="11"/>
     313        <Loaded Value="True"/>
     314        <DefaultSyntaxHighlighter Value="Delphi"/>
     315      </Unit23>
    256316    </Units>
    257317    <JumpHistory Count="30" HistoryIndex="29">
    258318      <Position1>
    259         <Filename Value="Common/USqlDatabase.pas"/>
    260         <Caret Line="424" Column="1" TopLine="407"/>
     319        <Filename Value="usystem.pas"/>
     320        <Caret Line="116" Column="45" TopLine="99"/>
    261321      </Position1>
    262322      <Position2>
    263         <Filename Value="../../PascalClassLibrary/Generics/TemplateGenerics/Generic/GenericDictionary.inc"/>
    264         <Caret Line="59" Column="1" TopLine="46"/>
     323        <Filename Value="usystem.pas"/>
     324        <Caret Line="131" Column="10" TopLine="114"/>
    265325      </Position2>
    266326      <Position3>
    267         <Filename Value="../../PascalClassLibrary/Generics/TemplateGenerics/Generic/GenericDictionary.inc"/>
    268         <Caret Line="60" Column="1" TopLine="46"/>
     327        <Filename Value="usystem.pas"/>
     328        <Caret Line="203" Column="1" TopLine="170"/>
    269329      </Position3>
    270330      <Position4>
    271         <Filename Value="../../PascalClassLibrary/Generics/TemplateGenerics/Generic/GenericDictionary.inc"/>
    272         <Caret Line="61" Column="1" TopLine="46"/>
     331        <Filename Value="usystem.pas"/>
     332        <Caret Line="25" Column="31" TopLine="18"/>
    273333      </Position4>
    274334      <Position5>
    275         <Filename Value="Forms/UMainForm.pas"/>
    276         <Caret Line="429" Column="1" TopLine="411"/>
     335        <Filename Value="usystem.pas"/>
     336        <Caret Line="131" Column="15" TopLine="111"/>
    277337      </Position5>
    278338      <Position6>
    279         <Filename Value="Common/USqlDatabase.pas"/>
    280         <Caret Line="423" Column="1" TopLine="407"/>
     339        <Filename Value="Forms/UMainForm.pas"/>
     340        <Caret Line="128" Column="7" TopLine="111"/>
    281341      </Position6>
    282342      <Position7>
    283         <Filename Value="Common/USqlDatabase.pas"/>
    284         <Caret Line="424" Column="1" TopLine="407"/>
     343        <Filename Value="usystem.pas"/>
     344        <Caret Line="132" Column="16" TopLine="114"/>
    285345      </Position7>
    286346      <Position8>
    287         <Filename Value="Common/USqlDatabase.pas"/>
    288         <Caret Line="423" Column="1" TopLine="407"/>
     347        <Filename Value="usystem.pas"/>
     348        <Caret Line="8" Column="60" TopLine="1"/>
    289349      </Position8>
    290350      <Position9>
    291         <Filename Value="Common/USqlDatabase.pas"/>
    292         <Caret Line="424" Column="1" TopLine="407"/>
     351        <Filename Value="usystem.pas"/>
     352        <Caret Line="131" Column="10" TopLine="114"/>
    293353      </Position9>
    294354      <Position10>
    295         <Filename Value="../../PascalClassLibrary/Generics/TemplateGenerics/Generic/GenericDictionary.inc"/>
    296         <Caret Line="59" Column="1" TopLine="46"/>
     355        <Filename Value="usystem.pas"/>
     356        <Caret Line="70" Column="7" TopLine="47"/>
    297357      </Position10>
    298358      <Position11>
    299         <Filename Value="../../PascalClassLibrary/Generics/TemplateGenerics/Generic/GenericDictionary.inc"/>
    300         <Caret Line="60" Column="1" TopLine="46"/>
     359        <Filename Value="usystem.pas"/>
     360        <Caret Line="54" Column="6" TopLine="43"/>
    301361      </Position11>
    302362      <Position12>
    303         <Filename Value="../../PascalClassLibrary/Generics/TemplateGenerics/Generic/GenericDictionary.inc"/>
    304         <Caret Line="88" Column="1" TopLine="75"/>
     363        <Filename Value="usystem.pas"/>
     364        <Caret Line="34" Column="9" TopLine="17"/>
    305365      </Position12>
    306366      <Position13>
    307         <Filename Value="Forms/UMainForm.pas"/>
    308         <Caret Line="292" Column="12" TopLine="282"/>
     367        <Filename Value="usystem.pas"/>
     368        <Caret Line="17" Column="15" TopLine="7"/>
    309369      </Position13>
    310370      <Position14>
    311         <Filename Value="Forms/UMainForm.pas"/>
    312         <Caret Line="204" Column="18" TopLine="202"/>
     371        <Filename Value="usystem.pas"/>
     372        <Caret Line="134" Column="21" TopLine="114"/>
    313373      </Position14>
    314374      <Position15>
    315         <Filename Value="Forms/UItemView.pas"/>
    316         <Caret Line="67" Column="13" TopLine="55"/>
     375        <Filename Value="Forms/UItemAdd.pas"/>
     376        <Caret Line="23" Column="67" TopLine="27"/>
    317377      </Position15>
    318378      <Position16>
    319         <Filename Value="Forms/UMainForm.pas"/>
    320         <Caret Line="16" Column="41" TopLine="4"/>
     379        <Filename Value="Forms/UItemAdd.pas"/>
     380        <Caret Line="151" Column="1" TopLine="122"/>
    321381      </Position16>
    322382      <Position17>
    323         <Filename Value="Forms/UMainForm.pas"/>
    324         <Caret Line="50" Column="25" TopLine="28"/>
     383        <Filename Value="Forms/UItemAdd.pas"/>
     384        <Caret Line="84" Column="1" TopLine="78"/>
    325385      </Position17>
    326386      <Position18>
    327         <Filename Value="Forms/UMainForm.pas"/>
    328         <Caret Line="87" Column="23" TopLine="65"/>
     387        <Filename Value="Forms/UItemAdd.pas"/>
     388        <Caret Line="76" Column="20" TopLine="60"/>
    329389      </Position18>
    330390      <Position19>
    331         <Filename Value="Forms/UMainForm.pas"/>
    332         <Caret Line="88" Column="23" TopLine="66"/>
     391        <Filename Value="Forms/UItemEdit.pas"/>
     392        <Caret Line="92" Column="12" TopLine="85"/>
    333393      </Position19>
    334394      <Position20>
    335         <Filename Value="Forms/UMainForm.pas"/>
    336         <Caret Line="89" Column="23" TopLine="67"/>
     395        <Filename Value="Forms/UItemAdd.pas"/>
     396        <Caret Line="95" Column="15" TopLine="76"/>
    337397      </Position20>
    338398      <Position21>
    339         <Filename Value="Forms/UMainForm.pas"/>
    340         <Caret Line="90" Column="23" TopLine="68"/>
     399        <Filename Value="Forms/UItemAdd.pas"/>
     400        <Caret Line="94" Column="1" TopLine="80"/>
    341401      </Position21>
    342402      <Position22>
    343         <Filename Value="Forms/UMainForm.pas"/>
    344         <Caret Line="91" Column="23" TopLine="69"/>
     403        <Filename Value="Forms/UItemAdd.pas"/>
     404        <Caret Line="101" Column="21" TopLine="84"/>
    345405      </Position22>
    346406      <Position23>
    347         <Filename Value="Forms/UMainForm.pas"/>
    348         <Caret Line="278" Column="29" TopLine="265"/>
     407        <Filename Value="Forms/UItemAdd.pas"/>
     408        <Caret Line="79" Column="1" TopLine="72"/>
    349409      </Position23>
    350410      <Position24>
    351         <Filename Value="Forms/UMainForm.pas"/>
    352         <Caret Line="290" Column="29" TopLine="277"/>
     411        <Filename Value="Forms/UItemAdd.pas"/>
     412        <Caret Line="97" Column="33" TopLine="80"/>
    353413      </Position24>
    354414      <Position25>
    355         <Filename Value="Forms/UMainForm.pas"/>
    356         <Caret Line="295" Column="29" TopLine="277"/>
     415        <Filename Value="Forms/UItemAdd.pas"/>
     416        <Caret Line="102" Column="77" TopLine="85"/>
    357417      </Position25>
    358418      <Position26>
    359         <Filename Value="Forms/UMainForm.pas"/>
    360         <Caret Line="300" Column="29" TopLine="287"/>
     419        <Filename Value="Forms/UItemAdd.pas"/>
     420        <Caret Line="92" Column="40" TopLine="67"/>
    361421      </Position26>
    362422      <Position27>
    363423        <Filename Value="Forms/UMainForm.pas"/>
    364         <Caret Line="304" Column="25" TopLine="287"/>
     424        <Caret Line="159" Column="63" TopLine="131"/>
    365425      </Position27>
    366426      <Position28>
    367427        <Filename Value="Forms/UMainForm.pas"/>
    368         <Caret Line="305" Column="63" TopLine="287"/>
     428        <Caret Line="1" Column="1" TopLine="1"/>
    369429      </Position28>
    370430      <Position29>
    371431        <Filename Value="Forms/UMainForm.pas"/>
    372         <Caret Line="308" Column="29" TopLine="287"/>
     432        <Caret Line="401" Column="25" TopLine="383"/>
    373433      </Position29>
    374434      <Position30>
    375435        <Filename Value="Forms/UMainForm.pas"/>
    376         <Caret Line="312" Column="69" TopLine="300"/>
     436        <Caret Line="17" Column="47" TopLine="1"/>
    377437      </Position30>
    378438    </JumpHistory>
     
    417477    </Linking>
    418478    <Other>
    419       <CompilerMessages>
    420         <IgnoredMessages idx5023="True" idx5024="True" idx5025="True" idx5028="True" idx5029="True" idx5031="True"/>
    421         <UseMsgFile Value="True"/>
    422       </CompilerMessages>
    423479      <CompilerPath Value="$(CompPath)"/>
    424480    </Other>
    425481  </CompilerOptions>
    426482  <Debugging>
     483    <BreakPoints Count="1">
     484      <Item1>
     485        <Source Value="../../PascalClassLibrary/Generics/TemplateGenerics/Generic/GenericListObject.inc"/>
     486        <Line Value="52"/>
     487      </Item1>
     488    </BreakPoints>
    427489    <Exceptions Count="3">
    428490      <Item1>
  • trunk/chronis.lpr

    r7 r9  
    88  {$ENDIF}{$ENDIF}
    99  Interfaces, // this includes the LCL widgetset
    10   Forms, UPersistentForm, URegistry, USqlDatabase, UTreeState,
    11 UItemView, UItemEdit, ULoginForm, UMainForm, UItemAdd, TemplateGenerics
     10  Forms, UPersistentForm, URegistry, USqlDatabase, UTreeState, SysUtils,
     11  UItemView, UItemEdit, ULoginForm, UMainForm, UItemAdd, TemplateGenerics, USystem
    1212  { you can add units after this };
    1313
    1414{$R *.res}
    1515
     16const
     17  HeapTraceLog = 'heaptrclog.trc';
    1618begin
     19  // Heap trace
     20  DeleteFile(ExtractFilePath(ParamStr(0)) + HeapTraceLog);
     21  SetHeapTraceOutput(ExtractFilePath(ParamStr(0)) + HeapTraceLog);
    1722  Application.Initialize;
    1823  Application.CreateForm(TMainForm, MainForm);
Note: See TracChangeset for help on using the changeset viewer.