diff --git a/components/ideintf/actionseditor.pas b/components/ideintf/actionseditor.pas index fb62dd1382..1feed7679f 100644 --- a/components/ideintf/actionseditor.pas +++ b/components/ideintf/actionseditor.pas @@ -139,7 +139,7 @@ type procedure lstActionNameDblClick(Sender: TObject); protected procedure OnComponentRenamed(AComponent: TComponent); - procedure OnComponentSelection(const NewSelection: TPersistentSelectionList); + procedure OnComponentSelection(NewSelection: TPersistentSelectionList); procedure OnComponentDelete(APersistent: TPersistent); procedure OnRefreshPropertyValues; function GetSelectedAction: TContainedAction; @@ -477,8 +477,7 @@ begin lstActionName.Items[i] := AComponent.Name; end; -procedure TActionListEditor.OnComponentSelection( - const NewSelection: TPersistentSelectionList); +procedure TActionListEditor.OnComponentSelection(NewSelection: TPersistentSelectionList); var CurAct: TContainedAction; tmpCategory: String; diff --git a/components/ideintf/fieldseditor.pas b/components/ideintf/fieldseditor.pas index bc1766767c..c97cdf7b5f 100644 --- a/components/ideintf/fieldseditor.pas +++ b/components/ideintf/fieldseditor.pas @@ -81,8 +81,8 @@ type procedure SelectionChanged(AOrderChanged: Boolean = false); procedure OnComponentRenamed(AComponent: TComponent); procedure OnPersistentDeleting(APersistent: TPersistent); - procedure OnGetSelection(const ASelection: TPersistentSelectionList); - procedure OnSetSelection(const ASelection: TPersistentSelectionList); + procedure OnGetSelection(ASelection: TPersistentSelectionList); + procedure OnSetSelection(ASelection: TPersistentSelectionList); procedure OnPersistentAdded(APersistent: TPersistent; Select: boolean); private LinkDataset: TDataset; @@ -450,8 +450,7 @@ begin FieldsListBox.Items.Delete(i); end; -procedure TDSFieldsEditorFrm.OnGetSelection( - const ASelection: TPersistentSelectionList); +procedure TDSFieldsEditorFrm.OnGetSelection(ASelection: TPersistentSelectionList); var i: integer; begin if Not Assigned(ASelection) then exit; @@ -461,8 +460,7 @@ begin ASelection.Add(TPersistent(FieldsListBox.Items.Objects[i])); end; -procedure TDSFieldsEditorFrm.OnSetSelection( - const ASelection: TPersistentSelectionList); +procedure TDSFieldsEditorFrm.OnSetSelection(ASelection: TPersistentSelectionList); var i, j: integer; begin if Assigned(ASelection) then begin diff --git a/components/ideintf/objectinspector.pp b/components/ideintf/objectinspector.pp index fccbc83766..c879a5e78c 100644 --- a/components/ideintf/objectinspector.pp +++ b/components/ideintf/objectinspector.pp @@ -764,10 +764,11 @@ type function PersistentToString(APersistent: TPersistent): string; procedure AddPersistentToList(APersistent: TPersistent; List: TStrings); procedure HookLookupRootChange; + procedure HookRefreshPropertyValues; procedure FillPersistentComboBox; procedure SetAvailComboBoxText; - procedure HookGetSelection(const ASelection: TPersistentSelectionList); - procedure HookSetSelection(const ASelection: TPersistentSelectionList); + procedure HookGetSelection(ASelection: TPersistentSelectionList); + procedure HookSetSelection(ASelection: TPersistentSelectionList); procedure DestroyNoteBook; procedure CreateNoteBook; procedure ShowNextPage(Delta: integer); @@ -821,7 +822,6 @@ type function GetCurRowDefaultValue(var DefaultStr: string): Boolean; function HasParentCandidates: Boolean; procedure ChangeParent; - procedure HookRefreshPropertyValues; procedure ActivateGrid(Grid: TOICustomPropertyGrid); procedure FocusGrid(Grid: TOICustomPropertyGrid = nil); public @@ -1385,7 +1385,6 @@ procedure TOICustomPropertyGrid.SetPropertyEditorHook( begin if FPropertyEditorHook=NewPropertyEditorHook then exit; FPropertyEditorHook:=NewPropertyEditorHook; - FPropertyEditorHook.AddHandlerGetCheckboxForBoolean(@HookGetCheckboxForBoolean); IncreaseChangeStep; SetSelection(FSelection); end; @@ -4501,7 +4500,12 @@ begin Selection := nil; for Page:=Low(TObjectInspectorPage) to High(TObjectInspectorPage) do if GridControl[Page]<>nil then + begin + if Page=oipgpProperties then // Add HookGetCheckboxForBoolean only once. + FPropertyEditorHook.AddHandlerGetCheckboxForBoolean( + @GridControl[Page].HookGetCheckboxForBoolean); GridControl[Page].PropertyEditorHook:=FPropertyEditorHook; + end; OldSelection:=TPersistentSelectionList.Create; try FPropertyEditorHook.GetSelection(OldSelection); @@ -4612,6 +4616,11 @@ begin FillComponentList(True); end; +procedure TObjectInspectorDlg.HookRefreshPropertyValues; +begin + RefreshPropertyValues; +end; + procedure TObjectInspectorDlg.ChangeCompZOrderInList(APersistent: TPersistent; AZOrder: TZOrderDelete); begin @@ -5250,13 +5259,13 @@ begin end; end; -procedure TObjectInspectorDlg.HookGetSelection(const ASelection: TPersistentSelectionList); +procedure TObjectInspectorDlg.HookGetSelection(ASelection: TPersistentSelectionList); begin if ASelection=nil then exit; ASelection.Assign(FSelection); end; -procedure TObjectInspectorDlg.HookSetSelection(const ASelection: TPersistentSelectionList); +procedure TObjectInspectorDlg.HookSetSelection(ASelection: TPersistentSelectionList); begin Selection := ASelection; end; @@ -6052,11 +6061,6 @@ begin RestrictedGrid.Filter := Filter + [tkMethod]; end; -procedure TObjectInspectorDlg.HookRefreshPropertyValues; -begin - RefreshPropertyValues; -end; - procedure TObjectInspectorDlg.ActivateGrid(Grid: TOICustomPropertyGrid); begin if Grid=PropertyGrid then NoteBook.PageIndex:=0 diff --git a/components/ideintf/propedits.pp b/components/ideintf/propedits.pp index 28d8b06b75..8f128c1eef 100644 --- a/components/ideintf/propedits.pp +++ b/components/ideintf/propedits.pp @@ -1360,10 +1360,8 @@ type TPropHookPersistentDeleting = procedure(APersistent: TPersistent) of object; TPropHookPersistentDeleted = procedure of object; TPropHookDeletePersistent = procedure(var APersistent: TPersistent) of object; - TPropHookGetSelection = procedure(const ASelection: TPersistentSelectionList - ) of object; - TPropHookSetSelection = procedure(const ASelection: TPersistentSelectionList - ) of object; + TPropHookGetSelection = procedure(ASelection: TPersistentSelectionList) of object; + TPropHookSetSelection = procedure(ASelection: TPersistentSelectionList) of object; TPropHookAddDependency = procedure(const AClass: TClass; const AnUnitName: shortstring) of object; // persistent objects diff --git a/components/sparta/smartformeditor/source/sparta_componentpalette.pas b/components/sparta/smartformeditor/source/sparta_componentpalette.pas index 5cdb08c0c4..24ce62ce8d 100644 --- a/components/sparta/smartformeditor/source/sparta_componentpalette.pas +++ b/components/sparta/smartformeditor/source/sparta_componentpalette.pas @@ -71,7 +71,7 @@ type procedure RefreshSearchResult; procedure UpdateComponentsList; - procedure OnDesignSetSelection(const ASelection: TPersistentSelectionList); + procedure OnDesignSetSelection(ASelection: TPersistentSelectionList); public constructor Create(AOwner: TComponent; AParent: TWinControl; AIgnoreRoot: Boolean = False); reintroduce; destructor Destroy; override; @@ -609,7 +609,7 @@ begin RefreshSearchResult; end; -procedure TComponentsPalette.OnDesignSetSelection(const ASelection: TPersistentSelectionList); +procedure TComponentsPalette.OnDesignSetSelection(ASelection: TPersistentSelectionList); begin // to replace original components palette if not FIgnoreRoot or (csDestroying in ComponentState) then diff --git a/components/tachart/editors/tasubcomponentseditor.pas b/components/tachart/editors/tasubcomponentseditor.pas index 0fed9333a3..dc8a7f584d 100644 --- a/components/tachart/editors/tasubcomponentseditor.pas +++ b/components/tachart/editors/tasubcomponentseditor.pas @@ -66,10 +66,10 @@ type function FindChild(ACandidate: TPersistent; out AIndex: Integer): Boolean; procedure MoveSelection(AStart, ADir: Integer); procedure OnComponentRenamed(AComponent: TComponent); - procedure OnGetSelection(const ASelection: TPersistentSelectionList); + procedure OnGetSelection(ASelection: TPersistentSelectionList); procedure OnPersistentAdded(APersistent: TPersistent; ASelect: Boolean); procedure OnPersistentDeleting(APersistent: TPersistent); - procedure OnSetSelection(const ASelection: TPersistentSelectionList); + procedure OnSetSelection(ASelection: TPersistentSelectionList); procedure RefreshList; procedure SelectionChanged(AOrderChanged: Boolean = false); protected @@ -298,8 +298,7 @@ begin BuildCaption; end; -procedure TComponentListEditorForm.OnGetSelection( - const ASelection: TPersistentSelectionList); +procedure TComponentListEditorForm.OnGetSelection(ASelection: TPersistentSelectionList); var i: Integer; begin @@ -336,8 +335,7 @@ begin end; end; -procedure TComponentListEditorForm.OnSetSelection( - const ASelection: TPersistentSelectionList); +procedure TComponentListEditorForm.OnSetSelection(ASelection: TPersistentSelectionList); var i, j: Integer; begin diff --git a/designer/anchoreditor.pas b/designer/anchoreditor.pas index a11f89ce30..a2eeea515f 100644 --- a/designer/anchoreditor.pas +++ b/designer/anchoreditor.pas @@ -183,7 +183,7 @@ type FSideControls: array[TAnchorKind] of TAnchorDesignerSideControls; procedure Refresh; procedure OnRefreshPropertyValues; - procedure OnSetSelection(const ASelection: TPersistentSelectionList); + procedure OnSetSelection(ASelection: TPersistentSelectionList); function GetSelectedControls: TList; function FindSibling(const Sibling: string): TControl; procedure FillComboBoxWithSiblings(AComboBox: TComboBox); @@ -1167,8 +1167,7 @@ begin end; end; -procedure TAnchorDesigner.OnSetSelection( - const ASelection: TPersistentSelectionList); +procedure TAnchorDesigner.OnSetSelection(ASelection: TPersistentSelectionList); begin if FSelection.IsEqual(ASelection) then exit; Refresh; diff --git a/designer/menueditorform.pas b/designer/menueditorform.pas index fff9a1a52d..95cce26a71 100644 --- a/designer/menueditorform.pas +++ b/designer/menueditorform.pas @@ -90,7 +90,7 @@ type procedure HidePopupAssignmentsInfo; procedure InitializeStatisticVars; procedure LoadFixedButtonGlyphs; - procedure OnDesignerSetSelection(const ASelection: TPersistentSelectionList); + procedure OnDesignerSetSelection(ASelection: TPersistentSelectionList); procedure ProcessForPopup(aControl: TControl); procedure SetupPopupAssignmentsDisplay; public @@ -279,7 +279,7 @@ begin OpenURL(helpPath); end; -procedure TMenuDesignerForm.OnDesignerSetSelection(const ASelection: TPersistentSelectionList); +procedure TMenuDesignerForm.OnDesignerSetSelection(ASelection: TPersistentSelectionList); var mnu: TMenu; mi, tmp: TMenuItem; diff --git a/designer/taborderdlg.pas b/designer/taborderdlg.pas index 836c48d73c..f1f0622c3b 100644 --- a/designer/taborderdlg.pas +++ b/designer/taborderdlg.pas @@ -70,7 +70,7 @@ type procedure PersistentAdded({%H-}APersistent: TPersistent; {%H-}Select: boolean); procedure PersistentDeleting({%H-}APersistent: TPersistent); procedure DeletePersistent(var {%H-}APersistent: TPersistent); - procedure SetSelection(const ASelection: TPersistentSelectionList); + procedure SetSelection(ASelection: TPersistentSelectionList); end; { TTabOrderPropEditor } @@ -436,7 +436,7 @@ begin SomethingChanged; end; -procedure TTabOrderDialog.SetSelection(const ASelection: TPersistentSelectionList); +procedure TTabOrderDialog.SetSelection(ASelection: TPersistentSelectionList); // Select item also in TreeView when selection in Designer changes. function FindSelection: TTreeNode; diff --git a/ide/main.pp b/ide/main.pp index 221cc13f52..16dc59b0c9 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -580,7 +580,7 @@ type procedure ControlSelectionChanged(Sender: TObject; ForceUpdate: Boolean); procedure ControlSelectionPropsChanged(Sender: TObject); procedure ControlSelectionFormChanged(Sender: TObject; OldForm, NewForm: TCustomForm); - procedure GetDesignerSelection(const ASelection: TPersistentSelectionList); + procedure GetDesignerSelection(ASelection: TPersistentSelectionList); // project inspector event handlers function ProjInspectorAddUnitToProject(Sender: TObject; @@ -9485,7 +9485,7 @@ begin MainIDEBar.UpdateIDEComponentPalette(true); end; -procedure TMainIDE.GetDesignerSelection(const ASelection: TPersistentSelectionList); +procedure TMainIDE.GetDesignerSelection(ASelection: TPersistentSelectionList); begin if TheControlSelection=nil then exit; TheControlSelection.GetSelection(ASelection);