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; |
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 *) |
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 *) |
54 |
|
|
55 |
|
uses SysUtils, Classes, Graphics, Dialogs, Controls, Forms, TypInfo, |
56 |
|
DB, IBTable, IBDatabase, IBEventsEditor, LazarusPackageIntf, |
57 |
< |
IBUpdateSQL, IBXConst, ComponentEditors, PropEdits, DBPropEdits, FieldsEditor, |
58 |
< |
dbFieldLinkPropEditor, dbFieldListPropEditor, IBDialogs; |
57 |
> |
IBUpdateSQL, IBUpdate, ComponentEditors, PropEdits, DBPropEdits, FieldsEditor, |
58 |
> |
dbFieldLinkPropEditor, IBDialogs; |
59 |
|
|
60 |
|
type |
61 |
|
|
63 |
|
Property editor the DataBase Name property. Brings up the Open dialog } |
64 |
|
|
65 |
|
TIBFileNameProperty = class(TStringProperty) |
66 |
+ |
protected |
67 |
+ |
function GetFilter: string; virtual; |
68 |
|
public |
69 |
|
procedure Edit; override; |
70 |
|
function GetAttributes: TPropertyAttributes; override; |
71 |
|
end; |
72 |
|
|
73 |
+ |
{ TIBLibraryNameProperty } |
74 |
+ |
|
75 |
+ |
TIBLibraryNameProperty = class(TIBFileNameProperty) |
76 |
+ |
protected |
77 |
+ |
function GetFilter: string; override; |
78 |
+ |
end; |
79 |
+ |
|
80 |
|
{ TIBNameProperty |
81 |
|
} |
82 |
|
TIBNameProperty = class(TStringProperty) |
92 |
|
procedure GetValues(Proc: TGetStrProc); override; |
93 |
|
end; |
94 |
|
|
95 |
+ |
{ TIBPackageNameProperty |
96 |
+ |
Editor for the TIBStoredProc.PackageName property. Displays a drop-down list of all |
97 |
+ |
the StoredProcedures in the Database.} |
98 |
+ |
TIBPackageNameProperty = class(TIBNameProperty) |
99 |
+ |
public |
100 |
+ |
procedure GetValues(Proc: TGetStrProc); override; |
101 |
+ |
end; |
102 |
+ |
|
103 |
|
{ TIBTableNameProperty |
104 |
|
Editor for the TIBTable.TableName property. Displays a drop-down list of all |
105 |
|
the Tables in the Database.} |
203 |
|
function GetVerbCount: Integer; override; |
204 |
|
end; |
205 |
|
|
206 |
< |
TIBStoredProcParamsProperty = class(TCollectionPropertyEditor) |
206 |
> |
{ TIBXServiceEditor } |
207 |
> |
|
208 |
> |
TIBXServiceEditor = class(TComponentEditor) |
209 |
|
public |
210 |
< |
procedure Edit; override; |
210 |
> |
procedure ExecuteVerb(Index: Integer); override; |
211 |
> |
function GetVerb(Index: Integer): string; override; |
212 |
> |
function GetVerbCount: Integer; override; |
213 |
> |
end; |
214 |
> |
|
215 |
> |
TIBStoredProcParamsProperty = class(TCollectionPropertyEditor) |
216 |
|
end; |
217 |
|
|
218 |
|
{ TIBTableFieldLinkProperty } |
331 |
|
procedure Edit; override; |
332 |
|
end; |
333 |
|
|
334 |
+ |
{ TIBUpdateRefreshSQLProperty } |
335 |
+ |
|
336 |
+ |
TIBUpdateRefreshSQLProperty = class(TSQLPropertyEditor) |
337 |
+ |
protected |
338 |
+ |
FIBUpdate: TIBUpdate; |
339 |
+ |
FDatabase: TIBDatabase; |
340 |
+ |
function GetObjects: boolean; |
341 |
+ |
public |
342 |
+ |
procedure Edit; override; |
343 |
+ |
end; |
344 |
+ |
|
345 |
+ |
|
346 |
|
{ TIBEventListProperty } |
347 |
|
|
348 |
|
TIBEventListProperty = class(TClassProperty) |
359 |
|
procedure Edit; override; |
360 |
|
end; |
361 |
|
|
362 |
< |
{ TDBDynamicGridFieldProperty } |
329 |
< |
|
330 |
< |
TDBDynamicGridFieldProperty = class(TFieldProperty) |
331 |
< |
public |
332 |
< |
procedure FillValues(const Values: TStringList); override; |
333 |
< |
end; |
334 |
< |
|
335 |
< |
{ TDBLookupPropertiesGridFieldProperty } |
362 |
> |
{ TIBFieldDefsProperty } |
363 |
|
|
364 |
< |
TDBLookupPropertiesGridFieldProperty = class(TFieldProperty) |
364 |
> |
TIBFieldDefsProperty = class(TCollectionPropertyEditor) |
365 |
|
public |
366 |
< |
procedure FillValues(const Values: TStringList); override; |
366 |
> |
procedure Edit; override; |
367 |
|
end; |
368 |
|
|
369 |
< |
{ TIBTreeViewFieldProperty } |
369 |
> |
{ TIBIndexDefsProperty } |
370 |
|
|
371 |
< |
TIBTreeViewFieldProperty = class(TFieldProperty) |
371 |
> |
TIBIndexDefsProperty = class(TCollectionPropertyEditor) |
372 |
|
public |
373 |
< |
procedure FillValues(const Values: TStringList); override; |
347 |
< |
end; |
348 |
< |
|
349 |
< |
{ TIBDynamicGridIndexNamesProperty } |
350 |
< |
|
351 |
< |
TIBDynamicGridIndexNamesProperty = class(TIndexFieldNamesProperty) |
352 |
< |
protected |
353 |
< |
function GetFieldDefs: TFieldDefs; override; |
354 |
< |
function GetIndexFieldNames: string; override; |
355 |
< |
procedure SetIndexFieldNames(const Value: string); override; |
373 |
> |
procedure Edit; override; |
374 |
|
end; |
375 |
|
|
376 |
|
|
359 |
– |
|
377 |
|
procedure Register; |
378 |
|
|
379 |
|
implementation |
380 |
|
|
381 |
< |
uses IB, IBQuery, IBStoredProc, IBCustomDataSet, |
382 |
< |
IBIntf, IBSQL, IBSQLMonitor, IBDatabaseInfo, IBEvents, |
383 |
< |
IBServices, IBDatabaseEdit, IBTransactionEdit, |
381 |
> |
uses IB, IBQuery, IBStoredProc, IBCustomDataSet, IBMessages, |
382 |
> |
IBSQL, IBSQLMonitor, IBDatabaseInfo, IBEvents, IBInternals, |
383 |
> |
IBServices, IBXServices, IBDatabaseEdit, IBTransactionEdit, |
384 |
|
IBBatchMove, IBExtract,LResources, IBSelectSQLEditor, |
385 |
|
IBModifySQLEditor,IBDeleteSQLEditor,IBRefreshSQLEditor, |
386 |
|
IBInsertSQLEditor, IBGeneratorEditor, IBUpdateSQLEditor, IBDataSetEditor, |
387 |
< |
IBSQLEditor, ibserviceeditor, LCLVersion, IBDynamicGrid, IBLookupComboEditBox, |
388 |
< |
IBTreeView, DBControlGrid; |
372 |
< |
|
387 |
> |
IBSQLEditor, ibserviceeditor, LCLVersion, ibxscript, IBLocalDBSupport, IBDSDialogs, |
388 |
> |
IBVersion, IBDataOutput, IBXServiceEditor, IBJournal; |
389 |
|
|
390 |
+ |
const |
391 |
+ |
IBPalette1 = 'Firebird'; {do not localize} |
392 |
+ |
IBPalette2 = 'Firebird Legacy Admin'; {do not localize} |
393 |
+ |
IBPalette3 = 'Firebird Admin'; {do not localize} |
394 |
+ |
|
395 |
+ |
resourcestring |
396 |
+ |
SInterbaseExpressVersion = 'Firebird Express for Lazarus ' + IBX_VERSION; |
397 |
+ |
SEditSQL = 'Edit SQL'; |
398 |
+ |
SIBSQLEditor = 'IBSQL Editor'; |
399 |
+ |
SIBServiceEditor = 'Edit IB Service'; |
400 |
+ |
SIBUpdateSQLEditor = '&UpdateSQL Editor...'; |
401 |
+ |
SIBDataSetEditor = '&Dataset Editor...'; |
402 |
+ |
SExecute = 'E&xecute'; |
403 |
+ |
SIBDatabaseEditor = 'Da&tabase Editor...'; |
404 |
+ |
SIBTransactionEditor = '&Transaction Editor...'; |
405 |
+ |
SFBLibLoadProblem = 'IBX is unable to locate or otherwise load the Firebird Library - have you remembered to install it?'; |
406 |
|
|
407 |
|
procedure Register; |
408 |
|
begin |
409 |
< |
if not TryIBLoad then |
410 |
< |
begin |
411 |
< |
MessageDlg('IBX is unable to locate the Firebird Library - have you remembered to install it?',mtError,[mbOK],0); |
412 |
< |
Exit; |
409 |
> |
AllowUseOfFBLIB := true; |
410 |
> |
try |
411 |
> |
if not TryIBLoad then |
412 |
> |
begin |
413 |
> |
MessageDlg(SFBLibLoadProblem,mtError,[mbOK],0); |
414 |
> |
Exit; |
415 |
> |
end; |
416 |
> |
except on E: Exception do |
417 |
> |
begin |
418 |
> |
MessageDlg(SFBLibLoadProblem + ' - ' + E.Message,mtError,[mbOK],0); |
419 |
> |
Exit; |
420 |
> |
end; |
421 |
|
end; |
422 |
|
|
423 |
< |
RegisterNoIcon([TIBStringField, TIBBCDField]); |
424 |
< |
{$if lcl_fullversion < 01010000} |
423 |
> |
RegisterNoIcon([TIBStringField, TIBBCDField, TIBMemoField, TIBArrayField, |
424 |
> |
TIBSmallintField, TIBIntegerField, TIBLargeIntField, TIBDateTimeField, |
425 |
> |
TIBTimeField, TIBFloatField]); |
426 |
> |
{$if not declared(TIntegerField)} |
427 |
|
{see http://bugs.freepascal.org/view.php?id=19035 } |
428 |
|
RegisterNoIcon([TIntegerField]); |
429 |
|
{$endif} |
430 |
|
RegisterComponents(IBPalette1, [ TIBQuery, TIBDataSet, |
431 |
< |
TIBDatabase, TIBTransaction, TIBUpdateSQL, TIBEvents, |
431 |
> |
TIBDatabase, TIBTransaction, TIBUpdateSQL, TIBUpdate, TIBEvents, |
432 |
|
TIBSQL, TIBDatabaseInfo, TIBSQLMonitor, |
433 |
< |
TIBStoredProc,TIBBatchMove, TIBTable,TIBExtract]); |
434 |
< |
if IBServiceAPIPresent then |
433 |
> |
TIBStoredProc,TIBBatchMove, TIBTable,TIBExtract, TIBXScript, TIBJournal, TIBLocalDBSupport, |
434 |
> |
TIBBlockFormatOut,TIBCSVDataOut,TIBInsertStmtsOut]); |
435 |
> |
if FirebirdAPI.HasServiceAPI then |
436 |
> |
begin |
437 |
> |
RegisterComponents(IBPalette3, [TIBXServicesConnection, TIBXConfigService, |
438 |
> |
TIBXClientSideBackupService, TIBXServerSideBackupService, |
439 |
> |
TIBXClientSideRestoreService, TIBXServerSideRestoreService, |
440 |
> |
TIBXValidationService, TIBXOnlineValidationService, TIBXStatisticalService, |
441 |
> |
TIBXLogService, TIBXSecurityService, TIBXServerProperties, |
442 |
> |
TIBXLimboTransactionResolutionService,TIBXServicesUserList, TIBXServicesLimboTransactionsList]); |
443 |
|
RegisterComponents(IBPalette2, [TIBConfigService, TIBBackupService, |
444 |
< |
TIBRestoreService, TIBValidationService, TIBStatisticalService, |
444 |
> |
TIBRestoreService, TIBValidationService, |
445 |
> |
TIBOnlineValidationService, TIBStatisticalService, |
446 |
|
TIBLogService, TIBSecurityService, TIBServerProperties]); |
447 |
+ |
end; |
448 |
|
|
449 |
|
|
398 |
– |
RegisterComponents(IBPalette3,[TIBLookupComboEditBox,TIBDynamicGrid,TIBTreeView,TDBControlGrid]); |
450 |
|
RegisterPropertyEditor(TypeInfo(TIBFileName), TIBDatabase, 'DatabaseName', TIBFileNameProperty); {do not localize} |
451 |
+ |
RegisterPropertyEditor(TypeInfo(TIBFileName), TIBDatabase, 'FirebirdLibraryPathName', TIBLibraryNameProperty); {do not localize} |
452 |
+ |
RegisterPropertyEditor(TypeInfo(TIBFileName), TIBXServicesConnection, 'FirebirdLibraryPathName', TIBLibraryNameProperty); {do not localize} |
453 |
|
RegisterPropertyEditor(TypeInfo(string), TIBStoredProc, 'StoredProcName', TIBStoredProcNameProperty); {do not localize} |
454 |
+ |
RegisterPropertyEditor(TypeInfo(string), TIBStoredProc, 'PackageName', TIBPackageNameProperty); {do not localize} |
455 |
|
RegisterPropertyEditor(TypeInfo(TParams), TIBStoredProc, 'Params', TIBStoredProcParamsProperty); |
456 |
|
RegisterPropertyEditor(TypeInfo(string), TIBTable, 'TableName', TIBTableNameProperty); {do not localize} |
457 |
|
RegisterPropertyEditor(TypeInfo(string), TIBTable, 'IndexName', TIBIndexNameProperty); {do not localize} |
458 |
|
RegisterPropertyEditor(TypeInfo(string), TIBTable, 'IndexFieldNames', TIBIndexFieldNamesProperty); {do not localize} |
459 |
|
RegisterPropertyEditor(TypeInfo(string), TIBTable, 'MasterFields', TIBTableFieldLinkProperty); {do not localize} |
460 |
+ |
RegisterPropertyEditor(TypeInfo(TFieldDefs), TIBTable, 'FieldDefs', TIBFieldDefsProperty); {do not localize} |
461 |
+ |
RegisterPropertyEditor(TypeInfo(TIndexDefs), TIBTable, 'IndexDefs', TIBIndexDefsProperty); {do not localize} |
462 |
|
RegisterPropertyEditor(TypeInfo(TStrings), TIBQuery, 'SQL', TIBQuerySQLProperty); {do not localize} |
463 |
|
RegisterPropertyEditor(TypeInfo(TStrings), TIBDataSet, 'SelectSQL', TIBDatasetSQLProperty); {do not localize} |
464 |
|
RegisterPropertyEditor(TypeInfo(TStrings), TIBDataSet, 'ModifySQL', TIBUpdateSQLProperty); {do not localize} |
470 |
|
RegisterPropertyEditor(TypeInfo(TStrings), TIBUpdateSQL, 'ModifySQL', TIBUpdateSQLUpdateProperty); {do not localize} |
471 |
|
RegisterPropertyEditor(TypeInfo(TStrings), TIBUpdateSQL, 'InsertSQL', TIBUpdateSQLInsertSQLProperty); {do not localize} |
472 |
|
RegisterPropertyEditor(TypeInfo(TStrings), TIBUpdateSQL, 'DeleteSQL', TIBUpdateSQLDeleteProperty); {do not localize} |
473 |
+ |
RegisterPropertyEditor(TypeInfo(TStrings), TIBUpdate, 'RefreshSQL', TIBUpdateRefreshSQLProperty); {do not localize} |
474 |
|
RegisterPropertyEditor(TypeInfo(TStrings), TIBEvents, 'Events', TIBEventListProperty); {do not localize} |
475 |
|
RegisterPropertyEditor(TypeInfo(TPersistent), TIBDataSet, 'GeneratorField', TIBGeneratorProperty); {do not localize} |
476 |
|
RegisterPropertyEditor(TypeInfo(TPersistent), TIBQuery, 'GeneratorField', TIBGeneratorProperty); {do not localize} |
477 |
+ |
RegisterPropertyEditor(TypeInfo(TPersistent), TIBTable, 'GeneratorField', TIBGeneratorProperty); {do not localize} |
478 |
|
|
479 |
|
RegisterComponentEditor(TIBDatabase, TIBDatabaseEditor); |
480 |
|
RegisterComponentEditor(TIBTransaction, TIBTransactionEditor); |
484 |
|
RegisterComponentEditor(TIBStoredProc, TIBStoredProcEditor); |
485 |
|
RegisterComponentEditor(TIBSQL, TIBSQLEditor); |
486 |
|
RegisterComponentEditor(TIBCustomService, TIBServiceEditor); |
487 |
+ |
RegisterComponentEditor(TIBXServicesConnection, TIBXServiceEditor); |
488 |
|
|
489 |
+ |
IBGUIInterface := TIBDSLCLInterface.Create; |
490 |
+ |
end; |
491 |
|
|
492 |
< |
{Firebird Data Access Controls} |
432 |
< |
RegisterPropertyEditor(TypeInfo(string), TDBLookupProperties, 'KeyField', TDBDynamicGridFieldProperty); |
433 |
< |
RegisterPropertyEditor(TypeInfo(string), TDBLookupProperties, 'ListField', TDBDynamicGridFieldProperty); |
434 |
< |
RegisterPropertyEditor(TypeInfo(string), TIBDynamicGrid, 'IndexFieldNames', TIBDynamicGridIndexNamesProperty); |
435 |
< |
RegisterPropertyEditor(TypeInfo(string), TDBLookupProperties, 'DataFieldName', TDBLookupPropertiesGridFieldProperty); |
436 |
< |
RegisterPropertyEditor(TypeInfo(string), TIBTreeView, 'KeyField', TIBTreeViewFieldProperty); |
437 |
< |
RegisterPropertyEditor(TypeInfo(string), TIBTreeView, 'TextField', TIBTreeViewFieldProperty); |
438 |
< |
RegisterPropertyEditor(TypeInfo(string), TIBTreeView, 'ParentField', TIBTreeViewFieldProperty); |
439 |
< |
RegisterPropertyEditor(TypeInfo(string), TIBTreeView, 'HasChildField', TIBTreeViewFieldProperty); |
492 |
> |
{ TIBLibraryNameProperty } |
493 |
|
|
494 |
+ |
function TIBLibraryNameProperty.GetFilter: string; |
495 |
+ |
begin |
496 |
+ |
Result := SLibraryNameFilter; {do not localise} |
497 |
|
end; |
498 |
|
|
499 |
< |
procedure LoadDataSourceFields(DataSource: TDataSource; List: TStrings); |
500 |
< |
var |
501 |
< |
DataSet: TDataSet; |
446 |
< |
i: Integer; |
499 |
> |
{ TIBXServiceEditor } |
500 |
> |
|
501 |
> |
procedure TIBXServiceEditor.ExecuteVerb(Index: Integer); |
502 |
|
begin |
503 |
< |
if Assigned(DataSource) then |
503 |
> |
if Index < inherited GetVerbCount then |
504 |
> |
inherited ExecuteVerb(Index) else |
505 |
|
begin |
506 |
< |
DataSet := DataSource.DataSet; |
507 |
< |
if Assigned(DataSet) then |
508 |
< |
begin |
453 |
< |
if DataSet.Fields.Count > 0 then |
454 |
< |
DataSet.GetFieldNames(List) |
455 |
< |
else |
456 |
< |
begin |
457 |
< |
DataSet.FieldDefs.Update; |
458 |
< |
for i := 0 to DataSet.FieldDefs.Count - 1 do |
459 |
< |
List.Add(DataSet.FieldDefs[i].Name); |
460 |
< |
end; |
506 |
> |
Dec(Index, inherited GetVerbCount); |
507 |
> |
case Index of |
508 |
> |
0 : if IBXServiceEditor.EditIBXService(TIBXServicesConnection(Component)) then Designer.Modified; |
509 |
|
end; |
510 |
|
end; |
511 |
|
end; |
512 |
|
|
513 |
< |
{ TDBLookupPropertiesGridFieldProperty } |
513 |
> |
function TIBXServiceEditor.GetVerb(Index: Integer): string; |
514 |
> |
begin |
515 |
> |
if Index < inherited GetVerbCount then |
516 |
> |
Result := inherited GetVerb(Index) else |
517 |
> |
begin |
518 |
> |
Dec(Index, inherited GetVerbCount); |
519 |
> |
case Index of |
520 |
> |
0: Result := SIBServiceEditor; |
521 |
> |
1 : Result := SInterbaseExpressVersion; |
522 |
> |
end; |
523 |
> |
end; |
524 |
> |
end; |
525 |
|
|
526 |
< |
procedure TDBLookupPropertiesGridFieldProperty.FillValues( |
468 |
< |
const Values: TStringList); |
469 |
< |
var |
470 |
< |
P: TDBLookupProperties; |
526 |
> |
function TIBXServiceEditor.GetVerbCount: Integer; |
527 |
|
begin |
528 |
< |
P :=TDBLookupProperties(GetComponent(0)); |
473 |
< |
if not (P is TDBLookupProperties) then exit; |
474 |
< |
LoadDataSourceFields(TIBDynamicGrid(P.Owner.Grid).DataSource, Values); |
528 |
> |
Result := inherited GetVerbCount + 2; |
529 |
|
end; |
530 |
|
|
531 |
< |
{ TIBTreeViewFieldProperty } |
531 |
> |
{ TIBUpdateRefreshSQLProperty } |
532 |
|
|
533 |
< |
procedure TIBTreeViewFieldProperty.FillValues(const Values: TStringList); |
480 |
< |
var ListSource: TDataSource; |
533 |
> |
function TIBUpdateRefreshSQLProperty.GetObjects: boolean; |
534 |
|
begin |
535 |
< |
ListSource := TIBTreeView(GetComponent(0)).DataSource; |
536 |
< |
LoadDataSourceFields(ListSource, Values); |
535 |
> |
Result := false; |
536 |
> |
FIBUpdate := GetComponent(0) as TIBUpdate; |
537 |
> |
if not assigned(FIBUpdate) or not assigned(FIBUpdate.DataSet) then |
538 |
> |
Exit; |
539 |
> |
FDatabase := nil; |
540 |
> |
if FIBUpdate.DataSet is TIBQuery then |
541 |
> |
begin |
542 |
> |
FDatabase := (FIBUpdate.DataSet as TIBQuery).Database; |
543 |
> |
Result := true |
544 |
> |
end; |
545 |
|
end; |
546 |
|
|
547 |
< |
{ TIBDynamicGridIndexNamesProperty } |
487 |
< |
|
488 |
< |
function TIBDynamicGridIndexNamesProperty.GetFieldDefs: TFieldDefs; |
489 |
< |
var Grid: TIBDynamicGrid; |
547 |
> |
procedure TIBUpdateRefreshSQLProperty.Edit; |
548 |
|
begin |
549 |
< |
Result := nil; |
550 |
< |
Grid := TIBDynamicGrid(GetComponent(0)); |
493 |
< |
if assigned(Grid.DataSource) and assigned(Grid.DataSource.DataSet) then |
494 |
< |
Result := Grid.DataSource.DataSet.FieldDefs |
549 |
> |
GetObjects; |
550 |
> |
if IBRefreshSQLEditor.EditSQL(FIBUpdate.DataSet,FIBUpdate.RefreshSQL) then Modified; |
551 |
|
end; |
552 |
|
|
553 |
< |
function TIBDynamicGridIndexNamesProperty.GetIndexFieldNames: string; |
554 |
< |
var Grid: TIBDynamicGrid; |
553 |
> |
{ TIBPackageNameProperty } |
554 |
> |
|
555 |
> |
procedure TIBPackageNameProperty.GetValues(Proc: TGetStrProc); |
556 |
> |
var |
557 |
> |
StoredProc : TIBStoredProc; |
558 |
> |
i : integer; |
559 |
|
begin |
560 |
< |
Grid := TIBDynamicGrid(GetComponent(0)); |
561 |
< |
Result := Grid.IndexFieldNames |
560 |
> |
StoredProc := GetComponent(0) as TIBStoredProc; |
561 |
> |
if StoredProc.Database = nil then |
562 |
> |
Exit; |
563 |
> |
|
564 |
> |
with StoredProc do |
565 |
> |
try |
566 |
> |
for I := 0 to PackageNames.Count - 1 do |
567 |
> |
Proc (PackageNames[i]); |
568 |
> |
except on E: Exception do |
569 |
> |
MessageDlg(E.Message,mtError,[mbOK],0) |
570 |
> |
end; |
571 |
|
end; |
572 |
|
|
573 |
< |
procedure TIBDynamicGridIndexNamesProperty.SetIndexFieldNames( |
574 |
< |
const Value: string); |
575 |
< |
var Grid: TIBDynamicGrid; |
573 |
> |
{ TIBIndexDefsProperty } |
574 |
> |
|
575 |
> |
procedure TIBIndexDefsProperty.Edit; |
576 |
> |
var IndexDefs: TIndexDefs; |
577 |
|
begin |
578 |
< |
Grid := TIBDynamicGrid(GetComponent(0)); |
579 |
< |
Grid.IndexFieldNames := Value |
578 |
> |
IndexDefs := TIndexDefs(GetObjectValue); |
579 |
> |
if IndexDefs <> nil then |
580 |
> |
IndexDefs.Update; |
581 |
> |
inherited Edit; |
582 |
|
end; |
583 |
|
|
584 |
< |
{ TDBDynamicGridFieldProperty } |
584 |
> |
{ TIBFieldDefsProperty } |
585 |
|
|
586 |
< |
procedure TDBDynamicGridFieldProperty.FillValues(const Values: TStringList); |
587 |
< |
var |
516 |
< |
P: TDBLookupProperties; |
586 |
> |
procedure TIBFieldDefsProperty.Edit; |
587 |
> |
var FieldDefs: TFieldDefs; |
588 |
|
begin |
589 |
< |
P :=TDBLookupProperties(GetComponent(0)); |
590 |
< |
if not (P is TDBLookupProperties) then exit; |
591 |
< |
LoadDataSourceFields(P.ListSource, Values); |
589 |
> |
FieldDefs := TFieldDefs(GetObjectValue); |
590 |
> |
if FieldDefs <> nil then |
591 |
> |
FieldDefs.Update; |
592 |
> |
inherited Edit; |
593 |
|
end; |
594 |
|
|
595 |
|
{ TIBServiceEditor } |
624 |
|
Result := inherited GetVerbCount + 2; |
625 |
|
end; |
626 |
|
|
627 |
+ |
function TIBFileNameProperty.GetFilter: string; |
628 |
+ |
begin |
629 |
+ |
Result := SDatabaseFilter; {do not localize} |
630 |
+ |
end; |
631 |
+ |
|
632 |
|
{ TIBFileNameProperty } |
633 |
|
procedure TIBFileNameProperty.Edit; |
634 |
|
begin |
635 |
|
with TOpenDialog.Create(Application) do |
636 |
|
try |
637 |
|
InitialDir := ExtractFilePath(GetStrValue); |
638 |
< |
Filter := SDatabaseFilter; {do not localize} |
638 |
> |
Filter := GetFilter; |
639 |
|
if Execute then |
640 |
|
SetStrValue(FileName); |
641 |
|
finally |
819 |
|
IBSQL: TIBSQL; |
820 |
|
begin |
821 |
|
IBSQL := GetComponent(0) as TIBSQL; |
822 |
< |
if IBSQLEditor.EditIBSQL(IBSQL) then Modified; |
822 |
> |
if IBSQLEditor.EditSQL(IBSQL) then Modified; |
823 |
|
end; |
824 |
|
|
825 |
|
{ TIBUpdateSQLEditor } |
833 |
|
begin |
834 |
|
case Index of |
835 |
|
0 : Result := SIBUpdateSQLEditor; |
836 |
< |
1: Result := SInterbaseExpressVersion; |
836 |
> |
1: Result := SInterbaseExpressVersion ; |
837 |
|
end; |
838 |
|
end; |
839 |
|
|
845 |
|
{ TIBDataSetEditor } |
846 |
|
|
847 |
|
procedure TIBDataSetEditor.ExecuteVerb(Index: Integer); |
771 |
– |
var |
772 |
– |
IBDataset: TIBDataset; |
848 |
|
begin |
849 |
|
if Index < inherited GetVerbCount then |
850 |
|
inherited ExecuteVerb(Index) else |
868 |
|
case Index of |
869 |
|
0: Result := SIBDataSetEditor; |
870 |
|
1: Result := SExecute; |
871 |
< |
2: Result := SInterbaseExpressVersion; |
871 |
> |
2: Result := SInterbaseExpressVersion ; |
872 |
|
end; |
873 |
|
end; |
874 |
|
end; |
925 |
|
Dec(Index, inherited GetVerbCount); |
926 |
|
case Index of |
927 |
|
0: Result := SIBDatabaseEditor; |
928 |
< |
1 : Result := SInterbaseExpressVersion; |
928 |
> |
1 : Result := SInterbaseExpressVersion ; |
929 |
|
end; |
930 |
|
end; |
931 |
|
end; |
948 |
|
begin |
949 |
|
case Index of |
950 |
|
0: Result := SIBTransactionEditor; |
951 |
< |
1: Result := SInterbaseExpressVersion; |
951 |
> |
1: Result := SInterbaseExpressVersion ; |
952 |
|
end; |
953 |
|
end; |
954 |
|
|
984 |
|
case Index of |
985 |
|
0: Result := SExecute; |
986 |
|
1: Result := SEditSQL; |
987 |
< |
2: Result := SInterbaseExpressVersion; |
987 |
> |
2: Result := SInterbaseExpressVersion ; |
988 |
|
end; |
989 |
|
end; |
990 |
|
end; |
1014 |
|
Dec(Index, inherited GetVerbCount); |
1015 |
|
case Index of |
1016 |
|
0: Result := SExecute; |
1017 |
< |
1: Result := SInterbaseExpressVersion; |
1017 |
> |
1: Result := SInterbaseExpressVersion ; |
1018 |
|
end; |
1019 |
|
end; |
1020 |
|
end; |
1024 |
|
Result := inherited GetVerbCount + 2; |
1025 |
|
end; |
1026 |
|
|
952 |
– |
{ TIBStoredProcParamsProperty } |
953 |
– |
|
954 |
– |
procedure TIBStoredProcParamsProperty.Edit; |
955 |
– |
var |
956 |
– |
StoredProc: TIBStoredProc; |
957 |
– |
Params: TParams; |
958 |
– |
begin |
959 |
– |
StoredProc := (GetComponent(0) as TIBStoredProc); |
960 |
– |
Params := TParams.Create(nil); |
961 |
– |
try |
962 |
– |
StoredProc.CopyParams(Params); |
963 |
– |
finally |
964 |
– |
Params.Free; |
965 |
– |
end; |
966 |
– |
inherited Edit; |
967 |
– |
end; |
968 |
– |
|
1027 |
|
{ TIBTableFieldLinkProperty } |
1028 |
|
|
1029 |
|
procedure TIBTableFieldLinkProperty.Edit; |
1082 |
|
procedure TIBRefreshSQLProperty.Edit; |
1083 |
|
var |
1084 |
|
IBDataset: TIBDataset; |
1027 |
– |
aDatabase: TIBDatabase; |
1085 |
|
begin |
1086 |
|
IBDataset := GetComponent(0) as TIBDataset; |
1087 |
|
if IBRefreshSQLEditor.EditSQL(IBDataSet,IBDataSet.RefreshSQL) then Modified; |
1168 |
|
|
1169 |
|
procedure TIBSQLEditor.ExecuteVerb(Index: Integer); |
1170 |
|
begin |
1171 |
< |
if IBSQLEditor.EditIBSQL(TIBSQL(Component)) then Modified; |
1171 |
> |
if IBSQLEditor.EditSQL(TIBSQL(Component)) then Modified; |
1172 |
|
end; |
1173 |
|
|
1174 |
|
function TIBSQLEditor.GetVerb(Index: Integer): string; |
1175 |
|
begin |
1176 |
|
case Index of |
1177 |
|
0 : Result := SIBSQLEditor; |
1178 |
< |
1: Result := SInterbaseExpressVersion; |
1178 |
> |
1: Result := SInterbaseExpressVersion ; |
1179 |
|
end; |
1180 |
|
end; |
1181 |
|
|
1191 |
|
IBSQL: TIBSQL; |
1192 |
|
begin |
1193 |
|
IBSQL := GetComponent(0) as TIBSQL; |
1194 |
< |
if IBSQLEditor.EditIBSQL(IBSQL) then Modified; |
1194 |
> |
if IBSQLEditor.EditSQL(IBSQL) then Modified; |
1195 |
|
end; |
1196 |
|
|
1197 |
|
initialization |