Changeset 7 for trunk/Forms
- Timestamp:
- Dec 25, 2010, 9:53:55 PM (14 years ago)
- Location:
- trunk/Forms
- Files:
-
- 4 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UItemAdd.lfm
r5 r7 2 2 Left = 400 3 3 Height = 421 4 Top = 1 564 Top = 130 5 5 Width = 567 6 Caption = ' Přidání položky'6 Caption = 'Add item' 7 7 ClientHeight = 421 8 8 ClientWidth = 567 … … 26 26 Width = 75 27 27 Anchors = [akRight, akBottom] 28 Caption = ' Zrušit'28 Caption = 'Cancel' 29 29 OnClick = ButtonCancelClick 30 30 TabOrder = 1 … … 36 36 Width = 75 37 37 Anchors = [akRight, akBottom] 38 Caption = ' Přidat'38 Caption = 'Add' 39 39 OnClick = ButtonSaveClick 40 40 TabOrder = 2 -
trunk/Forms/UItemAdd.pas
r5 r7 77 77 LastTop := 8; 78 78 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)); 80 82 if ObjectInfo.Count = 1 then begin 81 83 82 84 for I := Panel1.ControlCount - 1 downto 0 do 83 Panel1.Controls[I]. Destroy;85 Panel1.Controls[I].Free; 84 86 85 87 // 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`=' + 87 91 IntToStr(MainForm.SelectedObject)); 88 92 for I := 0 to Properties.Count - 1 do begin … … 145 149 if Column = 0 then LastTop := LastTop + NewControl.Height + 4; 146 150 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; 150 159 end; 151 160 -
trunk/Forms/UItemEdit.lfm
r6 r7 2 2 Left = 295 3 3 Height = 429 4 Top = 1 744 Top = 122 5 5 Width = 558 6 6 ActiveControl = Panel1 7 Caption = ' Úprava položky'7 Caption = 'Edit item' 8 8 ClientHeight = 429 9 9 ClientWidth = 558 … … 27 27 Width = 75 28 28 Anchors = [akRight, akBottom] 29 Caption = ' Zrušit'29 Caption = 'Cancel' 30 30 OnClick = ButtonCancelClick 31 31 TabOrder = 1 … … 37 37 Width = 75 38 38 Anchors = [akRight, akBottom] 39 Caption = ' Uložit'39 Caption = 'Save' 40 40 OnClick = ButtonSaveClick 41 41 TabOrder = 2 -
trunk/Forms/UItemEdit.pas
r6 r7 78 78 LastTop := 8; 79 79 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)); 81 83 if ObjectInfo.Count = 1 then begin 82 84 83 85 for I := Panel1.ControlCount - 1 downto 0 do 84 Panel1.Controls[I]. Destroy;86 Panel1.Controls[I].Free; 85 87 86 88 // 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`=' + 88 92 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'] + '`.`' + 90 95 ObjectInfo[0].Values['Table'] + '` WHERE ' + ObjectInfo[0].Values['PrimaryKey'] + ' = ' + 91 96 IntToStr(MainForm.SelectedItem)); … … 155 160 Column := (Column + 1) mod 2; 156 161 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; 162 171 end; 163 172 -
trunk/Forms/UItemView.lfm
r6 r7 4 4 Top = 135 5 5 Width = 552 6 Caption = ' Zobrazení položky'6 Caption = 'View item' 7 7 ClientHeight = 416 8 8 ClientWidth = 552 … … 16 16 Width = 75 17 17 Anchors = [akRight, akBottom] 18 Caption = ' Zavřít'18 Caption = 'Close' 19 19 OnClick = ButtonCloseClick 20 20 TabOrder = 0 … … 36 36 Width = 75 37 37 Anchors = [akRight, akBottom] 38 Caption = 'Edit ovat'38 Caption = 'Edit' 39 39 OnClick = ButtonEditClick 40 40 TabOrder = 2 -
trunk/Forms/UItemView.pas
r6 r7 82 82 LastTop := 8; 83 83 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)); 85 87 if ObjectInfo.Count = 1 then begin 86 88 … … 89 91 90 92 // 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`=' + 92 96 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'] + '`.`' + 94 99 ObjectInfo[0].Values['Table'] + '` WHERE ' + ObjectInfo[0].Values['PrimaryKey'] + ' = ' + 95 100 IntToStr(MainForm.SelectedItem)); … … 110 115 Column := (Column + 1) mod 2; 111 116 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; 117 126 end; 118 127 -
trunk/Forms/ULoginForm.lfm
r3 r7 6 6 BorderIcons = [biSystemMenu] 7 7 BorderStyle = bsDialog 8 Caption = ' Přihlášení'8 Caption = 'Login' 9 9 ClientHeight = 177 10 10 ClientWidth = 405 … … 12 12 object Label1: TLabel 13 13 Left = 16 14 Height = 1 814 Height = 14 15 15 Top = 48 16 Width = 4717 Caption = ' Jméno:'16 Width = 61 17 Caption = 'Username:' 18 18 ParentColor = False 19 19 end 20 20 object Label2: TLabel 21 21 Left = 16 22 Height = 1 822 Height = 14 23 23 Top = 80 24 Width = 4325 Caption = ' Heslo:'24 Width = 57 25 Caption = 'Password:' 26 26 ParentColor = False 27 27 end … … 31 31 Top = 128 32 32 Width = 75 33 Caption = ' Ukončit'33 Caption = 'Close' 34 34 TabOrder = 0 35 35 end … … 39 39 Top = 128 40 40 Width = 75 41 Caption = ' Přihlásit'41 Caption = 'Login' 42 42 TabOrder = 1 43 43 end 44 44 object Edit1: TEdit 45 Left = 7246 Height = 2 745 Left = 88 46 Height = 23 47 47 Top = 40 48 Width = 1 2048 Width = 104 49 49 TabOrder = 2 50 Text = 'Edit1'51 50 end 52 51 object MaskEdit1: TMaskEdit 53 Left = 7254 Height = 2 752 Left = 88 53 Height = 23 55 54 Top = 71 56 Width = 1 2055 Width = 104 57 56 CharCase = ecNormal 58 57 MaxLength = 1 -
trunk/Forms/UMainForm.lfm
r6 r7 28 28 Height = 14 29 29 Top = 4 30 Width = 4 631 Caption = ' Skupiny:'30 Width = 44 31 Caption = 'Groups:' 32 32 ParentColor = False 33 33 end … … 60 60 Height = 14 61 61 Top = 4 62 Width = 3863 Caption = ' Výpisy:'62 Width = 46 63 Caption = 'Reports:' 64 64 ParentColor = False 65 65 end … … 112 112 object AItemDelete: TAction 113 113 Category = 'Item' 114 Caption = ' Smazat'114 Caption = 'Delete' 115 115 end 116 116 object AItemAdd: TAction 117 117 Category = 'Item' 118 Caption = ' Přidat'118 Caption = 'Add' 119 119 OnExecute = AItemAddExecute 120 120 end 121 121 object AItemEdit: TAction 122 122 Category = 'Item' 123 Caption = ' Upravit'123 Caption = 'Edit' 124 124 OnExecute = AItemEditExecute 125 125 end 126 126 object AItemView: TAction 127 127 Category = 'Item' 128 Caption = ' Zobrazit'128 Caption = 'View' 129 129 OnExecute = AItemViewExecute 130 130 end 131 131 object AObjectGroupDelete: TAction 132 132 Category = 'ObjectGroup' 133 Caption = ' Odebrat'133 Caption = 'Delete' 134 134 end 135 135 object AObjectGroupAddGroup: TAction 136 136 Category = 'ObjectGroup' 137 Caption = ' Přidat skupinu'137 Caption = 'Add group' 138 138 OnExecute = AObjectGroupAddGroupExecute 139 139 end 140 140 object AObjectGroupAddObject: TAction 141 141 Category = 'ObjectGroup' 142 Caption = ' Přidat objekt'142 Caption = 'Add object' 143 143 end 144 144 object AObjectGroupEdit: TAction 145 145 Category = 'ObjectGroup' 146 Caption = ' Upravit'146 Caption = 'Edit' 147 147 OnExecute = AObjectGroupEditExecute 148 148 end 149 149 object AObjectDelete: TAction 150 150 Category = 'Object' 151 Caption = ' Odstranit'151 Caption = 'Delete' 152 152 end 153 153 object AObjectEdit: TAction 154 154 Category = 'Object' 155 Caption = ' Upravit'155 Caption = 'Edit' 156 156 OnExecute = AObjectEditExecute 157 157 end … … 161 161 end 162 162 object AToggleFullscreen: TAction 163 Caption = 'Fullscreen mode F11'163 Caption = 'Fullscreen mode' 164 164 OnExecute = AToggleFullscreenExecute 165 165 ShortCut = 122 -
trunk/Forms/UMainForm.lrt
r6 r7 1 1 TMAINFORM.MAINFORM.CAPTION=ChronIS 2 TMAINFORM.LABEL1.CAPTION= Skupiny:3 TMAINFORM.LABEL2.CAPTION= Výpisy:4 TMAINFORM.AITEMDELETE.CAPTION= Smazat5 TMAINFORM.AITEMADD.CAPTION= Přidat6 TMAINFORM.AITEMEDIT.CAPTION= Upravit7 TMAINFORM.AITEMVIEW.CAPTION= Zobrazit8 TMAINFORM.AOBJECTGROUPDELETE.CAPTION= Odebrat9 TMAINFORM.AOBJECTGROUPADDGROUP.CAPTION= Přidat skupinu10 TMAINFORM.AOBJECTGROUPADDOBJECT.CAPTION= Přidat objekt11 TMAINFORM.AOBJECTGROUPEDIT.CAPTION= Upravit12 TMAINFORM.AOBJECTDELETE.CAPTION= Odstranit13 TMAINFORM.AOBJECTEDIT.CAPTION= Upravit2 TMAINFORM.LABEL1.CAPTION=Groups: 3 TMAINFORM.LABEL2.CAPTION=Reports: 4 TMAINFORM.AITEMDELETE.CAPTION=Delete 5 TMAINFORM.AITEMADD.CAPTION=Add 6 TMAINFORM.AITEMEDIT.CAPTION=Edit 7 TMAINFORM.AITEMVIEW.CAPTION=View 8 TMAINFORM.AOBJECTGROUPDELETE.CAPTION=Delete 9 TMAINFORM.AOBJECTGROUPADDGROUP.CAPTION=Add group 10 TMAINFORM.AOBJECTGROUPADDOBJECT.CAPTION=Add object 11 TMAINFORM.AOBJECTGROUPEDIT.CAPTION=Edit 12 TMAINFORM.AOBJECTDELETE.CAPTION=Delete 13 TMAINFORM.AOBJECTEDIT.CAPTION=Edit 14 14 TMAINFORM.AEXIT.CAPTION=Exit 15 TMAINFORM.ATOGGLEFULLSCREEN.CAPTION=Fullscreen mode F1115 TMAINFORM.ATOGGLEFULLSCREEN.CAPTION=Fullscreen mode 16 16 TMAINFORM.MENUITEM13.CAPTION=Server 17 17 TMAINFORM.MENUITEM11.CAPTION=View -
trunk/Forms/UMainForm.pas
r6 r7 100 100 MainForm: TMainForm; 101 101 102 resourcestring 103 SItemNotFound = 'Item not found'; 104 SObjectNotFound = 'Object not found'; 105 106 102 107 implementation 103 108 … … 129 134 Database.HostName := TextContent; 130 135 if NodeName = 'schema' then 131 Database. Schema:= TextContent;136 Database.Database := TextContent; 132 137 if NodeName = 'username' then 133 138 Database.UserName := TextContent; … … 306 311 TopItem.SelectedIndex := 0; 307 312 try 308 DbRows := Database.Query('SELECT * FROM `ObjectGroup`'); 313 DbRows := TDbRows.Create; 314 Database.Query(DbRows, 'SELECT * FROM `ObjectGroup`'); 309 315 for I := 0 to DbRows.Count - 1 do begin 310 316 NewNode := AddChild(TopItem, DbRows[I].Values['Name']); … … 313 319 NewNode.Data := Pointer(StrToInt(DbRows[I].Values['Id'])); 314 320 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']); 316 323 for O := 0 to ObjectDbRows.Count - 1 do begin 317 324 NewObjectNode := AddChild(NewNode, ObjectDbRows[O].Values['Name']); … … 348 355 Clear; 349 356 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))); 351 359 if DbRows.Count = 1 then begin 352 360 SelectedObject := StrToInt(DbRows[0].Values['Id']); … … 354 362 // Load column names 355 363 try 356 Properties := Database.Query('SELECT * FROM `Property` WHERE `Object`=' + 364 Properties := TDbRows.Create; 365 Database.Query(Properties, 'SELECT * FROM `Property` WHERE `Object`=' + 357 366 DbRows[0].Values['Id']); 358 367 Columns.Clear; … … 371 380 // Load items 372 381 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'] + '`.`' + 374 384 DbRows[0].Values['Table'] + '`'); 375 385 for I := 0 to Values.Count - 1 do begin
Note:
See TracChangeset
for help on using the changeset viewer.