Changeset 22 for trunk/Forms


Ignore:
Timestamp:
Jun 16, 2011, 12:18:21 PM (13 years ago)
Author:
george
Message:
  • Modified: Optimalized reloading of columns list in item list.
  • Fixed: Add and modify function.
Location:
trunk/Forms
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UImportStructureForm.lfm

    r20 r22  
    11object ImportStructureForm: TImportStructureForm
    2   Left = 321
    3   Height = 465
    4   Top = 145
    5   Width = 553
     2  Left = 323
     3  Height = 461
     4  Top = 147
     5  Width = 549
    66  Caption = 'Import structure'
    7   ClientHeight = 465
    8   ClientWidth = 553
     7  ClientHeight = 461
     8  ClientWidth = 549
    99  OnCreate = FormCreate
    1010  OnDestroy = FormDestroy
     
    7272  end
    7373  object Button1: TButton
    74     Left = 473
     74    Left = 469
    7575    Height = 25
    76     Top = 433
     76    Top = 429
    7777    Width = 75
    7878    Anchors = [akRight, akBottom]
     
    8383  object Memo1: TMemo
    8484    Left = 184
    85     Height = 412
     85    Height = 408
    8686    Top = 8
    87     Width = 360
     87    Width = 356
    8888    Anchors = [akTop, akLeft, akRight, akBottom]
    8989    ScrollBars = ssAutoBoth
  • trunk/Forms/UItemAdd.lfm

    r20 r22  
    11object ItemAddForm: TItemAddForm
    2   Left = 401
    3   Height = 419
    4   Top = 131
    5   Width = 565
     2  Left = 403
     3  Height = 415
     4  Top = 133
     5  Width = 561
    66  ActiveControl = Panel1
    77  Caption = 'Add item'
    8   ClientHeight = 419
    9   ClientWidth = 565
     8  ClientHeight = 415
     9  ClientWidth = 561
    1010  OnClose = FormClose
    1111  OnCreate = FormCreate
     
    1515  object Panel1: TPanel
    1616    Left = 0
    17     Height = 382
     17    Height = 378
    1818    Top = 0
    19     Width = 565
     19    Width = 561
    2020    Align = alTop
    2121    Anchors = [akLeft, akRight, akBottom]
     
    2424  end
    2525  object ButtonCancel: TButton
    26     Left = 382
     26    Left = 378
    2727    Height = 25
    28     Top = 390
     28    Top = 386
    2929    Width = 75
    3030    Anchors = [akRight, akBottom]
     
    3434  end
    3535  object ButtonSave: TButton
    36     Left = 470
     36    Left = 466
    3737    Height = 25
    38     Top = 390
     38    Top = 386
    3939    Width = 75
    4040    Anchors = [akRight, akBottom]
  • trunk/Forms/UItemAdd.pas

    r21 r22  
    2929  public
    3030    Report: TReport;
    31     ControlList: TListObject;
    32   end;
     31  end;
    3332
    3433var
     
    5958    Data := TDictionaryStringString.Create;
    6059    for I := 0 to Report.Columns.Count - 1 do
    61     if TReportColumn(Report.Columns[I]).ColumnName <> 'Id' then begin
     60    if not (TReportColumn(Report.Columns[I]).CustomType is TDataTypeRelationMany) then
     61    if TReportColumn(Report.Columns[I]).ColumnName <> MainForm.SelectedObject.PrimaryKey then begin
    6262      DataType := TReportColumn(Report.Columns[I]).CustomType;
    63       Data.Add(TReportColumn(Report.Columns[I]).ColumnName, DataType.GetControlValue(TWinControl(ControlList[I])));
     63      Data.Add(TReportColumn(Report.Columns[I]).ColumnName,
     64        DataType.GetControlValue(TWinControl(TReportColumn(Report.Columns[I]).Control)));
    6465    end;
    6566    Database.Insert(MainForm.SelectedObject.Table, Data, MainForm.SelectedObject.Schema);
     
    8182  Report := TReport.Create;
    8283  Report.Base := Core.System;
    83   ControlList := TListObject.Create;
    84   ControlList.OwnsObjects := False;
    8584end;
    8685
     
    8887begin
    8988  Report.Free;
    90   ControlList.Free;
    9189end;
    9290
     
    119117
    120118  // Load column names
    121   ControlList.Clear;
    122119    for I := 0 to Report.Columns.Count - 1 do
    123120    if TReportColumn(Report.Columns[I]).ColumnName <> 'Id' then begin
     
    138135        NewControl.Left := Column * Width div ColumnCount + (Width div ColumnCount) div 2;
    139136        NewControl.Width := (Width div ColumnCount) div 2 - 20;
    140         ControlList.Add(NewControl);
     137        TReportColumn(Report.Columns[I]).Control := NewControl;
    141138
    142139        Column := (Column + 1) mod 2;
    143140        if Column = 0 then LastTop := LastTop + NewControl.Height + 4;
    144141      end;
    145     end else ControlList.Add(nil);
     142    end;
    146143end;
    147144
  • trunk/Forms/UItemEdit.lfm

    r20 r22  
    11object ItemEditForm: TItemEditForm
    2   Left = 296
    3   Height = 427
    4   Top = 123
    5   Width = 556
     2  Left = 298
     3  Height = 423
     4  Top = 125
     5  Width = 552
    66  ActiveControl = Panel1
    77  Caption = 'Edit item'
    8   ClientHeight = 427
    9   ClientWidth = 556
     8  ClientHeight = 423
     9  ClientWidth = 552
    1010  OnClose = FormClose
    1111  OnCreate = FormCreate
     
    1515  object Panel1: TPanel
    1616    Left = 0
    17     Height = 384
     17    Height = 380
    1818    Top = 0
    19     Width = 556
     19    Width = 552
    2020    Align = alTop
    2121    Anchors = [akLeft, akRight, akBottom]
     
    2424  end
    2525  object ButtonCancel: TButton
    26     Left = 382
     26    Left = 378
    2727    Height = 25
    28     Top = 398
     28    Top = 394
    2929    Width = 75
    3030    Anchors = [akRight, akBottom]
     
    3434  end
    3535  object ButtonSave: TButton
    36     Left = 470
     36    Left = 466
    3737    Height = 25
    38     Top = 398
     38    Top = 394
    3939    Width = 75
    4040    Anchors = [akRight, akBottom]
  • trunk/Forms/UItemEdit.pas

    r21 r22  
    2828  public
    2929    Report: TReport;
    30     ControlList: TListObject;
    3130    procedure BuildControls;
    3231  end;
     
    5958    Data := TDictionaryStringString.Create;
    6059    for I := 0 to Report.Columns.Count - 1 do
    61     if TReportColumn(Report.Columns[I]).ColumnName <> 'Id' then begin
     60    if not (TReportColumn(Report.Columns[I]).CustomType is TDataTypeRelationMany) then
     61    if TReportColumn(Report.Columns[I]).ColumnName <> MainForm.SelectedObject.PrimaryKey then begin
    6262      DataType := TReportColumn(Report.Columns[I]).CustomType;
    63       Data.Add(TReportColumn(Report.Columns[I]).ColumnName, DataType.GetControlValue(TWinControl(ControlList[I])));
     63      Data.Add(TReportColumn(Report.Columns[I]).ColumnName,
     64        DataType.GetControlValue(TWinControl(TReportColumn(Report.Columns[I]).Control)));
    6465    end;
    6566    Database.Update(MainForm.SelectedObject.Table, Data,
    66       '`Id` = ' + IntToStr(MainForm.SelectedItem), MainForm.SelectedObject.Schema);
     67      '`' + MainForm.SelectedObject.PrimaryKey + '` = ' + IntToStr(MainForm.SelectedItem), MainForm.SelectedObject.Schema);
    6768  finally
    6869    Data.Free;
     
    8586  Report := TReport.Create;
    8687  Report.Base := Core.System;
    87   ControlList := TListObject.Create;
    88   ControlList.OwnsObjects := False;
    8988end;
    9089
    9190procedure TItemEditForm.FormDestroy(Sender: TObject);
    9291begin
    93   ControlList.Free;
    9492  Report.Free;
    9593end;
     
    141139        NewControl.Left := Column * Width div ColumnCount + (Width div ColumnCount) div 2;
    142140        NewControl.Width := (Width div ColumnCount) div 2 - 20;
    143         ControlList.Add(NewControl);
     141        TReportColumn(Report.Columns[I]).Control := NewControl;
    144142
    145143        Column := (Column + 1) mod 2;
    146144        if Column = 0 then LastTop := LastTop + NewControl.Height + 4;
    147145      end;
    148    end else ControlList.Add(nil);
     146   end;
    149147end;
    150148
  • trunk/Forms/UItemSelect.lfm

    r21 r22  
    11object ItemSelectForm: TItemSelectForm
    2   Left = 344
    3   Height = 350
    4   Top = 151
    5   Width = 495
     2  Left = 346
     3  Height = 346
     4  Top = 153
     5  Width = 491
    66  Caption = 'Item select'
    7   ClientHeight = 350
    8   ClientWidth = 495
     7  ClientHeight = 346
     8  ClientWidth = 491
    99  OnCreate = FormCreate
    1010  OnDestroy = FormDestroy
     
    1313  object ListView1: TListView
    1414    Left = 8
    15     Height = 304
     15    Height = 300
    1616    Top = 8
    17     Width = 482
     17    Width = 478
    1818    Anchors = [akTop, akLeft, akRight, akBottom]
    1919    Columns = <>
     
    2727  end
    2828  object ButtonSelect: TButton
    29     Left = 417
     29    Left = 413
    3030    Height = 25
    31     Top = 320
     31    Top = 316
    3232    Width = 75
    3333    Anchors = [akRight, akBottom]
     
    3737  end
    3838  object ButtonCancel: TButton
    39     Left = 328
     39    Left = 324
    4040    Height = 25
    41     Top = 320
     41    Top = 316
    4242    Width = 75
    4343    Anchors = [akRight, akBottom]
  • trunk/Forms/UItemView.lfm

    r20 r22  
    11object ItemViewForm: TItemViewForm
    2   Left = 312
    3   Height = 467
    4   Top = 111
    5   Width = 624
     2  Left = 314
     3  Height = 463
     4  Top = 113
     5  Width = 620
    66  Caption = 'View item'
    7   ClientHeight = 467
    8   ClientWidth = 624
     7  ClientHeight = 463
     8  ClientWidth = 620
    99  OnClose = FormClose
    1010  OnCreate = FormCreate
     
    1414  LCLVersion = '0.9.31'
    1515  object ButtonClose: TButton
    16     Left = 544
     16    Left = 540
    1717    Height = 25
    18     Top = 437
     18    Top = 433
    1919    Width = 75
    2020    Anchors = [akRight, akBottom]
     
    2424  end
    2525  object ButtonEdit: TButton
    26     Left = 456
     26    Left = 452
    2727    Height = 25
    28     Top = 437
     28    Top = 433
    2929    Width = 75
    3030    Anchors = [akRight, akBottom]
     
    3535  object Panel1: TPanel
    3636    Left = 0
    37     Height = 431
     37    Height = 427
    3838    Top = 0
    39     Width = 624
     39    Width = 620
    4040    Align = alTop
    4141    Anchors = [akTop, akLeft, akRight, akBottom]
    4242    BevelOuter = bvNone
    43     ClientHeight = 431
    44     ClientWidth = 624
     43    ClientHeight = 427
     44    ClientWidth = 620
    4545    TabOrder = 2
    4646    object Panel2: TPanel
    4747      Left = 0
    4848      Height = 200
    49       Top = 231
    50       Width = 624
     49      Top = 227
     50      Width = 620
    5151      Align = alBottom
    5252      BevelOuter = bvNone
    5353      ClientHeight = 200
    54       ClientWidth = 624
     54      ClientWidth = 620
    5555      TabOrder = 0
    5656      object TabControl1: TTabControl
     
    5858        Height = 24
    5959        Top = 0
    60         Width = 624
     60        Width = 620
    6161        Align = alTop
    6262        OnChange = TabControl1Change
     
    7474        Height = 176
    7575        Top = 24
    76         Width = 624
     76        Width = 620
    7777        Align = alClient
    7878        Columns = <>
     
    8989      Left = 0
    9090      Height = 3
    91       Top = 228
    92       Width = 624
     91      Top = 224
     92      Width = 620
    9393      Align = alBottom
    9494      ResizeAnchor = akBottom
     
    9696    object PanelControls: TPanel
    9797      Left = 0
    98       Height = 228
     98      Height = 224
    9999      Top = 0
    100       Width = 624
     100      Width = 620
    101101      Align = alClient
    102102      Anchors = [akLeft, akRight, akBottom]
  • trunk/Forms/ULoginForm.lfm

    r20 r22  
    11object LoginForm: TLoginForm
    2   Left = 480
    3   Height = 175
    4   Top = 256
    5   Width = 403
     2  Left = 482
     3  Height = 171
     4  Top = 258
     5  Width = 399
    66  BorderIcons = [biSystemMenu]
    77  BorderStyle = bsDialog
    88  Caption = 'Login'
    9   ClientHeight = 175
    10   ClientWidth = 403
     9  ClientHeight = 171
     10  ClientWidth = 399
    1111  LCLVersion = '0.9.31'
    1212  object Label1: TLabel
  • trunk/Forms/UMainForm.lfm

    r21 r22  
    11object MainForm: TMainForm
    2   Left = 269
    3   Height = 450
    4   Top = 157
    5   Width = 644
     2  Left = 271
     3  Height = 447
     4  Top = 159
     5  Width = 640
    66  ActiveControl = Panel1
    77  Caption = 'ChronIS'
    8   ClientHeight = 431
    9   ClientWidth = 644
     8  ClientHeight = 427
     9  ClientWidth = 640
    1010  Menu = MainMenu1
    1111  OnClose = FormClose
     
    1616  object Panel1: TPanel
    1717    Left = 0
    18     Height = 431
     18    Height = 427
    1919    Top = 0
    2020    Width = 184
    2121    Align = alLeft
    2222    BevelOuter = bvNone
    23     ClientHeight = 431
     23    ClientHeight = 427
    2424    ClientWidth = 184
    2525    TabOrder = 0
     
    3434    object TreeView1: TTreeView
    3535      Left = 4
    36       Height = 407
     36      Height = 403
    3737      Top = 19
    3838      Width = 180
     
    4848  object Panel2: TPanel
    4949    Left = 189
    50     Height = 431
     50    Height = 427
    5151    Top = 0
    52     Width = 455
     52    Width = 451
    5353    Align = alClient
    5454    BevelOuter = bvNone
    55     ClientHeight = 431
    56     ClientWidth = 455
     55    ClientHeight = 427
     56    ClientWidth = 451
    5757    TabOrder = 1
    5858    object Label2: TLabel
     
    6666    object ListView1: TListView
    6767      Left = 2
    68       Height = 375
     68      Height = 371
    6969      Top = 19
    70       Width = 451
     70      Width = 447
    7171      Anchors = [akTop, akLeft, akRight, akBottom]
    7272      Columns = <>
     
    8686      Left = 3
    8787      Height = 25
    88       Top = 402
     88      Top = 398
    8989      Width = 75
    9090      Action = AItemAdd
     
    9595      Left = 83
    9696      Height = 25
    97       Top = 402
     97      Top = 398
    9898      Width = 75
    9999      Action = AItemDelete
     
    104104  object Splitter1: TSplitter
    105105    Left = 184
    106     Height = 431
     106    Height = 427
    107107    Top = 0
    108108    Width = 5
  • trunk/Forms/USettingForm.lfm

    r20 r22  
    11object SettingForm: TSettingForm
    2   Left = 372
    3   Height = 326
    4   Top = 139
    5   Width = 444
     2  Left = 374
     3  Height = 322
     4  Top = 141
     5  Width = 440
    66  Caption = 'Settings'
    7   ClientHeight = 326
    8   ClientWidth = 444
     7  ClientHeight = 322
     8  ClientWidth = 440
    99  OnClose = FormClose
    1010  OnShow = FormShow
     
    2626  end
    2727  object ButtonSave: TButton
    28     Left = 366
     28    Left = 362
    2929    Height = 25
    30     Top = 294
     30    Top = 290
    3131    Width = 75
    3232    Anchors = [akRight, akBottom]
     
    3636  end
    3737  object ButtonCancel: TButton
    38     Left = 278
     38    Left = 274
    3939    Height = 25
    40     Top = 294
     40    Top = 290
    4141    Width = 75
    4242    Anchors = [akRight, akBottom]
Note: See TracChangeset for help on using the changeset viewer.