Changeset 4
- Timestamp:
- Jun 3, 2010, 5:25:10 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 9 added
- 2 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UItemEdit.lfm
r3 r4 4 4 Top = 175 5 5 Width = 558 6 ActiveControl = Panel1 6 7 Caption = 'ItemEditForm' 7 8 ClientHeight = 429 -
trunk/Forms/UItemEdit.pas
r3 r4 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, 9 StdCtrls, USqlDatabase;9 StdCtrls, Spin, EditBtn, USqlDatabase; 10 10 11 11 type … … 70 70 Column: Integer; 71 71 ObjectInfo: TDbRows; 72 ValueType: Integer; 72 73 const 73 74 ColumnCount = 2; … … 95 96 TLabel(NewControl).Caption := Properties[I].Values['Name'] + ':'; 96 97 97 NewControl := TEdit.Create(Panel1); 98 NewControl.Parent := Panel1; 99 NewControl.Top := LastTop; 100 NewControl.Left := Column * Width div ColumnCount + (Width div ColumnCount) div 2; 101 TEdit(NewControl).Text := Values[0].Values[Properties[I].Values['ColumnName']]; 102 TEdit(NewControl).Width := (Width div ColumnCount) div 2 - 20; 98 ValueType := StrToInt(Properties[I].Values['Type']); 99 if ValueType = Integer(vtInteger) then begin 100 NewControl := TSpinEdit.Create(Panel1); 101 NewControl.Parent := Panel1; 102 NewControl.Top := LastTop; 103 NewControl.Left := Column * Width div ColumnCount + (Width div ColumnCount) div 2; 104 TSpinEdit(NewControl).Value := StrToInt(Values[0].Values[Properties[I].Values['ColumnName']]); 105 TSpinEdit(NewControl).Width := (Width div ColumnCount) div 2 - 20; 106 end else 107 if ValueType = Integer(vtDate) then begin 108 NewControl := TDateEdit.Create(Panel1); 109 NewControl.Parent := Panel1; 110 NewControl.Top := LastTop; 111 NewControl.Left := Column * Width div ColumnCount + (Width div ColumnCount) div 2; 112 TDateEdit(NewControl).Date := StrToDate(Values[0].Values[Properties[I].Values['ColumnName']]); 113 TDateEdit(NewControl).Width := (Width div ColumnCount) div 2 - 20; 114 end else 115 if ValueType = Integer(vtFloat) then begin 116 NewControl := TFloatSpinEdit.Create(Panel1); 117 NewControl.Parent := Panel1; 118 NewControl.Top := LastTop; 119 NewControl.Left := Column * Width div ColumnCount + (Width div ColumnCount) div 2; 120 TFloatSpinEdit(NewControl).Value := StrToFloat(Values[0].Values[Properties[I].Values['ColumnName']]); 121 TFloatSpinEdit(NewControl).Width := (Width div ColumnCount) div 2 - 20; 122 end else 123 if ValueType = Integer(vtString) then begin 124 NewControl := TEdit.Create(Panel1); 125 NewControl.Parent := Panel1; 126 NewControl.Top := LastTop; 127 NewControl.Left := Column * Width div ColumnCount + (Width div ColumnCount) div 2; 128 TEdit(NewControl).Text := Values[0].Values[Properties[I].Values['ColumnName']]; 129 TEdit(NewControl).Width := (Width div ColumnCount) div 2 - 20; 130 end; 103 131 104 132 Column := (Column + 1) mod 2; -
trunk/Forms/UMainForm.lfm
r3 r4 1 1 object MainForm: TMainForm 2 Left = 3 592 Left = 317 3 3 Height = 445 4 Top = 1244 Top = 97 5 5 Width = 649 6 ActiveControl = ListView17 6 Caption = 'ChronIS' 8 7 ClientHeight = 445 … … 10 9 OnClose = FormClose 11 10 OnCreate = FormCreate 11 OnDestroy = FormDestroy 12 12 OnShow = FormShow 13 13 LCLVersion = '0.9.29' 14 object TreeView1: TTreeView 15 Left = 8 16 Height = 419 17 Top = 19 18 Width = 171 19 Anchors = [akTop, akLeft, akBottom] 20 DefaultItemHeight = 15 21 ReadOnly = True 14 object Panel1: TPanel 15 Left = 0 16 Height = 445 17 Top = 0 18 Width = 184 19 Align = alLeft 20 BevelOuter = bvNone 21 ClientHeight = 445 22 ClientWidth = 184 22 23 TabOrder = 0 23 OnChange = TreeView1Change 24 Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips, tvoThemedDraw] 25 end 26 object ListView1: TListView 24 object Label1: TLabel 25 Left = 7 26 Height = 14 27 Top = 4 28 Width = 47 29 Caption = 'Skupiny:' 30 ParentColor = False 31 end 32 object TreeView1: TTreeView 33 Left = 8 34 Height = 413 35 Top = 19 36 Width = 176 37 Anchors = [akTop, akLeft, akRight, akBottom] 38 DefaultItemHeight = 16 39 Images = ImageListActions 40 ReadOnly = True 41 TabOrder = 0 42 OnChange = TreeView1Change 43 Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips, tvoThemedDraw] 44 end 45 end 46 object Panel2: TPanel 47 Left = 189 48 Height = 445 49 Top = 0 50 Width = 460 51 Align = alClient 52 BevelOuter = bvNone 53 ClientHeight = 445 54 ClientWidth = 460 55 TabOrder = 1 56 object Label2: TLabel 57 Left = 11 58 Height = 14 59 Top = 4 60 Width = 38 61 Caption = 'Výpisy:' 62 ParentColor = False 63 end 64 object ListView1: TListView 65 Left = 3 66 Height = 389 67 Top = 19 68 Width = 450 69 Anchors = [akTop, akLeft, akRight, akBottom] 70 Columns = <> 71 ItemIndex = -1 72 PopupMenu = PopupMenuItem 73 ReadOnly = True 74 RowSelect = True 75 TabOrder = 0 76 ViewStyle = vsReport 77 OnDblClick = ListView1DblClick 78 OnKeyPress = ListView1KeyPress 79 OnResize = ListView1Resize 80 OnSelectItem = ListView1SelectItem 81 end 82 object ButtonAdd: TButton 83 Left = 3 84 Height = 25 85 Top = 416 86 Width = 75 87 Action = AItemAdd 88 Anchors = [akLeft, akBottom] 89 TabOrder = 1 90 end 91 object ButtonRemove: TButton 92 Left = 83 93 Height = 25 94 Top = 416 95 Width = 75 96 Action = AItemDelete 97 Anchors = [akLeft, akBottom] 98 TabOrder = 2 99 end 100 end 101 object Splitter1: TSplitter 27 102 Left = 184 28 Height = 417 29 Top = 16 30 Width = 453 31 Anchors = [akTop, akLeft, akRight, akBottom] 32 Columns = <> 33 ItemIndex = -1 34 ReadOnly = True 35 RowSelect = True 36 TabOrder = 1 37 ViewStyle = vsReport 38 OnDblClick = ListView1DblClick 39 OnKeyPress = ListView1KeyPress 40 OnResize = ListView1Resize 41 OnSelectItem = ListView1SelectItem 42 end 43 object Label1: TLabel 44 Left = 7 45 Height = 14 46 Top = 4 47 Width = 47 48 Caption = 'Skupiny:' 49 ParentColor = False 50 end 51 object Label2: TLabel 52 Left = 187 53 Height = 14 54 Top = 4 55 Width = 38 56 Caption = 'Výpisy:' 57 ParentColor = False 103 Height = 445 104 Top = 0 105 Width = 5 106 end 107 object ActionListItem: TActionList 108 Images = ImageListActions 109 left = 360 110 top = 120 111 object AItemDelete: TAction 112 Category = 'Object' 113 Caption = 'Smazat' 114 end 115 object AItemAdd: TAction 116 Category = 'Object' 117 Caption = 'Přidat' 118 OnExecute = AItemAddExecute 119 end 120 object AItemEdit: TAction 121 Category = 'Object' 122 Caption = 'Upravit' 123 OnExecute = AItemEditExecute 124 end 125 object AItemView: TAction 126 Category = 'Object' 127 Caption = 'Zobrazit' 128 OnExecute = AItemViewExecute 129 end 130 object AObjectGroupDelete: TAction 131 Category = 'ObjectGroup' 132 Caption = 'Odebrat' 133 end 134 object AObjectGroupAddGroup: TAction 135 Category = 'ObjectGroup' 136 Caption = 'Přidat skupinu' 137 OnExecute = AObjectGroupAddGroupExecute 138 end 139 object AObjectGroupAddObject: TAction 140 Category = 'ObjectGroup' 141 Caption = 'Přidat objekt' 142 end 143 object AObjectGroupEdit: TAction 144 Category = 'ObjectGroup' 145 Caption = 'Upravit' 146 end 147 end 148 object PopupMenuItem: TPopupMenu 149 Images = ImageListActions 150 left = 256 151 top = 120 152 object MenuItem1: TMenuItem 153 Action = AItemView 154 Default = True 155 OnClick = AItemViewExecute 156 end 157 object MenuItem4: TMenuItem 158 Action = AItemEdit 159 OnClick = AItemEditExecute 160 end 161 object MenuItem3: TMenuItem 162 Action = AItemDelete 163 end 164 object MenuItem2: TMenuItem 165 Action = AItemAdd 166 end 167 end 168 object PopupMenuObject: TPopupMenu 169 Images = ImageListActions 170 left = 72 171 top = 136 172 end 173 object PopupMenuObjectGroup: TPopupMenu 174 Images = ImageListActions 175 left = 72 176 top = 88 177 object MenuItem5: TMenuItem 178 Action = AObjectGroupAddGroup 179 end 180 object MenuItem7: TMenuItem 181 Action = AObjectGroupAddObject 182 end 183 object MenuItem8: TMenuItem 184 Action = AObjectGroupEdit 185 end 186 object MenuItem6: TMenuItem 187 Action = AObjectGroupDelete 188 end 189 end 190 object ImageListActions: TImageList 191 left = 256 192 top = 56 193 Bitmap = { 194 4C69020000001000000010000000000000000000000000000000000000000000 195 0000000000000000000000000000000000000000000000000000000000000000 196 000000000000000000000000000000000000000000000000000000000000F4F9 197 FFFF4195EFFF2F8AF1FF2F8DF3FF2F8DF3FF2F8DF3FF2F8BF1FF2F8BEFFFE9F2 198 FEFF00000000000000000000000000000000000000000000000000000000F0F6 199 FEFF239AFCFF21CFFFFF24CCFFFF24CCFFFF24CCFFFF23D1FFFF1C9FFFFFE2EE 200 FDFF00000000000000000000000000000000000000000000000000000000F1F7 201 FEFF32A2FBFF36DBFFFF39D8FFFF39D8FFFF39D8FFFF3ADEFFFF26A5FFFFE3EE 202 FDFF00000000000000000000000000000000000000000000000000000000F0F6 203 FEFF3CABFCFF58F6FFFF59F1FFFF58F1FFFF59F1FFFF5CF9FFFF35B2FFFFE2ED 204 FDFF00000000000000000000000000000000000000000000000000000000F1F7 205 FFFF2F9AF6FF3ECBFFFF3BC7FFFF36C5FFFF3BC6FFFF40CEFFFF299EF9FFE4EF 206 FEFF00000000000000000000000000000000000000000000000000000000FEFE 207 FEFFB8D3F4FFA9BFEFFF9FC0EEFF567BACFF91B9EAFFA9BFEFFFADCCF3FFFCFC 208 FDFF000000000000000000000000000000000000000000000000FFFFFFFFFAFA 209 FAFFFDFDFDFFFDFDFDFFF5F5F6FF9F978EFFE9EAEAFFFDFDFDFFFDFDFDFFFAFA 210 FAFFFEFEFEFF0000000000000000000000000000000000000000EDF2F8FF7A7E 211 83FF979694FF9A9896FF8D8D8FFF7E7F80FF8F8E8AFF999796FF989795FF8282 212 7DFFE9EBE9FF000000000000000000000000FFF3DCFFFFEED0FFE7D2AEFFC0AB 213 88FFFAECD3FFFBEDD5FFFCFAF6FF00000000F9F9FBFFD8D7EDFFD5D4EBFF9492 214 B8FFA4A4C7FFD3D2EEFFDADAF1FF00000000FCB02CFFFFBC35FFFFB72BFFFFB8 215 2DFFFFC035FFFFB726FFFFE2A5FF00000000C2C2EBFF000FC6FF0013D6FF0005 216 CCFF0004C9FF0021D9FF0C20C0FF00000000FEB12FFFFFDA6AFFFFD862FFFFD8 217 64FFFFDA69FFFFC748FFFFD9A6FF00000000C3C3E7FF001CE2FF003AFFFF003F 218 FFFF003BFFFF0034FFFF1018CCFF00000000FFB93BFFFFEB89FFFFE782FFFFE7 219 82FFFFEB88FFFFD561FFFFDAA6FF00000000C3C3E7FF0029E2FF0B5DFFFF0E61 220 FFFF0B5CFFFF044CFFFF111CCDFF00000000FFC34CFFFFFFCEFFFFFFC3FFFFFF 221 C3FFFFFFCBFFFFF094FFFFD8A4FF00000000C2C2E7FF003EE9FF1E8CFFFF2190 222 FFFF1D88FFFF136FFFFF0D23CFFF00000000FBB73DFFFFCE5BFFFFCB58FFFFCB 223 58FFFFCD5AFFFFC044FFFFE0ACFF00000000C7C7EBFF1123C2FF1143D3FF1149 224 D6FF1143D1FF1133D2FF2121B5FF000000000000000000000000000000000000 225 0000000000000000000000000000000000000000000000000000000000000000 226 0000000000000000000000000000000000000000000000000000000000000000 227 0000000000000000000000000000000000000000000000000000000000000000 228 0000000000000000000000000000000000000000000000000000000000000000 229 0000000000000000000000000000000000000000000000000000000000000000 230 0000000000000000000000000000000000000000000000000000000000000000 231 0000C0C0C0FFC0C0C0FF808080FF808080FF808080FF808080FF808080FF8080 232 80FF808080FF000000000000000000000000000000000000000000000000C0C0 233 C0FFC0C0C0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8080 234 80FF808080FF0000000000000000000000000000000000000000C0C0C0FFFFFF 235 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF808080FFC0C0 236 C0FF000000FF00000000000000000000000000000000808080FFFFFFFFFFFFFF 237 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF808080FFC0C0C0FFC0C0 238 C0FF000000FF00000000000000000000000000000000808080FF808080FF8080 239 80FF808080FF808080FF808080FF808080FF808080FFC0C0C0FFC0C0C0FF8080 240 80FF000000FF00000000000000000000000000000000808080FFFFFFFFFFFFFF 241 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF808080FFC0C0C0FFC0C0C0FF8080 242 80FF000000FF00000000000000000000000000000000808080FFFFFFFFFFFFFF 243 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF808080FFC0C0C0FFC0C0C0FF8080 244 80FF000000FF00000000000000000000000000000000808080FFFFFFFFFFFFFF 245 FFFFFFFFFFFFFFFFFFFFFFFFFFFFC0C0C0FF000000FFC0C0C0FF808080FFC0C0 246 C0FF000000FF00000000000000000000000000000000808080FFFFFFFFFFFFFF 247 FFFFFFFFFFFFFFFFFFFFC0C0C0FFFFFFFFFF000000FFC0C0C0FF808080FF0000 248 00FF808080FFC0C0C0FF000000000000000000000000808080FFFFFFFFFFFFFF 249 FFFFFFFFFFFFC0C0C0FFFFFFFFFFC0C0C0FF000000FFC0C0C0FF000000FF8080 250 80FFC0C0C0FFC0C0C0FF000000000000000000000000808080FFFFFFFFFFFFFF 251 FFFFC0C0C0FFFFFFFFFFC0C0C0FFFFFFFFFF000000FF000000FF808080FFC0C0 252 C0FFC0C0C0FF00000000000000000000000000000000808080FF808080FF8080 253 80FF000000FF000000FF000000FF000000FF000000FF808080FFC0C0C0FF0000 254 0000000000000000000000000000000000000000000000000000000000000000 255 0000000000000000000000000000000000000000000000000000000000000000 256 0000000000000000000000000000000000000000000000000000000000000000 257 0000000000000000000000000000000000000000000000000000000000000000 258 0000000000000000000000000000 259 } 58 260 end 59 261 end -
trunk/Forms/UMainForm.pas
r3 r4 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 9 StdCtrls, USqlDatabase, DOM, XMLRead, XMLWrite, UPersistentForm, UItemView; 9 StdCtrls, ActnList, Menus, ExtCtrls, USqlDatabase, DOM, XMLRead, XMLWrite, 10 UPersistentForm, UTreeState; 10 11 11 12 const … … 13 14 14 15 type 16 TValueType = (vtNone, vtInteger, vtString, vtText, vtDateTime, vtFloat, vtImage, vtBoolean, 17 vtIPv4, vtMAC, vtIPv6, vtFile, vtGPS, vtEnumeration, vtHyperlink, vtPassword, 18 vtReference, vtDate, vtTime, vtColor); 15 19 16 20 { TMainForm } 17 21 18 22 TMainForm = class(TForm) 23 AObjectGroupEdit: TAction; 24 AObjectGroupAddObject: TAction; 25 AObjectGroupAddGroup: TAction; 26 AObjectGroupDelete: TAction; 27 AItemView: TAction; 28 AItemEdit: TAction; 29 AItemAdd: TAction; 30 AItemDelete: TAction; 31 ActionListItem: TActionList; 32 ButtonAdd: TButton; 33 ButtonRemove: TButton; 34 ImageListActions: TImageList; 19 35 Label1: TLabel; 20 36 Label2: TLabel; 21 37 ListView1: TListView; 38 MenuItem1: TMenuItem; 39 MenuItem2: TMenuItem; 40 MenuItem3: TMenuItem; 41 MenuItem4: TMenuItem; 42 MenuItem5: TMenuItem; 43 MenuItem6: TMenuItem; 44 MenuItem7: TMenuItem; 45 MenuItem8: TMenuItem; 46 Panel1: TPanel; 47 Panel2: TPanel; 48 PopupMenuObjectGroup: TPopupMenu; 49 PopupMenuObject: TPopupMenu; 50 PopupMenuItem: TPopupMenu; 51 Splitter1: TSplitter; 22 52 TreeView1: TTreeView; 53 procedure AItemAddExecute(Sender: TObject); 54 procedure AItemEditExecute(Sender: TObject); 55 procedure AItemViewExecute(Sender: TObject); 56 procedure AObjectGroupAddGroupExecute(Sender: TObject); 57 procedure ButtonAddClick(Sender: TObject); 23 58 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 24 59 procedure FormCreate(Sender: TObject); 60 procedure FormDestroy(Sender: TObject); 25 61 procedure FormShow(Sender: TObject); 26 62 procedure ListView1DblClick(Sender: TObject); … … 37 73 PersistentForm: TPersistentForm; 38 74 Database: TSQLDatabase; 75 TreeState: TTreeState; 39 76 procedure LoadTree; 40 77 procedure LoadItemList; … … 45 82 46 83 implementation 84 85 uses 86 UItemView, UItemEdit; 47 87 48 88 {$R *.lfm} … … 87 127 LoadConfiguration; 88 128 Database.Connect; 129 TreeState := TTreeState.Create; 89 130 PersistentForm := TPersistentForm.Create; 90 131 end; 91 132 133 procedure TMainForm.FormDestroy(Sender: TObject); 134 begin 135 TreeState.Destroy; 136 Database.Destroy; 137 PersistentForm.Destroy; 138 end; 139 92 140 procedure TMainForm.FormClose(Sender: TObject; var CloseAction: TCloseAction); 93 141 begin 94 142 PersistentForm.Save(Self); 143 end; 144 145 procedure TMainForm.ButtonAddClick(Sender: TObject); 146 begin 147 148 end; 149 150 procedure TMainForm.AItemViewExecute(Sender: TObject); 151 begin 152 ItemViewForm.Show; 153 end; 154 155 procedure TMainForm.AObjectGroupAddGroupExecute(Sender: TObject); 156 begin 157 158 end; 159 160 procedure TMainForm.AItemEditExecute(Sender: TObject); 161 begin 162 ItemEditForm.Show; 163 end; 164 165 procedure TMainForm.AItemAddExecute(Sender: TObject); 166 begin 167 95 168 end; 96 169 … … 103 176 procedure TMainForm.ListView1DblClick(Sender: TObject); 104 177 begin 105 ItemViewForm.Show;178 AItemViewExecute(Self); 106 179 end; 107 180 108 181 procedure TMainForm.ListView1KeyPress(Sender: TObject; var Key: char); 109 182 begin 110 if Key = #13 then ListView1DblClick(Sender);183 if Key = #13 then AItemViewExecute(Self); 111 184 end; 112 185 … … 125 198 SelectedItem := Integer(ListView1.Selected.Data) 126 199 else SelectedItem := 0; 200 201 AItemDelete.Enabled := Assigned(ListView1.Selected); 202 AItemView.Enabled := Assigned(ListView1.Selected); 203 AItemEdit.Enabled := Assigned(ListView1.Selected); 127 204 end; 128 205 … … 130 207 begin 131 208 LoadItemList; 209 AObjectGroupDelete.Enabled := Assigned(TreeView1.Selected); 210 AObjectGroupEdit.Enabled := Assigned(TreeView1.Selected); 211 if Assigned(TreeView1.Selected) then begin 212 if TreeView1.Selected.ImageIndex = 0 then 213 TreeView1.PopupMenu := PopupMenuObjectGroup; 214 if TreeView1.Selected.ImageIndex = 1 then 215 TreeView1.PopupMenu := PopupMenuObject; 216 end; 132 217 end; 133 218 … … 142 227 begin 143 228 with TreeView1, Items do begin 229 TreeState.SaveTree(TreeView1); 144 230 Clear; 145 231 AddChild(nil, 'Skupiny'); 146 DbRows := Database.Query('SELECT * FROM `MenuGroup`'); 232 TopItem.ImageIndex := 0; 233 TopItem.SelectedIndex := 0; 234 DbRows := Database.Query('SELECT * FROM `ObjectGroup`'); 147 235 for I := 0 to DbRows.Count - 1 do begin 148 236 NewNode := AddChild(TopItem, DbRows[I].Values['Name']); 149 ObjectDbRows := Database.Query('SELECT * FROM `Object` WHERE `MenuGroup`=' + DbRows[I].Values['Id']); 237 NewNode.ImageIndex := 0; 238 NewNode.SelectedIndex := 0; 239 ObjectDbRows := Database.Query('SELECT * FROM `Object` WHERE `Group`=' + DbRows[I].Values['Id']); 150 240 for O := 0 to ObjectDbRows.Count - 1 do begin 151 241 NewObjectNode := AddChild(NewNode, ObjectDbRows[O].Values['Name']); 152 NewObjectNode.ImageIndex := StrToInt(ObjectDbRows[O].Values['Id']); 242 NewObjectNode.Data := Pointer(StrToInt(ObjectDbRows[O].Values['Id'])); 243 NewObjectNode.ImageIndex := 1; 244 NewObjectNode.SelectedIndex := 1; 153 245 end; 154 246 ObjectDbRows.Destroy; … … 156 248 TopItem.Expand(True); 157 249 DbRows.Destroy; 250 TreeState.LoadTree(TreeView1); 158 251 end; 159 252 end; … … 173 266 with ListView1, Items do begin 174 267 Clear; 175 DbRows := Database.Query('SELECT * FROM `Object` WHERE `Id`=' + IntToStr( TreeView1.Selected.ImageIndex));268 DbRows := Database.Query('SELECT * FROM `Object` WHERE `Id`=' + IntToStr(Integer(TreeView1.Selected.Data))); 176 269 if DbRows.Count = 1 then begin 177 270 SelectedObject := StrToInt(DbRows[0].Values['Id']); -
trunk/chronis.lpi
r3 r4 37 37 </Item1> 38 38 </RequiredPackages> 39 <Units Count="1 3">39 <Units Count="16"> 40 40 <Unit0> 41 41 <Filename Value="chronis.lpr"/> 42 42 <IsPartOfProject Value="True"/> 43 43 <UnitName Value="chronis"/> 44 <EditorIndex Value="4"/> 45 <WindowIndex Value="0"/> 44 <IsVisibleTab Value="True"/> 45 <EditorIndex Value="0"/> 46 <WindowIndex Value="1"/> 46 47 <TopLine Value="1"/> 47 <CursorPos X="59" Y="2 2"/>48 <UsageCount Value="14 4"/>48 <CursorPos X="59" Y="23"/> 49 <UsageCount Value="148"/> 49 50 <Loaded Value="True"/> 50 51 </Unit0> … … 83 84 <ResourceBaseClass Value="Form"/> 84 85 <UnitName Value="UMainForm"/> 85 <EditorIndex Value="0"/> 86 <WindowIndex Value="0"/> 87 <TopLine Value="87"/> 88 <CursorPos X="26" Y="95"/> 89 <FoldState Value=" T0iFbM3i"/> 86 <WindowIndex Value="0"/> 87 <TopLine Value="118"/> 88 <CursorPos X="25" Y="144"/> 90 89 <UsageCount Value="136"/> 91 <Loaded Value="True"/>92 90 </Unit4> 93 91 <Unit5> … … 106 104 <IsPartOfProject Value="True"/> 107 105 <UnitName Value="UPersistentForm"/> 108 <EditorIndex Value=" 3"/>106 <EditorIndex Value="4"/> 109 107 <WindowIndex Value="0"/> 110 108 <TopLine Value="42"/> 111 109 <CursorPos X="33" Y="46"/> 112 <SyntaxHighlighter Value="FreePascal"/> 113 <UsageCount Value="134"/> 114 <Loaded Value="True"/> 115 <DefaultSyntaxHighlighter Value="Text"/> 110 <UsageCount Value="138"/> 111 <Loaded Value="True"/> 116 112 </Unit6> 117 113 <Unit7> … … 119 115 <IsPartOfProject Value="True"/> 120 116 <UnitName Value="USqlDatabase"/> 121 <UsageCount Value="134"/> 122 <DefaultSyntaxHighlighter Value="Text"/> 117 <EditorIndex Value="2"/> 118 <WindowIndex Value="0"/> 119 <TopLine Value="385"/> 120 <CursorPos X="1" Y="374"/> 121 <UsageCount Value="138"/> 122 <Loaded Value="True"/> 123 123 </Unit7> 124 124 <Unit8> … … 129 129 <TopLine Value="32"/> 130 130 <CursorPos X="21" Y="13"/> 131 <SyntaxHighlighter Value="FreePascal"/> 132 <UsageCount Value="134"/> 133 <DefaultSyntaxHighlighter Value="Text"/> 131 <UsageCount Value="138"/> 134 132 </Unit8> 135 133 <Unit9> … … 139 137 <ResourceBaseClass Value="Form"/> 140 138 <UnitName Value="UItemView"/> 141 <IsVisibleTab Value="True"/> 142 <EditorIndex Value="1"/> 143 <WindowIndex Value="0"/> 144 <TopLine Value="45"/> 145 <CursorPos X="3" Y="61"/> 146 <UsageCount Value="30"/> 139 <EditorIndex Value="0"/> 140 <WindowIndex Value="0"/> 141 <TopLine Value="68"/> 142 <CursorPos X="30" Y="100"/> 143 <UsageCount Value="34"/> 147 144 <Loaded Value="True"/> 148 145 </Unit9> … … 153 150 <ResourceBaseClass Value="Form"/> 154 151 <UnitName Value="UItemEdit"/> 155 <EditorIndex Value=" 2"/>156 <WindowIndex Value="0"/> 157 <TopLine Value=" 2"/>158 <CursorPos X=" 33" Y="17"/>159 <UsageCount Value="2 0"/>152 <EditorIndex Value="1"/> 153 <WindowIndex Value="0"/> 154 <TopLine Value="93"/> 155 <CursorPos X="7" Y="114"/> 156 <UsageCount Value="25"/> 160 157 <Loaded Value="True"/> 161 158 </Unit10> … … 165 162 <HasResources Value="True"/> 166 163 <UnitName Value="ULoginForm"/> 167 <UsageCount Value="20"/> 168 <DefaultSyntaxHighlighter Value="Text"/> 164 <UsageCount Value="24"/> 169 165 </Unit11> 170 166 <Unit12> 171 167 <Filename Value="Forms/UMainForm.pas"/> 172 168 <IsPartOfProject Value="True"/> 169 <ComponentName Value="MainForm"/> 173 170 <HasResources Value="True"/> 171 <ResourceBaseClass Value="Form"/> 174 172 <UnitName Value="UMainForm"/> 175 <UsageCount Value="20"/> 173 <IsVisibleTab Value="True"/> 174 <EditorIndex Value="3"/> 175 <WindowIndex Value="0"/> 176 <TopLine Value="253"/> 177 <CursorPos X="112" Y="268"/> 178 <UsageCount Value="24"/> 179 <Loaded Value="True"/> 180 </Unit12> 181 <Unit13> 182 <Filename Value="../../../lazarus/trunk/lcl/controls.pp"/> 183 <UnitName Value="Controls"/> 184 <WindowIndex Value="0"/> 185 <TopLine Value="1399"/> 186 <CursorPos X="14" Y="1418"/> 187 <SyntaxHighlighter Value="FreePascal"/> 188 <UsageCount Value="10"/> 176 189 <DefaultSyntaxHighlighter Value="Text"/> 177 </Unit12> 190 </Unit13> 191 <Unit14> 192 <Filename Value="../../../lazarus/trunk/lcl/spin.pp"/> 193 <UnitName Value="Spin"/> 194 <WindowIndex Value="0"/> 195 <TopLine Value="129"/> 196 <CursorPos X="3" Y="148"/> 197 <SyntaxHighlighter Value="FreePascal"/> 198 <UsageCount Value="10"/> 199 <DefaultSyntaxHighlighter Value="Text"/> 200 </Unit14> 201 <Unit15> 202 <Filename Value="Common/UTreeState.pas"/> 203 <IsPartOfProject Value="True"/> 204 <UnitName Value="UTreeState"/> 205 <UsageCount Value="21"/> 206 <DefaultSyntaxHighlighter Value="Text"/> 207 </Unit15> 178 208 </Units> 179 209 <JumpHistory Count="30" HistoryIndex="29"> 180 210 <Position1> 181 <Filename Value="Forms/UItem View.pas"/>182 <Caret Line=" 87" Column="40" TopLine="74"/>211 <Filename Value="Forms/UItemEdit.pas"/> 212 <Caret Line="109" Column="33" TopLine="90"/> 183 213 </Position1> 184 214 <Position2> 185 <Filename Value=" UMainForm.pas"/>186 <Caret Line="1 46" Column="28" TopLine="92"/>215 <Filename Value="Forms/UItemEdit.pas"/> 216 <Caret Line="108" Column="33" TopLine="89"/> 187 217 </Position2> 188 218 <Position3> 189 <Filename Value=" UMainForm.pas"/>190 <Caret Line=" 40" Column="23" TopLine="12"/>219 <Filename Value="Forms/UItemEdit.pas"/> 220 <Caret Line="116" Column="36" TopLine="89"/> 191 221 </Position3> 192 222 <Position4> 193 <Filename Value=" UMainForm.pas"/>194 <Caret Line="1 98" Column="92" TopLine="171"/>223 <Filename Value="Forms/UMainForm.pas"/> 224 <Caret Line="18" Column="39" TopLine="1"/> 195 225 </Position4> 196 226 <Position5> 197 <Filename Value="Forms/U ItemView.pas"/>198 <Caret Line=" 43" Column="1" TopLine="27"/>227 <Filename Value="Forms/UMainForm.pas"/> 228 <Caret Line="189" Column="41" TopLine="182"/> 199 229 </Position5> 200 230 <Position6> 201 <Filename Value=" Common/UPersistentForm.pas"/>202 <Caret Line=" 62" Column="1" TopLine="42"/>231 <Filename Value="Forms/UMainForm.pas"/> 232 <Caret Line="185" Column="29" TopLine="166"/> 203 233 </Position6> 204 234 <Position7> 205 <Filename Value=" Common/UPersistentForm.pas"/>206 <Caret Line=" 63" Column="1" TopLine="42"/>235 <Filename Value="Forms/UMainForm.pas"/> 236 <Caret Line="218" Column="23" TopLine="194"/> 207 237 </Position7> 208 238 <Position8> 209 <Filename Value=" Common/UPersistentForm.pas"/>210 <Caret Line=" 64" Column="1" TopLine="42"/>239 <Filename Value="Forms/UMainForm.pas"/> 240 <Caret Line="219" Column="23" TopLine="195"/> 211 241 </Position8> 212 242 <Position9> 213 <Filename Value=" Common/UPersistentForm.pas"/>214 <Caret Line=" 65" Column="1" TopLine="42"/>243 <Filename Value="Forms/UMainForm.pas"/> 244 <Caret Line="220" Column="23" TopLine="196"/> 215 245 </Position9> 216 246 <Position10> 217 <Filename Value="Forms/U ItemView.pas"/>218 <Caret Line=" 76" Column="15" TopLine="76"/>247 <Filename Value="Forms/UMainForm.pas"/> 248 <Caret Line="221" Column="23" TopLine="197"/> 219 249 </Position10> 220 250 <Position11> 221 <Filename Value="Forms/U ItemView.pas"/>222 <Caret Line=" 77" Column="15" TopLine="77"/>251 <Filename Value="Forms/UMainForm.pas"/> 252 <Caret Line="196" Column="1" TopLine="185"/> 223 253 </Position11> 224 254 <Position12> 225 <Filename Value="Forms/U ItemView.pas"/>226 <Caret Line=" 76" Column="15" TopLine="76"/>255 <Filename Value="Forms/UMainForm.pas"/> 256 <Caret Line="55" Column="15" TopLine="36"/> 227 257 </Position12> 228 258 <Position13> 229 <Filename Value="Forms/U ItemView.pas"/>230 <Caret Line=" 77" Column="15" TopLine="77"/>259 <Filename Value="Forms/UMainForm.pas"/> 260 <Caret Line="233" Column="32" TopLine="213"/> 231 261 </Position13> 232 262 <Position14> 233 <Filename Value="Forms/U ItemView.pas"/>234 <Caret Line=" 78" Column="15" TopLine="78"/>263 <Filename Value="Forms/UMainForm.pas"/> 264 <Caret Line="230" Column="12" TopLine="214"/> 235 265 </Position14> 236 266 <Position15> 237 <Filename Value="Forms/U ItemEdit.pas"/>238 <Caret Line=" 8" Column="26" TopLine="1"/>267 <Filename Value="Forms/UMainForm.pas"/> 268 <Caret Line="231" Column="12" TopLine="215"/> 239 269 </Position15> 240 270 <Position16> 241 <Filename Value="Forms/U ItemView.pas"/>242 <Caret Line=" 65" Column="23" TopLine="54"/>271 <Filename Value="Forms/UMainForm.pas"/> 272 <Caret Line="230" Column="12" TopLine="214"/> 243 273 </Position16> 244 274 <Position17> 245 <Filename Value="Forms/U ItemView.pas"/>246 <Caret Line=" 64" Column="23" TopLine="53"/>275 <Filename Value="Forms/UMainForm.pas"/> 276 <Caret Line="231" Column="12" TopLine="215"/> 247 277 </Position17> 248 278 <Position18> 249 <Filename Value="Forms/U ItemEdit.pas"/>250 <Caret Line=" 8" Column="26" TopLine="1"/>279 <Filename Value="Forms/UMainForm.pas"/> 280 <Caret Line="230" Column="12" TopLine="214"/> 251 281 </Position18> 252 282 <Position19> 253 <Filename Value="Forms/U ItemEdit.pas"/>254 <Caret Line=" 9" Column="11" TopLine="1"/>283 <Filename Value="Forms/UMainForm.pas"/> 284 <Caret Line="229" Column="12" TopLine="213"/> 255 285 </Position19> 256 286 <Position20> 257 <Filename Value="Forms/U ItemEdit.pas"/>258 <Caret Line=" 38" Column="9" TopLine="3"/>287 <Filename Value="Forms/UMainForm.pas"/> 288 <Caret Line="230" Column="12" TopLine="214"/> 259 289 </Position20> 260 290 <Position21> 261 <Filename Value="Forms/U ItemEdit.pas"/>262 <Caret Line=" 44" Column="9" TopLine="9"/>291 <Filename Value="Forms/UMainForm.pas"/> 292 <Caret Line="231" Column="12" TopLine="215"/> 263 293 </Position21> 264 294 <Position22> 265 <Filename Value="Forms/U ItemEdit.pas"/>266 <Caret Line=" 52" Column="1" TopLine="15"/>295 <Filename Value="Forms/UMainForm.pas"/> 296 <Caret Line="232" Column="12" TopLine="216"/> 267 297 </Position22> 268 298 <Position23> 269 <Filename Value="Forms/U ItemEdit.pas"/>270 <Caret Line="2 6" Column="29" TopLine="1"/>299 <Filename Value="Forms/UMainForm.pas"/> 300 <Caret Line="231" Column="12" TopLine="215"/> 271 301 </Position23> 272 302 <Position24> 273 <Filename Value="Forms/U ItemEdit.pas"/>274 <Caret Line=" 35" Column="13" TopLine="1"/>303 <Filename Value="Forms/UMainForm.pas"/> 304 <Caret Line="230" Column="12" TopLine="214"/> 275 305 </Position24> 276 306 <Position25> 277 <Filename Value="Forms/U ItemEdit.pas"/>278 <Caret Line=" 63" Column="20" TopLine="44"/>307 <Filename Value="Forms/UMainForm.pas"/> 308 <Caret Line="229" Column="12" TopLine="213"/> 279 309 </Position25> 280 310 <Position26> 281 <Filename Value="Forms/U ItemView.pas"/>282 <Caret Line=" 9" Column="13" TopLine="76"/>311 <Filename Value="Forms/UMainForm.pas"/> 312 <Caret Line="228" Column="12" TopLine="212"/> 283 313 </Position26> 284 314 <Position27> 285 <Filename Value="Forms/U ItemView.pas"/>286 <Caret Line="2 6" Column="1" TopLine="1"/>315 <Filename Value="Forms/UMainForm.pas"/> 316 <Caret Line="229" Column="12" TopLine="213"/> 287 317 </Position27> 288 318 <Position28> 289 <Filename Value="Forms/U ItemView.pas"/>290 <Caret Line=" 35" Column="27" TopLine="1"/>319 <Filename Value="Forms/UMainForm.pas"/> 320 <Caret Line="230" Column="12" TopLine="214"/> 291 321 </Position28> 292 322 <Position29> 293 <Filename Value="Forms/U ItemView.pas"/>294 <Caret Line="2 4" Column="21" TopLine="16"/>323 <Filename Value="Forms/UMainForm.pas"/> 324 <Caret Line="231" Column="12" TopLine="215"/> 295 325 </Position29> 296 326 <Position30> 297 <Filename Value="Forms/U ItemView.pas"/>298 <Caret Line=" 55" Column="3" TopLine="53"/>327 <Filename Value="Forms/UMainForm.pas"/> 328 <Caret Line="232" Column="12" TopLine="216"/> 299 329 </Position30> 300 330 </JumpHistory> -
trunk/chronis.lpr
r3 r4 8 8 {$ENDIF}{$ENDIF} 9 9 Interfaces, // this includes the LCL widgetset 10 Forms, UPersistentForm, URegistry, USqlDatabase, 10 Forms, UPersistentForm, URegistry, USqlDatabase, UTreeState, 11 11 UItemView, UItemEdit, ULoginForm, UMainForm 12 12 { you can add units after this }; … … 16 16 begin 17 17 Application.Initialize; 18 Application.CreateForm(TMainForm, MainForm); 18 19 Application.CreateForm(TItemViewForm, ItemViewForm); 19 20 Application.CreateForm(TItemEditForm, ItemEditForm);
Note:
See TracChangeset
for help on using the changeset viewer.