Changeset 7 for trunk/Forms


Ignore:
Timestamp:
Dec 25, 2010, 9:53:55 PM (14 years ago)
Author:
george
Message:
  • Updated: USqlDatabase library.
  • Added: Dependency to TemplateGenerics package.
  • Modified: Rest of czech strings translated to english.
Location:
trunk/Forms
Files:
4 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UItemAdd.lfm

    r5 r7  
    22  Left = 400
    33  Height = 421
    4   Top = 156
     4  Top = 130
    55  Width = 567
    6   Caption = 'Přidání položky'
     6  Caption = 'Add item'
    77  ClientHeight = 421
    88  ClientWidth = 567
     
    2626    Width = 75
    2727    Anchors = [akRight, akBottom]
    28     Caption = 'Zrušit'
     28    Caption = 'Cancel'
    2929    OnClick = ButtonCancelClick
    3030    TabOrder = 1
     
    3636    Width = 75
    3737    Anchors = [akRight, akBottom]
    38     Caption = 'Přidat'
     38    Caption = 'Add'
    3939    OnClick = ButtonSaveClick
    4040    TabOrder = 2
  • trunk/Forms/UItemAdd.pas

    r5 r7  
    7777  LastTop := 8;
    7878  Column := 0;
    79   ObjectInfo := MainForm.Database.Query('SELECT * FROM `Object` WHERE `Id`=' + IntToStr(MainForm.SelectedObject));
     79  try
     80  ObjectInfo := TDbRows.Create;
     81  MainForm.Database.Query(ObjectInfo, 'SELECT * FROM `Object` WHERE `Id`=' + IntToStr(MainForm.SelectedObject));
    8082  if ObjectInfo.Count = 1 then begin
    8183
    8284    for I := Panel1.ControlCount - 1 downto 0 do
    83       Panel1.Controls[I].Destroy;
     85      Panel1.Controls[I].Free;
    8486
    8587    // Load column names
    86     Properties := MainForm.Database.Query('SELECT * FROM `Property` WHERE `Object`=' +
     88    try
     89    Properties := TDbRows.Create;
     90    MainForm.Database.Query(Properties, 'SELECT * FROM `Property` WHERE `Object`=' +
    8791      IntToStr(MainForm.SelectedObject));
    8892    for I := 0 to Properties.Count - 1 do begin
     
    145149      if Column = 0 then LastTop := LastTop + NewControl.Height + 4;
    146150    end;
    147     Properties.Destroy;
    148   end else ShowMessage('Objekt nenalezen');
    149   ObjectInfo.Destroy;
     151
     152    finally
     153      Properties.Free;
     154    end;
     155  end else ShowMessage(SObjectNotFound);
     156  finally
     157    ObjectInfo.Free;
     158  end;
    150159end;
    151160
  • trunk/Forms/UItemEdit.lfm

    r6 r7  
    22  Left = 295
    33  Height = 429
    4   Top = 174
     4  Top = 122
    55  Width = 558
    66  ActiveControl = Panel1
    7   Caption = 'Úprava položky'
     7  Caption = 'Edit item'
    88  ClientHeight = 429
    99  ClientWidth = 558
     
    2727    Width = 75
    2828    Anchors = [akRight, akBottom]
    29     Caption = 'Zrušit'
     29    Caption = 'Cancel'
    3030    OnClick = ButtonCancelClick
    3131    TabOrder = 1
     
    3737    Width = 75
    3838    Anchors = [akRight, akBottom]
    39     Caption = 'Uložit'
     39    Caption = 'Save'
    4040    OnClick = ButtonSaveClick
    4141    TabOrder = 2
  • trunk/Forms/UItemEdit.pas

    r6 r7  
    7878  LastTop := 8;
    7979  Column := 0;
    80   ObjectInfo := MainForm.Database.Query('SELECT * FROM `Object` WHERE `Id`=' + IntToStr(MainForm.SelectedObject));
     80  try
     81  ObjectInfo := TDbRows.Create;
     82  MainForm.Database.Query(ObjectInfo, 'SELECT * FROM `Object` WHERE `Id`=' + IntToStr(MainForm.SelectedObject));
    8183  if ObjectInfo.Count = 1 then begin
    8284
    8385    for I := Panel1.ControlCount - 1 downto 0 do
    84       Panel1.Controls[I].Destroy;
     86      Panel1.Controls[I].Free;
    8587
    8688    // Load column names
    87     Properties := MainForm.Database.Query('SELECT * FROM `Property` WHERE `Object`=' +
     89    try
     90    Properties := TDbRows.Create;
     91    MainForm.Database.Query(Properties, 'SELECT * FROM `Property` WHERE `Object`=' +
    8892      IntToStr(MainForm.SelectedObject));
    89     Values := MainForm.Database.Query('SELECT * FROM `' + ObjectInfo[0].Values['Schema'] + '`.`' +
     93    Values := TDbRows.Create;
     94    MainForm.Database.Query(Values, 'SELECT * FROM `' + ObjectInfo[0].Values['Schema'] + '`.`' +
    9095      ObjectInfo[0].Values['Table'] + '` WHERE ' + ObjectInfo[0].Values['PrimaryKey'] + ' = ' +
    9196      IntToStr(MainForm.SelectedItem));
     
    155160      Column := (Column + 1) mod 2;
    156161      if Column = 0 then LastTop := LastTop + NewControl.Height + 4;
    157     end else ShowMessage('Položka nenalezena');
    158     Values.Destroy;
    159     Properties.Destroy;
    160   end else ShowMessage('Objekt nenalezen');
    161   ObjectInfo.Destroy;
     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;
    162171end;
    163172
  • trunk/Forms/UItemView.lfm

    r6 r7  
    44  Top = 135
    55  Width = 552
    6   Caption = 'Zobrazení položky'
     6  Caption = 'View item'
    77  ClientHeight = 416
    88  ClientWidth = 552
     
    1616    Width = 75
    1717    Anchors = [akRight, akBottom]
    18     Caption = 'Zavřít'
     18    Caption = 'Close'
    1919    OnClick = ButtonCloseClick
    2020    TabOrder = 0
     
    3636    Width = 75
    3737    Anchors = [akRight, akBottom]
    38     Caption = 'Editovat'
     38    Caption = 'Edit'
    3939    OnClick = ButtonEditClick
    4040    TabOrder = 2
  • trunk/Forms/UItemView.pas

    r6 r7  
    8282  LastTop := 8;
    8383  Column := 0;
    84   ObjectInfo := MainForm.Database.Query('SELECT * FROM `Object` WHERE `Id`=' + IntToStr(MainForm.SelectedObject));
     84  try
     85  ObjectInfo := TDbRows.Create;
     86  MainForm.Database.Query(ObjectInfo, 'SELECT * FROM `Object` WHERE `Id`=' + IntToStr(MainForm.SelectedObject));
    8587  if ObjectInfo.Count = 1 then begin
    8688
     
    8991
    9092    // Load column names
    91     Properties := MainForm.Database.Query('SELECT * FROM `Property` WHERE `Object`=' +
     93    try
     94    Properties := TDbRows.Create;
     95    MainForm.Database.Query(Properties, 'SELECT * FROM `Property` WHERE `Object`=' +
    9296      IntToStr(MainForm.SelectedObject));
    93     Values := MainForm.Database.Query('SELECT * FROM `' + ObjectInfo[0].Values['Schema'] + '`.`' +
     97    Values := TDbRows.Create;
     98    MainForm.Database.Query(Values, 'SELECT * FROM `' + ObjectInfo[0].Values['Schema'] + '`.`' +
    9499      ObjectInfo[0].Values['Table'] + '` WHERE ' + ObjectInfo[0].Values['PrimaryKey'] + ' = ' +
    95100      IntToStr(MainForm.SelectedItem));
     
    110115      Column := (Column + 1) mod 2;
    111116      if Column = 0 then LastTop := LastTop + NewControl.Height + 4;
    112     end else ShowMessage('Položka nenalezena');
    113     Values.Destroy;
    114     Properties.Destroy;
    115   end else ShowMessage('Objekt nenalezen');
    116   ObjectInfo.Free;
     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  end;
    117126end;
    118127
  • trunk/Forms/ULoginForm.lfm

    r3 r7  
    66  BorderIcons = [biSystemMenu]
    77  BorderStyle = bsDialog
    8   Caption = 'Přihlášení'
     8  Caption = 'Login'
    99  ClientHeight = 177
    1010  ClientWidth = 405
     
    1212  object Label1: TLabel
    1313    Left = 16
    14     Height = 18
     14    Height = 14
    1515    Top = 48
    16     Width = 47
    17     Caption = 'Jméno:'
     16    Width = 61
     17    Caption = 'Username:'
    1818    ParentColor = False
    1919  end
    2020  object Label2: TLabel
    2121    Left = 16
    22     Height = 18
     22    Height = 14
    2323    Top = 80
    24     Width = 43
    25     Caption = 'Heslo:'
     24    Width = 57
     25    Caption = 'Password:'
    2626    ParentColor = False
    2727  end
     
    3131    Top = 128
    3232    Width = 75
    33     Caption = 'Ukončit'
     33    Caption = 'Close'
    3434    TabOrder = 0
    3535  end
     
    3939    Top = 128
    4040    Width = 75
    41     Caption = 'Přihlásit'
     41    Caption = 'Login'
    4242    TabOrder = 1
    4343  end
    4444  object Edit1: TEdit
    45     Left = 72
    46     Height = 27
     45    Left = 88
     46    Height = 23
    4747    Top = 40
    48     Width = 120
     48    Width = 104
    4949    TabOrder = 2
    50     Text = 'Edit1'
    5150  end
    5251  object MaskEdit1: TMaskEdit
    53     Left = 72
    54     Height = 27
     52    Left = 88
     53    Height = 23
    5554    Top = 71
    56     Width = 120
     55    Width = 104
    5756    CharCase = ecNormal
    5857    MaxLength = 1
  • trunk/Forms/UMainForm.lfm

    r6 r7  
    2828      Height = 14
    2929      Top = 4
    30       Width = 46
    31       Caption = 'Skupiny:'
     30      Width = 44
     31      Caption = 'Groups:'
    3232      ParentColor = False
    3333    end
     
    6060      Height = 14
    6161      Top = 4
    62       Width = 38
    63       Caption = 'Výpisy:'
     62      Width = 46
     63      Caption = 'Reports:'
    6464      ParentColor = False
    6565    end
     
    112112    object AItemDelete: TAction
    113113      Category = 'Item'
    114       Caption = 'Smazat'
     114      Caption = 'Delete'
    115115    end
    116116    object AItemAdd: TAction
    117117      Category = 'Item'
    118       Caption = 'Přidat'
     118      Caption = 'Add'
    119119      OnExecute = AItemAddExecute
    120120    end
    121121    object AItemEdit: TAction
    122122      Category = 'Item'
    123       Caption = 'Upravit'
     123      Caption = 'Edit'
    124124      OnExecute = AItemEditExecute
    125125    end
    126126    object AItemView: TAction
    127127      Category = 'Item'
    128       Caption = 'Zobrazit'
     128      Caption = 'View'
    129129      OnExecute = AItemViewExecute
    130130    end
    131131    object AObjectGroupDelete: TAction
    132132      Category = 'ObjectGroup'
    133       Caption = 'Odebrat'
     133      Caption = 'Delete'
    134134    end
    135135    object AObjectGroupAddGroup: TAction
    136136      Category = 'ObjectGroup'
    137       Caption = 'Přidat skupinu'
     137      Caption = 'Add group'
    138138      OnExecute = AObjectGroupAddGroupExecute
    139139    end
    140140    object AObjectGroupAddObject: TAction
    141141      Category = 'ObjectGroup'
    142       Caption = 'Přidat objekt'
     142      Caption = 'Add object'
    143143    end
    144144    object AObjectGroupEdit: TAction
    145145      Category = 'ObjectGroup'
    146       Caption = 'Upravit'
     146      Caption = 'Edit'
    147147      OnExecute = AObjectGroupEditExecute
    148148    end
    149149    object AObjectDelete: TAction
    150150      Category = 'Object'
    151       Caption = 'Odstranit'
     151      Caption = 'Delete'
    152152    end
    153153    object AObjectEdit: TAction
    154154      Category = 'Object'
    155       Caption = 'Upravit'
     155      Caption = 'Edit'
    156156      OnExecute = AObjectEditExecute
    157157    end
     
    161161    end
    162162    object AToggleFullscreen: TAction
    163       Caption = 'Fullscreen mode F11'
     163      Caption = 'Fullscreen mode'
    164164      OnExecute = AToggleFullscreenExecute
    165165      ShortCut = 122
  • trunk/Forms/UMainForm.lrt

    r6 r7  
    11TMAINFORM.MAINFORM.CAPTION=ChronIS
    2 TMAINFORM.LABEL1.CAPTION=Skupiny:
    3 TMAINFORM.LABEL2.CAPTION=Výpisy:
    4 TMAINFORM.AITEMDELETE.CAPTION=Smazat
    5 TMAINFORM.AITEMADD.CAPTION=Přidat
    6 TMAINFORM.AITEMEDIT.CAPTION=Upravit
    7 TMAINFORM.AITEMVIEW.CAPTION=Zobrazit
    8 TMAINFORM.AOBJECTGROUPDELETE.CAPTION=Odebrat
    9 TMAINFORM.AOBJECTGROUPADDGROUP.CAPTION=Přidat skupinu
    10 TMAINFORM.AOBJECTGROUPADDOBJECT.CAPTION=Přidat objekt
    11 TMAINFORM.AOBJECTGROUPEDIT.CAPTION=Upravit
    12 TMAINFORM.AOBJECTDELETE.CAPTION=Odstranit
    13 TMAINFORM.AOBJECTEDIT.CAPTION=Upravit
     2TMAINFORM.LABEL1.CAPTION=Groups:
     3TMAINFORM.LABEL2.CAPTION=Reports:
     4TMAINFORM.AITEMDELETE.CAPTION=Delete
     5TMAINFORM.AITEMADD.CAPTION=Add
     6TMAINFORM.AITEMEDIT.CAPTION=Edit
     7TMAINFORM.AITEMVIEW.CAPTION=View
     8TMAINFORM.AOBJECTGROUPDELETE.CAPTION=Delete
     9TMAINFORM.AOBJECTGROUPADDGROUP.CAPTION=Add group
     10TMAINFORM.AOBJECTGROUPADDOBJECT.CAPTION=Add object
     11TMAINFORM.AOBJECTGROUPEDIT.CAPTION=Edit
     12TMAINFORM.AOBJECTDELETE.CAPTION=Delete
     13TMAINFORM.AOBJECTEDIT.CAPTION=Edit
    1414TMAINFORM.AEXIT.CAPTION=Exit
    15 TMAINFORM.ATOGGLEFULLSCREEN.CAPTION=Fullscreen mode F11
     15TMAINFORM.ATOGGLEFULLSCREEN.CAPTION=Fullscreen mode
    1616TMAINFORM.MENUITEM13.CAPTION=Server
    1717TMAINFORM.MENUITEM11.CAPTION=View
  • trunk/Forms/UMainForm.pas

    r6 r7  
    100100  MainForm: TMainForm;
    101101
     102resourcestring
     103  SItemNotFound = 'Item not found';
     104  SObjectNotFound = 'Object not found';
     105
     106
    102107implementation
    103108
     
    129134            Database.HostName := TextContent;
    130135          if NodeName = 'schema' then
    131             Database.Schema := TextContent;
     136            Database.Database := TextContent;
    132137          if NodeName = 'username' then
    133138            Database.UserName := TextContent;
     
    306311    TopItem.SelectedIndex := 0;
    307312    try
    308       DbRows := Database.Query('SELECT * FROM `ObjectGroup`');
     313      DbRows := TDbRows.Create;
     314      Database.Query(DbRows, 'SELECT * FROM `ObjectGroup`');
    309315      for I := 0 to DbRows.Count - 1 do begin
    310316        NewNode := AddChild(TopItem, DbRows[I].Values['Name']);
     
    313319        NewNode.Data := Pointer(StrToInt(DbRows[I].Values['Id']));
    314320        try
    315           ObjectDbRows := Database.Query('SELECT * FROM `Object` WHERE `Group`=' + DbRows[I].Values['Id']);
     321          ObjectDbRows := TDbRows.Create;
     322          Database.Query(ObjectDbRows, 'SELECT * FROM `Object` WHERE `Group`=' + DbRows[I].Values['Id']);
    316323          for O := 0 to ObjectDbRows.Count - 1 do begin
    317324            NewObjectNode := AddChild(NewNode, ObjectDbRows[O].Values['Name']);
     
    348355    Clear;
    349356    try
    350     DbRows := Database.Query('SELECT * FROM `Object` WHERE `Id`=' + IntToStr(Integer(TreeView1.Selected.Data)));
     357    DbRows := TDbRows.Create;
     358    Database.Query(DbRows, 'SELECT * FROM `Object` WHERE `Id`=' + IntToStr(Integer(TreeView1.Selected.Data)));
    351359    if DbRows.Count = 1 then begin
    352360      SelectedObject := StrToInt(DbRows[0].Values['Id']);
     
    354362      // Load column names
    355363      try
    356         Properties := Database.Query('SELECT * FROM `Property` WHERE `Object`=' +
     364        Properties := TDbRows.Create;
     365        Database.Query(Properties, 'SELECT * FROM `Property` WHERE `Object`=' +
    357366          DbRows[0].Values['Id']);
    358367        Columns.Clear;
     
    371380      // Load items
    372381      try
    373       Values := Database.Query('SELECT * FROM `' + DbRows[0].Values['Schema'] + '`.`' +
     382      Values := TDbRows.Create;
     383      Database.Query(Values, 'SELECT * FROM `' + DbRows[0].Values['Schema'] + '`.`' +
    374384        DbRows[0].Values['Table'] + '`');
    375385      for I := 0 to Values.Count - 1 do begin
Note: See TracChangeset for help on using the changeset viewer.