mirror of https://gitlab.com/basile.b/dexed.git
options are sorted
This commit is contained in:
parent
4e51c7bbe6
commit
ca84243cfa
|
|
@ -40,6 +40,7 @@ inherited CEOptionEditorWidget: TCEOptionEditorWidget
|
|||
HideSelection = False
|
||||
ReadOnly = True
|
||||
ScrollBars = ssAutoBoth
|
||||
SortType = stText
|
||||
TabOrder = 0
|
||||
OnDeletion = selCatDeletion
|
||||
OnSelectionChanged = selCatSelectionChanged
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ type
|
|||
private
|
||||
fEdOptsSubj: TCEEditableOptionsSubject;
|
||||
procedure updateCategories;
|
||||
function sortCategories(Cat1, Cat2: TTreeNode): integer;
|
||||
public
|
||||
constructor create(aOwner: TComponent); override;
|
||||
destructor destroy; override;
|
||||
|
|
@ -100,6 +101,12 @@ begin
|
|||
dt^.kind := ed.optionedWantEditorKind;
|
||||
dt^.observer := ed;
|
||||
end;
|
||||
selCat.Items.SortTopLevelNodes(@sortCategories);
|
||||
end;
|
||||
|
||||
function TCEOptionEditorWidget.sortCategories(Cat1, Cat2: TTreeNode): integer;
|
||||
begin
|
||||
result := CompareText(Cat1.Text, Cat2.Text);
|
||||
end;
|
||||
|
||||
procedure TCEOptionEditorWidget.selCatDeletion(Sender: TObject; Node: TTreeNode);
|
||||
|
|
|
|||
Loading…
Reference in New Issue