windows menu sorted

This commit is contained in:
Basile Burg 2015-03-27 04:19:02 +01:00
parent a151020a41
commit 875a41d01f
2 changed files with 12 additions and 0 deletions

View File

@ -447,6 +447,7 @@ begin
fWidgList.addWidget(@fTodolWidg);
fWidgList.addWidget(@fOptEdWidg);
fWidgList.addWidget(@fSymlWidg);
fWidgList.sort(@CompareWidgCaption);
{$IFDEF WIN32}
fWidgList.addWidget(@fCdbWidg);

View File

@ -100,6 +100,8 @@ type
property widget[index: integer]: TCEWidget read getWidget;
end;
TWidgetEnumerator = class
fList: TCEWidgetList;
fIndex: Integer;
@ -110,6 +112,8 @@ type
operator enumerator(aWidgetList: TCEWidgetList): TWidgetEnumerator;
function CompareWidgCaption(Item1, Item2: Pointer): Integer;
implementation
{$R *.lfm}
@ -304,6 +308,13 @@ end;
{$ENDREGION}
{$REGION TCEWidgetList----------------------------------------------------------}
function CompareWidgCaption(Item1, Item2: Pointer): Integer;
type
PWidg = ^TCEWidget;
begin
result := AnsiCompareStr(PWidg(Item1)^.Caption, PWidg(Item2)^.Caption);
end;
function TCEWidgetList.getWidget(index: integer): TCEWidget;
begin
result := PTCEWidget(Items[index])^;