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
|
HideSelection = False
|
||||||
ReadOnly = True
|
ReadOnly = True
|
||||||
ScrollBars = ssAutoBoth
|
ScrollBars = ssAutoBoth
|
||||||
|
SortType = stText
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
OnDeletion = selCatDeletion
|
OnDeletion = selCatDeletion
|
||||||
OnSelectionChanged = selCatSelectionChanged
|
OnSelectionChanged = selCatSelectionChanged
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ type
|
||||||
private
|
private
|
||||||
fEdOptsSubj: TCEEditableOptionsSubject;
|
fEdOptsSubj: TCEEditableOptionsSubject;
|
||||||
procedure updateCategories;
|
procedure updateCategories;
|
||||||
|
function sortCategories(Cat1, Cat2: TTreeNode): integer;
|
||||||
public
|
public
|
||||||
constructor create(aOwner: TComponent); override;
|
constructor create(aOwner: TComponent); override;
|
||||||
destructor destroy; override;
|
destructor destroy; override;
|
||||||
|
|
@ -100,6 +101,12 @@ begin
|
||||||
dt^.kind := ed.optionedWantEditorKind;
|
dt^.kind := ed.optionedWantEditorKind;
|
||||||
dt^.observer := ed;
|
dt^.observer := ed;
|
||||||
end;
|
end;
|
||||||
|
selCat.Items.SortTopLevelNodes(@sortCategories);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TCEOptionEditorWidget.sortCategories(Cat1, Cat2: TTreeNode): integer;
|
||||||
|
begin
|
||||||
|
result := CompareText(Cat1.Text, Cat2.Text);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCEOptionEditorWidget.selCatDeletion(Sender: TObject; Node: TTreeNode);
|
procedure TCEOptionEditorWidget.selCatDeletion(Sender: TObject; Node: TTreeNode);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue