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

Comparing ibx/trunk/design/IBDBReg.pas (file contents):
Revision 33 by tony, Sat Jul 18 12:30:52 2015 UTC vs.
Revision 80 by tony, Mon Jan 1 11:31:07 2018 UTC

# Line 39 | Line 39 | unit IBDBReg;
39   *)
40   {$A+}                           (* Aligned records: On *)
41   {$B-}                           (* Short circuit boolean expressions: Off *)
42 {$G+}                           (* Imported data: On *)
42   {$H+}                           (* Huge Strings: On *)
43   {$J-}                           (* Modification of Typed Constants: Off *)
44   {$M+}                           (* Generate run-time type information: On *)
# Line 47 | Line 46 | unit IBDBReg;
46   {$Q-}                           (* Overflow checks: Off *)
47   {$R-}                           (* Range checks: Off *)
48   {$T+}                           (* Typed address: On *)
50 {$U+}                           (* Pentim-safe FDIVs: On *)
49   {$W-}                           (* Always generate stack frames: Off *)
50   {$X+}                           (* Extended syntax: On *)
51   {$Z1}                           (* Minimum Enumeration Size: 1 Byte *)
# Line 56 | Line 54 | interface
54  
55   uses SysUtils, Classes, Graphics, Dialogs, Controls, Forms, TypInfo,
56       DB, IBTable, IBDatabase,  IBEventsEditor,  LazarusPackageIntf,
57 <      IBUpdateSQL, IBXConst, ComponentEditors, PropEdits, DBPropEdits, FieldsEditor,
57 >      IBUpdateSQL, IBUpdate, ComponentEditors, PropEdits, DBPropEdits, FieldsEditor,
58       dbFieldLinkPropEditor, dbFieldListPropEditor, IBDialogs;
59  
60   type
# Line 134 | Line 132 | type
132      function GetVerbCount: Integer; override;
133    end;
134  
135 +  { TIBArrayGridEditor }
136 +
137 +  TIBArrayGridEditor = class(TComponentEditor)
138 +  public
139 +    procedure ExecuteVerb(Index: Integer); override;
140 +    function GetVerb(Index: Integer): string; override;
141 +    function GetVerbCount: Integer; override;
142 +  end;
143 +
144   { TIBQueryEditor }
145  
146    TIBQueryEditor = class(TFieldsComponentEditor)
# Line 355 | Line 362 | type
362      procedure SetIndexFieldNames(const Value: string); override;
363    end;
364  
365 +  { TIBFieldDefsProperty }
366 +
367 +  TIBFieldDefsProperty = class(TCollectionPropertyEditor)
368 +  public
369 +    procedure Edit; override;
370 +  end;
371 +
372 +  { TIBIndexDefsProperty }
373 +
374 +  TIBIndexDefsProperty = class(TCollectionPropertyEditor)
375 +  public
376 +    procedure Edit; override;
377 +  end;
378  
379  
380   procedure Register;
381  
382   implementation
383  
384 < uses IB, IBQuery, IBStoredProc, IBCustomDataSet,
385 <     IBIntf, IBSQL, IBSQLMonitor, IBDatabaseInfo, IBEvents,
384 > uses IB, IBQuery, IBStoredProc, IBCustomDataSet, FBMessages,
385 >     IBSQL, IBSQLMonitor, IBDatabaseInfo, IBEvents, IBTypes,
386       IBServices, IBDatabaseEdit, IBTransactionEdit,
387       IBBatchMove, IBExtract,LResources, IBSelectSQLEditor,
388       IBModifySQLEditor,IBDeleteSQLEditor,IBRefreshSQLEditor,
389       IBInsertSQLEditor, IBGeneratorEditor, IBUpdateSQLEditor, IBDataSetEditor,
390       IBSQLEditor, ibserviceeditor, LCLVersion, IBDynamicGrid, IBLookupComboEditBox,
391 <     IBTreeView, DBControlGrid;
392 <
391 >     IBTreeView, DBControlGrid, ibxscript, IBLocalDBSupport, IBDSDialogs,
392 >     IBArrayGrid, IBVersion, IBDataOutput;
393  
394 + const
395 +  IBPalette1 = 'Firebird'; {do not localize}
396 +  IBPalette2 = 'Firebird Admin'; {do not localize}
397 +  IBPalette3 = 'Firebird Data Controls';   {do not localize}
398 +  
399 + resourcestring
400 +   SInterbaseExpressVersion = 'Firebird Express for Lazarus ' + IBX_VERSION;
401 +   SEditSQL = 'Edit SQL';
402 +   SIBSQLEditor = 'IBSQL Editor';
403 +   SIBServiceEditor = 'Edit IB Service';
404 +   SIBUpdateSQLEditor = '&UpdateSQL Editor...';
405 +   SIBDataSetEditor = '&Dataset Editor...';
406 +   SExecute = 'E&xecute';
407 +   SIBDatabaseEditor = 'Da&tabase Editor...';
408 +   SIBTransactionEditor = '&Transaction Editor...';
409 +   SIBUpdateLayout = 'Update Layout';
410  
411   procedure Register;
412   begin
# Line 380 | Line 416 | begin
416      Exit;
417    end;
418  
419 <  RegisterNoIcon([TIBStringField, TIBBCDField]);
419 >  RegisterNoIcon([TIBStringField, TIBBCDField, TIBMemoField, TIBArrayField]);
420    {$if lcl_fullversion < 01010000}
421    {see http://bugs.freepascal.org/view.php?id=19035 }
422    RegisterNoIcon([TIntegerField]);
423    {$endif}
424    RegisterComponents(IBPalette1, [ TIBQuery, TIBDataSet,
425 <   TIBDatabase, TIBTransaction, TIBUpdateSQL, TIBEvents,
425 >   TIBDatabase, TIBTransaction, TIBUpdateSQL, TIBUpdate, TIBEvents,
426       TIBSQL, TIBDatabaseInfo, TIBSQLMonitor,
427 <       TIBStoredProc,TIBBatchMove,  TIBTable,TIBExtract]);
428 <  if IBServiceAPIPresent  then
427 >       TIBStoredProc,TIBBatchMove,  TIBTable,TIBExtract, TIBXScript, TIBLocalDBSupport,
428 >       TIBBlockFormatOut,TIBCSVDataOut,TIBInsertStmtsOut]);
429 >  if FirebirdAPI.HasServiceAPI  then
430      RegisterComponents(IBPalette2, [TIBConfigService, TIBBackupService,
431        TIBRestoreService, TIBValidationService, TIBStatisticalService,
432        TIBLogService, TIBSecurityService, TIBServerProperties]);
433  
434  
435 <  RegisterComponents(IBPalette3,[TIBLookupComboEditBox,TIBDynamicGrid,TIBTreeView,TDBControlGrid]);
435 >  RegisterComponents(IBPalette3,[TIBLookupComboEditBox,TIBDynamicGrid,TIBTreeView,TDBControlGrid, TIBArrayGrid]);
436    RegisterPropertyEditor(TypeInfo(TIBFileName), TIBDatabase, 'DatabaseName', TIBFileNameProperty); {do not localize}
437    RegisterPropertyEditor(TypeInfo(string), TIBStoredProc, 'StoredProcName', TIBStoredProcNameProperty); {do not localize}
438    RegisterPropertyEditor(TypeInfo(TParams), TIBStoredProc, 'Params', TIBStoredProcParamsProperty);
# Line 403 | Line 440 | begin
440    RegisterPropertyEditor(TypeInfo(string), TIBTable, 'IndexName', TIBIndexNameProperty); {do not localize}
441    RegisterPropertyEditor(TypeInfo(string), TIBTable, 'IndexFieldNames', TIBIndexFieldNamesProperty); {do not localize}
442    RegisterPropertyEditor(TypeInfo(string), TIBTable, 'MasterFields', TIBTableFieldLinkProperty); {do not localize}
443 +  RegisterPropertyEditor(TypeInfo(TFieldDefs), TIBTable, 'FieldDefs', TIBFieldDefsProperty); {do not localize}
444 +  RegisterPropertyEditor(TypeInfo(TIndexDefs), TIBTable, 'IndexDefs', TIBIndexDefsProperty); {do not localize}
445    RegisterPropertyEditor(TypeInfo(TStrings), TIBQuery, 'SQL', TIBQuerySQLProperty); {do not localize}
446    RegisterPropertyEditor(TypeInfo(TStrings), TIBDataSet, 'SelectSQL', TIBDatasetSQLProperty); {do not localize}
447    RegisterPropertyEditor(TypeInfo(TStrings), TIBDataSet, 'ModifySQL', TIBUpdateSQLProperty); {do not localize}
# Line 426 | Line 465 | begin
465    RegisterComponentEditor(TIBStoredProc, TIBStoredProcEditor);
466    RegisterComponentEditor(TIBSQL, TIBSQLEditor);
467    RegisterComponentEditor(TIBCustomService, TIBServiceEditor);
468 +  RegisterComponentEditor(TIBArrayGrid, TIBArrayGridEditor);
469  
470  
471    {Firebird Data Access Controls}
# Line 438 | Line 478 | begin
478    RegisterPropertyEditor(TypeInfo(string), TIBTreeView, 'ParentField', TIBTreeViewFieldProperty);
479    RegisterPropertyEditor(TypeInfo(string), TIBTreeView, 'HasChildField', TIBTreeViewFieldProperty);
480  
481 +  IBGUIInterface :=  TIBDSLCLInterface.Create;
482   end;
483  
484   procedure LoadDataSourceFields(DataSource: TDataSource; List: TStrings);
# Line 462 | Line 503 | begin
503    end;
504   end;
505  
506 + { TIBIndexDefsProperty }
507 +
508 + procedure TIBIndexDefsProperty.Edit;
509 + var IndexDefs: TIndexDefs;
510 + begin
511 +  IndexDefs := TIndexDefs(GetObjectValue);
512 +  if IndexDefs <> nil then
513 +    IndexDefs.Update;
514 +  inherited Edit;
515 + end;
516 +
517 + { TIBFieldDefsProperty }
518 +
519 + procedure TIBFieldDefsProperty.Edit;
520 + var FieldDefs: TFieldDefs;
521 + begin
522 +  FieldDefs := TFieldDefs(GetObjectValue);
523 +  if FieldDefs <> nil then
524 +    FieldDefs.Update;
525 +  inherited Edit;
526 + end;
527 +
528 + { TIBArrayGridEditor }
529 +
530 + procedure TIBArrayGridEditor.ExecuteVerb(Index: Integer);
531 + begin
532 +  if Index < inherited GetVerbCount then
533 +    inherited ExecuteVerb(Index)
534 +  else
535 +  case Index of
536 +    0: TIBArrayGrid(Component).UpdateLayout;
537 +  end;
538 + end;
539 +
540 + function TIBArrayGridEditor.GetVerb(Index: Integer): string;
541 + begin
542 +  if Index < inherited GetVerbCount then
543 +    Result := inherited GetVerb(Index) else
544 +  begin
545 +    Dec(Index, inherited GetVerbCount);
546 +    case Index of
547 +      0: Result := SIBUpdateLayout;
548 +      1 : Result := SInterbaseExpressVersion ;
549 +    end;
550 +  end;
551 + end;
552 +
553 + function TIBArrayGridEditor.GetVerbCount: Integer;
554 + begin
555 +  Result := 2;
556 + end;
557 +
558   { TDBLookupPropertiesGridFieldProperty }
559  
560   procedure TDBLookupPropertiesGridFieldProperty.FillValues(
# Line 742 | Line 835 | var
835    IBSQL: TIBSQL;
836   begin
837    IBSQL := GetComponent(0) as TIBSQL;
838 <  if IBSQLEditor.EditIBSQL(IBSQL) then Modified;
838 >  if IBSQLEditor.EditSQL(IBSQL) then Modified;
839   end;
840  
841   { TIBUpdateSQLEditor }
# Line 756 | Line 849 | function TIBUpdateSQLEditor.GetVerb(Inde
849   begin
850    case Index of
851      0 : Result := SIBUpdateSQLEditor;
852 <    1: Result := SInterbaseExpressVersion;
852 >    1: Result := SInterbaseExpressVersion ;
853    end;
854   end;
855  
# Line 768 | Line 861 | end;
861   { TIBDataSetEditor }
862  
863   procedure TIBDataSetEditor.ExecuteVerb(Index: Integer);
771 var
772  IBDataset: TIBDataset;
864   begin
865    if Index < inherited GetVerbCount then
866      inherited ExecuteVerb(Index) else
# Line 793 | Line 884 | begin
884      case Index of
885        0: Result := SIBDataSetEditor;
886        1: Result := SExecute;
887 <      2: Result := SInterbaseExpressVersion;
887 >      2: Result := SInterbaseExpressVersion ;
888      end;
889    end;
890   end;
# Line 850 | Line 941 | begin
941      Dec(Index, inherited GetVerbCount);
942      case Index of
943        0: Result := SIBDatabaseEditor;
944 <      1 : Result := SInterbaseExpressVersion;
944 >      1 : Result := SInterbaseExpressVersion ;
945      end;
946    end;
947   end;
# Line 873 | Line 964 | function TIBTransactionEditor.GetVerb(In
964   begin
965    case Index of
966      0: Result := SIBTransactionEditor;
967 <    1: Result := SInterbaseExpressVersion;
967 >    1: Result := SInterbaseExpressVersion ;
968    end;
969   end;
970  
# Line 909 | Line 1000 | begin
1000      case Index of
1001        0: Result := SExecute;
1002        1: Result := SEditSQL;
1003 <      2: Result := SInterbaseExpressVersion;
1003 >      2: Result := SInterbaseExpressVersion ;
1004      end;
1005    end;
1006   end;
# Line 939 | Line 1030 | begin
1030      Dec(Index, inherited GetVerbCount);
1031      case Index of
1032        0: Result := SExecute;
1033 <      1: Result := SInterbaseExpressVersion;
1033 >      1: Result := SInterbaseExpressVersion ;
1034      end;
1035    end;
1036   end;
# Line 1024 | Line 1115 | end;
1115   procedure TIBRefreshSQLProperty.Edit;
1116   var
1117    IBDataset: TIBDataset;
1027  aDatabase: TIBDatabase;
1118   begin
1119    IBDataset := GetComponent(0) as TIBDataset;
1120    if IBRefreshSQLEditor.EditSQL(IBDataSet,IBDataSet.RefreshSQL) then Modified;
# Line 1111 | Line 1201 | end;
1201  
1202   procedure TIBSQLEditor.ExecuteVerb(Index: Integer);
1203   begin
1204 <  if IBSQLEditor.EditIBSQL(TIBSQL(Component)) then Modified;
1204 >  if IBSQLEditor.EditSQL(TIBSQL(Component)) then Modified;
1205   end;
1206  
1207   function TIBSQLEditor.GetVerb(Index: Integer): string;
1208   begin
1209    case Index of
1210      0 : Result := SIBSQLEditor;
1211 <    1: Result := SInterbaseExpressVersion;
1211 >    1: Result := SInterbaseExpressVersion ;
1212    end;
1213   end;
1214  
# Line 1134 | Line 1224 | var
1224    IBSQL: TIBSQL;
1225   begin
1226    IBSQL := GetComponent(0) as TIBSQL;
1227 <  if IBSQLEditor.EditIBSQL(IBSQL) then Modified;
1227 >  if IBSQLEditor.EditSQL(IBSQL) then Modified;
1228   end;
1229  
1230   initialization

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines