IDE: Improve Up/Down button behavior in component palette options.

git-svn-id: trunk@46893 -
This commit is contained in:
juha 2014-11-20 09:52:15 +00:00
parent 15239eb985
commit 530a72b248

View File

@ -71,6 +71,7 @@ type
private
fLocalOptions: TCompPaletteOptions;
fLocalUserOrder: TCompPaletteUserOrder;
fPrevPageIndex: Integer;
procedure WritePages(cpo: TCompPaletteOptions);
procedure WriteComponents(cpo: TCompPaletteOptions);
procedure FillPages;
@ -140,6 +141,8 @@ begin
CompMoveUpBtn.Hint:=lisMoveSelectedUp;
CompMoveDownBtn.Hint:=lisMoveSelectedDown;
fPrevPageIndex := -1;
UpdateButtons;
UpdatePageMoveButtons(PagesListBox.ItemIndex);
UpdateCompMoveButtons(ComponentsListView.ItemIndex);
@ -320,9 +323,12 @@ var
lb: TListBox;
begin
lb := Sender as TListBox;
if lb.ItemIndex = fPrevPageIndex then Exit;
FillComponents(lb.Items[lb.ItemIndex]);
UpdateButtons;
UpdateCompMoveButtons(ComponentsListView.ItemIndex);
UpdatePageMoveButtons(lb.ItemIndex);
UpdateCompMoveButtons(-1);
fPrevPageIndex := lb.ItemIndex;
end;
procedure TCompPaletteOptionsFrame.AddPageButtonClick(Sender: TObject);
@ -474,7 +480,8 @@ end;
procedure TCompPaletteOptionsFrame.ComponentsListViewChange(Sender: TObject;
Item: TListItem; Change: TItemChange);
begin
UpdateCompMoveButtons(ComponentsListView.ItemIndex);
if Item.Selected then
UpdateCompMoveButtons(ComponentsListView.Items.IndexOf(Item));
end;
procedure TCompPaletteOptionsFrame.ComponentsListViewClick(Sender: TObject);