Index: ide/toolbarconfig.pas
===================================================================
--- ide/toolbarconfig.pas	(revision 56145)
+++ ide/toolbarconfig.pas	(working copy)
@@ -103,6 +103,7 @@
     procedure ExchangeMainListItem(Item1, Item2: TListItem);
     procedure SetupCaptions;
     procedure LoadCategories;
+    procedure SortCategories(ACtgList: TStrings);
     procedure AddMenuItem(ParentNode: TTreeNode; CmdItem: TIDEButtonCommand);
     function RootNodeCaption(CmdItem: TIDEButtonCommand): string;
     procedure AddListItem(CmdItem: TIDEButtonCommand);
@@ -504,25 +505,69 @@
   i, l: integer;
   xCategory: TIDEToolButtonCategory;
   xCaption: string;
-  n: TTreeNode;
+  Node: TTreeNode;
+  SortedCtgList: TStringList;
 begin
   TV.Items.BeginUpdate;
+  SortedCtgList := TStringList.Create;
   try
-    TV.Items.Clear;
+    SortedCtgList.OwnsObjects := False;
     for i := 0 to IDEToolButtonCategories.Count-1 do
     begin
       xCategory := IDEToolButtonCategories[i];
-      xCaption := xCategory.Description;
+      SortedCtgList.AddObject(xCategory.Description, xCategory);
+    end;
+    SortCategories(SortedCtgList);
+
+    TV.Items.Clear;
+    for i := 0 to SortedCtgList.Count-1 do
+    begin
+      xCaption := SortedCtgList[i];
+      xCategory := SortedCtgList.Objects[i] as TIDEToolButtonCategory;
       DeleteAmpersands(xCaption);
-      n := TV.Items.AddChild(nil, Format('%s', [xCaption]));
+      Node := TV.Items.AddChild(nil, Format('%s', [xCaption]));
       for l := 0 to xCategory.ButtonCount-1 do
-        AddMenuItem(n, xCategory.Buttons[l]);
+        AddMenuItem(Node, xCategory.Buttons[l]);
     end;
   finally
+    SortedCtgList.Free;
     TV.Items.EndUpdate;
   end;
 end;
 
+procedure TToolBarConfig.SortCategories(ACtgList: TStrings);
+var
+  NewIndex: Integer;
+
+  procedure MoveItem(s: String);
+  var
+    OldIndex: Integer;
+  begin
+    OldIndex := ACtgList.IndexOf(s);
+    if (OldIndex<0) or (NewIndex>=ACtgList.Count) then Exit;
+    ACtgList.Move(OldIndex, NewIndex);
+    Inc(NewIndex);
+  end;
+
+begin
+  NewIndex := 0;
+  MoveItem(srkmCatFileMenu);
+  MoveItem(srkmCatCmdCmd);
+  MoveItem(srkmCatSelection);
+  MoveItem(srkmCatMacroRecording);
+  MoveItem(srkmCatSearchReplace);
+  MoveItem(srkmCatMarker);
+  MoveItem(srkmCatViewMenu);
+  MoveItem(srkmCatCodeTools);
+  MoveItem(srkmCatEditing);
+  MoveItem(srkmCatProjectMenu);
+  MoveItem(srkmCatRunMenu);
+  MoveItem(srkmCatPackageMenu);
+  MoveItem(srkmCatToolMenu);
+  MoveItem(srkmCatSrcNoteBook);
+  MoveItem(srkmCarHelpMenu);
+end;
+
 procedure TToolBarConfig.AddMenuItem(ParentNode: TTreeNode; CmdItem: TIDEButtonCommand);
 var
   n: TTreeNode;
