From 94c4596ba4a310af55cabdbb47f777ce479d20f7 Mon Sep 17 00:00:00 2001 From: wp Date: Fri, 21 Sep 2018 16:44:23 +0000 Subject: [PATCH] LCL: Fix FlowPanel component editor to correctly enable/disable buttons when opened. git-svn-id: trunk@59116 - --- components/ideintf/collectionpropeditform.pas | 2 +- components/ideintf/propedits.pp | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/components/ideintf/collectionpropeditform.pas b/components/ideintf/collectionpropeditform.pas index 0ff5c10bcb..3a71d21b69 100644 --- a/components/ideintf/collectionpropeditform.pas +++ b/components/ideintf/collectionpropeditform.pas @@ -46,7 +46,6 @@ type procedure Modified; protected procedure UpdateCaption; - procedure UpdateButtons; procedure PersistentAdded({%H-}APersistent: TPersistent; {%H-}Select: boolean); procedure ComponentRenamed(AComponent: TComponent); procedure PersistentDeleting(APersistent: TPersistent); @@ -54,6 +53,7 @@ type public procedure SetCollection(NewCollection: TCollection; NewOwnerPersistent: TPersistent; const NewPropName: String); + procedure UpdateButtons; public property Collection: TCollection read FCollection; property OwnerComponent: TPersistent read FOwnerComponent; diff --git a/components/ideintf/propedits.pp b/components/ideintf/propedits.pp index 11b86d9e91..b3f309a967 100644 --- a/components/ideintf/propedits.pp +++ b/components/ideintf/propedits.pp @@ -4499,9 +4499,13 @@ begin CollectionForm.SetCollection(ACollection, OwnerPersistent, PropName); CollectionForm.AddButton.Show; CollectionForm.Deletebutton.Show; + CollectionForm.AddButton.Left := 0; + CollectionForm.DeleteButton.Left := 1; CollectionForm.DividerToolButton.Show; + CollectionForm.DividerToolButton.Left := CollectionForm.DeleteButton.Left + 1; SetPopupModeParentForPropertyEditor(CollectionForm); CollectionForm.EnsureVisible; + CollectionForm.UpdateButtons; Result:=CollectionForm; end; @@ -4535,10 +4539,9 @@ begin CollectionForm.AddButton.Hide; CollectionForm.Deletebutton.Hide; CollectionForm.DividerToolButton.Hide; - CollectionForm.MoveUpButton.Enabled := false; - CollectionForm.MoveDownButton.Enabled := false; SetPopupModeParentForPropertyEditor(CollectionForm); CollectionForm.EnsureVisible; + CollectionForm.UpdateButtons; Result := CollectionForm; end;