ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/branches/journaling/design/IBDBReg.pas
(Generate patch)

Comparing ibx/trunk/design/IBDBReg.pas (file contents):
Revision 80 by tony, Mon Jan 1 11:31:07 2018 UTC vs.
Revision 143 by tony, Fri Feb 23 12:11:21 2018 UTC

# Line 27 | Line 27
27   {    IBX For Lazarus (Firebird Express)                                  }
28   {    Contributor: Tony Whyman, MWA Software http://www.mwasoftware.co.uk }
29   {    Portions created by MWA Software are copyright McCallum Whyman      }
30 < {    Associates Ltd 2011                                                 }
30 > {    Associates Ltd 2011 - 2018                                               }
31   {************************************************************************}
32  
33   unit IBDBReg;
# Line 83 | Line 83 | type
83      procedure GetValues(Proc: TGetStrProc); override;
84    end;
85  
86 +  { TIBPackageNameProperty
87 +    Editor for the TIBStoredProc.PackageName property.  Displays a drop-down list of all
88 +    the StoredProcedures in the Database.}
89 +  TIBPackageNameProperty = class(TIBNameProperty)
90 +  public
91 +    procedure GetValues(Proc: TGetStrProc); override;
92 +  end;
93 +
94    { TIBTableNameProperty
95      Editor for the TIBTable.TableName property.  Displays a drop-down list of all
96      the Tables in the Database.}
# Line 196 | Line 204 | type
204    end;
205  
206    TIBStoredProcParamsProperty = class(TCollectionPropertyEditor)
199  public
200    procedure Edit; override;
207    end;
208  
209    { TIBTableFieldLinkProperty }
# Line 316 | Line 322 | type
322      procedure Edit; override;
323    end;
324  
325 +  { TIBUpdateRefreshSQLProperty }
326 +
327 +  TIBUpdateRefreshSQLProperty = class(TSQLPropertyEditor)
328 +  protected
329 +    FIBUpdate: TIBUpdate;
330 +    FDatabase: TIBDatabase;
331 +    function GetObjects: boolean;
332 +  public
333 +    procedure Edit; override;
334 +  end;
335 +
336 +
337   { TIBEventListProperty }
338  
339    TIBEventListProperty = class(TClassProperty)
# Line 416 | Line 434 | begin
434      Exit;
435    end;
436  
437 <  RegisterNoIcon([TIBStringField, TIBBCDField, TIBMemoField, TIBArrayField]);
437 >  RegisterNoIcon([TIBStringField, TIBBCDField, TIBMemoField, TIBArrayField,
438 >    TIBSmallintField, TIBIntegerField, TIBLargeIntField]);
439    {$if lcl_fullversion < 01010000}
440    {see http://bugs.freepascal.org/view.php?id=19035 }
441    RegisterNoIcon([TIntegerField]);
# Line 428 | Line 447 | begin
447         TIBBlockFormatOut,TIBCSVDataOut,TIBInsertStmtsOut]);
448    if FirebirdAPI.HasServiceAPI  then
449      RegisterComponents(IBPalette2, [TIBConfigService, TIBBackupService,
450 <      TIBRestoreService, TIBValidationService, TIBStatisticalService,
450 >      TIBRestoreService, TIBValidationService, TIBOnlineValidationService, TIBStatisticalService,
451        TIBLogService, TIBSecurityService, TIBServerProperties]);
452  
453  
454    RegisterComponents(IBPalette3,[TIBLookupComboEditBox,TIBDynamicGrid,TIBTreeView,TDBControlGrid, TIBArrayGrid]);
455    RegisterPropertyEditor(TypeInfo(TIBFileName), TIBDatabase, 'DatabaseName', TIBFileNameProperty); {do not localize}
456    RegisterPropertyEditor(TypeInfo(string), TIBStoredProc, 'StoredProcName', TIBStoredProcNameProperty); {do not localize}
457 +  RegisterPropertyEditor(TypeInfo(string), TIBStoredProc, 'PackageName', TIBPackageNameProperty); {do not localize}
458    RegisterPropertyEditor(TypeInfo(TParams), TIBStoredProc, 'Params', TIBStoredProcParamsProperty);
459    RegisterPropertyEditor(TypeInfo(string), TIBTable, 'TableName', TIBTableNameProperty); {do not localize}
460    RegisterPropertyEditor(TypeInfo(string), TIBTable, 'IndexName', TIBIndexNameProperty); {do not localize}
# Line 453 | Line 473 | begin
473    RegisterPropertyEditor(TypeInfo(TStrings), TIBUpdateSQL, 'ModifySQL', TIBUpdateSQLUpdateProperty); {do not localize}
474    RegisterPropertyEditor(TypeInfo(TStrings), TIBUpdateSQL, 'InsertSQL', TIBUpdateSQLInsertSQLProperty); {do not localize}
475    RegisterPropertyEditor(TypeInfo(TStrings), TIBUpdateSQL, 'DeleteSQL', TIBUpdateSQLDeleteProperty); {do not localize}
476 +  RegisterPropertyEditor(TypeInfo(TStrings), TIBUpdate, 'RefreshSQL', TIBUpdateRefreshSQLProperty); {do not localize}
477    RegisterPropertyEditor(TypeInfo(TStrings), TIBEvents, 'Events', TIBEventListProperty); {do not localize}
478    RegisterPropertyEditor(TypeInfo(TPersistent), TIBDataSet, 'GeneratorField', TIBGeneratorProperty);  {do not localize}
479    RegisterPropertyEditor(TypeInfo(TPersistent), TIBQuery, 'GeneratorField', TIBGeneratorProperty);  {do not localize}
480 +  RegisterPropertyEditor(TypeInfo(TPersistent), TIBTable, 'GeneratorField', TIBGeneratorProperty);  {do not localize}
481  
482    RegisterComponentEditor(TIBDatabase, TIBDatabaseEditor);
483    RegisterComponentEditor(TIBTransaction, TIBTransactionEditor);
# Line 477 | Line 499 | begin
499    RegisterPropertyEditor(TypeInfo(string), TIBTreeView, 'TextField', TIBTreeViewFieldProperty);
500    RegisterPropertyEditor(TypeInfo(string), TIBTreeView, 'ParentField', TIBTreeViewFieldProperty);
501    RegisterPropertyEditor(TypeInfo(string), TIBTreeView, 'HasChildField', TIBTreeViewFieldProperty);
502 +  RegisterPropertyEditor(TypeInfo(string), TIBTreeView, 'ImageIndexField', TIBTreeViewFieldProperty);
503 +  RegisterPropertyEditor(TypeInfo(string), TIBTreeView, 'SelectedIndexField', TIBTreeViewFieldProperty);
504  
505    IBGUIInterface :=  TIBDSLCLInterface.Create;
506   end;
# Line 503 | Line 527 | begin
527    end;
528   end;
529  
530 + { TIBUpdateRefreshSQLProperty }
531 +
532 + function TIBUpdateRefreshSQLProperty.GetObjects: boolean;
533 + begin
534 +  Result := false;
535 +  FIBUpdate := GetComponent(0) as TIBUpdate;
536 +  if not assigned(FIBUpdate) or not assigned(FIBUpdate.DataSet) then
537 +    Exit;
538 +  FDatabase := nil;
539 +  if FIBUpdate.DataSet is TIBQuery then
540 +  begin
541 +    FDatabase := (FIBUpdate.DataSet as TIBQuery).Database;
542 +    Result := true
543 +  end;
544 + end;
545 +
546 + procedure TIBUpdateRefreshSQLProperty.Edit;
547 + begin
548 +  GetObjects;
549 +  if IBRefreshSQLEditor.EditSQL(FIBUpdate.DataSet,FIBUpdate.RefreshSQL) then Modified;
550 + end;
551 +
552 + { TIBPackageNameProperty }
553 +
554 + procedure TIBPackageNameProperty.GetValues(Proc: TGetStrProc);
555 + var
556 +   StoredProc : TIBStoredProc;
557 +   i : integer;
558 + begin
559 +    StoredProc := GetComponent(0) as TIBStoredProc;
560 +    if StoredProc.Database = nil then
561 +      Exit;
562 +
563 +    with StoredProc do
564 +    try
565 +      for I := 0 to PackageNames.Count - 1 do
566 +        Proc (PackageNames[i]);
567 +    except on E: Exception do
568 +      MessageDlg(E.Message,mtError,[mbOK],0)
569 +    end;
570 + end;
571 +
572   { TIBIndexDefsProperty }
573  
574   procedure TIBIndexDefsProperty.Edit;
# Line 1040 | Line 1106 | begin
1106    Result := inherited GetVerbCount + 2;
1107   end;
1108  
1043 { TIBStoredProcParamsProperty }
1044
1045 procedure TIBStoredProcParamsProperty.Edit;
1046 var
1047  StoredProc: TIBStoredProc;
1048  Params: TParams;
1049 begin
1050  StoredProc := (GetComponent(0) as TIBStoredProc);
1051  Params := TParams.Create(nil);
1052  try
1053    StoredProc.CopyParams(Params);
1054  finally
1055    Params.Free;
1056  end;
1057  inherited Edit;
1058 end;
1059
1109   { TIBTableFieldLinkProperty }
1110  
1111   procedure TIBTableFieldLinkProperty.Edit;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines