Changeset 24
- Timestamp:
- Oct 21, 2011, 11:12:09 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UMainForm.lfm
r23 r24 6 6 ActiveControl = Panel1 7 7 Caption = 'ChronIS' 8 ClientHeight = 42 78 ClientHeight = 422 9 9 ClientWidth = 640 10 10 Menu = MainMenu1 … … 16 16 object Panel1: TPanel 17 17 Left = 0 18 Height = 42 718 Height = 422 19 19 Top = 0 20 20 Width = 184 21 21 Align = alLeft 22 22 BevelOuter = bvNone 23 ClientHeight = 42 723 ClientHeight = 422 24 24 ClientWidth = 184 25 25 TabOrder = 0 26 26 object Label1: TLabel 27 27 Left = 7 28 Height = 1 428 Height = 18 29 29 Top = 4 30 Width = 3930 Width = 51 31 31 Caption = 'Groups:' 32 32 ParentColor = False … … 34 34 object TreeView1: TTreeView 35 35 Left = 4 36 Height = 40336 Height = 398 37 37 Top = 19 38 38 Width = 180 39 39 Anchors = [akTop, akLeft, akRight, akBottom] 40 DefaultItemHeight = 1641 40 Images = ImageListActions 42 41 ReadOnly = True … … 48 47 object Panel2: TPanel 49 48 Left = 189 50 Height = 42 749 Height = 422 51 50 Top = 0 52 51 Width = 451 53 52 Align = alClient 54 53 BevelOuter = bvNone 55 ClientHeight = 42 754 ClientHeight = 422 56 55 ClientWidth = 451 57 56 TabOrder = 1 58 57 object Label2: TLabel 59 58 Left = 2 60 Height = 1 459 Height = 18 61 60 Top = 4 62 Width = 4361 Width = 54 63 62 Caption = 'Reports:' 64 63 ParentColor = False … … 66 65 object ListView1: TListView 67 66 Left = 2 68 Height = 3 7167 Height = 366 69 68 Top = 19 70 69 Width = 447 … … 86 85 Left = 3 87 86 Height = 25 88 Top = 39 887 Top = 393 89 88 Width = 75 90 89 Action = AItemAdd … … 95 94 Left = 83 96 95 Height = 25 97 Top = 39 896 Top = 393 98 97 Width = 75 99 98 Action = AItemDelete … … 104 103 object Splitter1: TSplitter 105 104 Left = 184 106 Height = 42 7105 Height = 422 107 106 Top = 0 108 107 Width = 5 -
trunk/Forms/UMainForm.pas
r21 r24 383 383 ') ENGINE=InnoDB DEFAULT CHARSET=utf8'); 384 384 end; 385 386 if Tables.IndexOf(ModuleTable) = -1 then begin 387 Database.Query(DbRows, 'CREATE TABLE IF NOT EXISTS `' + ModuleTable + '` ( ' + 388 '`Id` int(11) NOT NULL AUTO_INCREMENT,' + 389 '`Name` VARCHAR(255) NOT NULL,' + 390 '`Author` VARCHAR(255) NOT NULL,' + 391 '`Website` VARCHAR(255) NOT NULL,' + 392 '`Version` VARCHAR(255) NOT NULL,' + 393 '`License` VARCHAR(255) NOT NULL,' + 394 '`Description` TEXT NOT NULL,' + 395 'PRIMARY KEY (`Id`)' + 396 ') ENGINE=InnoDB DEFAULT CHARSET=utf8'); 397 end; 385 398 finally 386 399 Tables.Free; … … 409 422 GroupId: Integer; 410 423 EnumId: Integer; 424 ModuleId: Integer; 425 ModuleBaseId: Integer; 411 426 begin 412 427 with Core.System do begin … … 485 500 AddPropertyRelationMany(ObjectPropertyGroupId, 'Properties', 'Properties', True, ObjectPropertyIdGroup); 486 501 AddPropertyRelationMany(PropertyTypeId, 'Custom types', 'CustomTypes', True, CustomTypeIdType); 502 ModuleId := AddObject('Modules', 'Module', Core.System.Database.Database, GroupId); 503 AddPropertyNumber(ModuleId, 'Id', 'Id', False); 504 AddPropertyString(ModuleId, 'Name', 'Name', True); 505 AddPropertyString(ModuleId, 'Author', 'Author', True); 506 AddPropertyString(ModuleId, 'Website', 'Website', False); 507 AddPropertyString(ModuleId, 'Version', 'Version', True); 508 AddPropertyText(ModuleId, 'Description', 'Description', False); 509 AddPropertyString(ModuleId, 'License', 'License', False); 510 511 ModuleBaseId := AddModule('Base', 'Chronos', '', '0.1', '', 'GNU/GPL'); 487 512 end; 488 513 end; -
trunk/UCore.lfm
r22 r24 4 4 OldCreateOrder = False 5 5 Height = 340 6 HorizontalOffset = 2367 VerticalOffset = 746 HorizontalOffset = 320 7 VerticalOffset = 114 8 8 Width = 413 9 9 object CoolTranslator1: TCoolTranslator -
trunk/USystem.pas
r22 r24 16 16 PropertyTypeTable = 'Type'; 17 17 PropertyGroupTable = 'PropertyGroup'; 18 ModuleTable = 'Module'; 18 19 TypeEnumeration = 'TypeEnumeration'; 19 20 TypeFile = 'TypeFile'; … … 119 120 function AddPropertyString(ObjectId: Integer; Name, ColumnName: string; 120 121 Editable: Boolean; Default: string = ''; MaxLength: Integer = 255): Integer; 122 function AddPropertyText(ObjectId: Integer; Name, ColumnName: string; 123 Editable: Boolean; Default: string = ''): Integer; 121 124 function AddPropertyRelationOne(ObjectId: Integer; Name, ColumnName: string; 122 125 Editable: Boolean; ReferedObject: Integer): Integer; … … 126 129 function AddEnumeration(Name: string): Integer; 127 130 function AddEnumerationState(Enum: Integer; Name: string): Integer; 131 function AddModule(Name, Author, Website, Version, Description, License: string): Integer; 128 132 procedure LoadTypes; 129 133 constructor Create; … … 435 439 end; 436 440 441 function TChronisBase.AddPropertyText(ObjectId: Integer; Name, 442 ColumnName: string; Editable: Boolean; Default: string): Integer; 443 var 444 DbRows: TDbRows; 445 Data: TDictionaryStringString; 446 CustomTypeId: Integer; 447 begin 448 try 449 DbRows := TDbRows.Create; 450 Data := TDictionaryStringString.Create; 451 452 Data.Clear; 453 Data.Add('Type', IntToStr(Integer(vtText))); 454 Database.Insert(CustomTypeTableName, Data); 455 CustomTypeId := Database.LastInsertId; 456 457 Data.Clear; 458 Data.Add('CustomType', IntToStr(CustomTypeId)); 459 Data.Add('Default', Default); 460 Database.Insert(TypeString, Data); 461 //CustomTypeId := Database.LastInsertId; 462 463 Result := AddProperty(ObjectId, Name, ColumnName, CustomTypeId, Editable); 464 finally 465 Data.Free; 466 DbRows.Free; 467 end; 468 end; 469 437 470 function TChronisBase.AddPropertyRelationOne(ObjectId: Integer; Name, 438 471 ColumnName: string; Editable: Boolean; ReferedObject: Integer): Integer; … … 539 572 Data.Add('Name', Name); 540 573 Database.Insert(EnumerationState, Data); 574 Result := Database.LastInsertId; 575 finally 576 Data.Free; 577 DbRows.Free; 578 end; 579 end; 580 581 function TChronisBase.AddModule(Name, Author, Website, Version, Description, 582 License: string): Integer; 583 var 584 DbRows: TDbRows; 585 Data: TDictionaryStringString; 586 begin 587 try 588 DbRows := TDbRows.Create; 589 Data := TDictionaryStringString.Create; 590 Data.Add('Name', Name); 591 Data.Add('Author', Author); 592 Data.Add('Website', Website); 593 Data.Add('Version', Version); 594 Data.Add('Description', Description); 595 Data.Add('License', License); 596 Database.Insert(ModuleTable, Data); 541 597 Result := Database.LastInsertId; 542 598 finally
Note:
See TracChangeset
for help on using the changeset viewer.