[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Menus' (#lcl)

# TMergedMenuItems.DefaultSort

Implements the default sort routine for merged menu items.

## Declaration

Source position: menus.pp line 133

`public class function TMergedMenuItems.DefaultSort(`
`aItem1: Pointer;`
`aItem2: Pointer;`
`aParentItem: Pointer`
`):Integer;`

## Arguments

`aItem1` |  | Pointer to the first menu item for the sort comparison.
`aItem2` |  | Pointer to the second menu item for the sort comparison.
`aParentItem` |  | Pointer to the Parent menu item for the compared values.

## Function result

Numeric value with the relative order for the specified menu items.

## Description

If the specified menu items have the same GroupIndex value, the return value is:

1
  AParentItem is the menu item in AItem1.
-1
  AParentItem is not the menu item in AItem2.

Otherwise:

< 0
  AItem1 has a group index that comes before AItem2.
> 0
  AItem1 has a group index that comes after A2Item2.