class
TDropDownAreaPlacement
template<typename PositionType, typename SizeType = PositionType>Determines how will the drop down box be positioned.
Usually the system will attempt to position the drop box in a way so all elements can fit, and this class allows you to specify some limitations on how that works.
Public
Constructors
TDropDownAreaPlacement<PositionType, SizeType>
Methods
staticAroundPosition
Drop down box will be placed at the specified position.
By default the system prefers the top left corner of the box to correspond to the position, but if other corners offer more space for the contents, those will be used instead.
staticAroundBoundsVertical
Drop down box will be placed at the specified bounds.
Box will be horizontally aligned to the left of the provided bounds. Vertically system prefers placing the box at the bottom of the bounds, but may choose to align it with the top of the bounds if it offers more space for the contents.
staticAroundBoundsHorizontal
Drop down box will be placed at the specified bounds.
Box will be vertically aligned to the top of the provided bounds. Horizontally system prefers placing the box at the right of the bounds, but may choose to align it with the left of the bounds if it offers more space for the contents.
staticAroundBounds
Drop down box will be placed at the specified bounds.
Box will be vertically aligned to the top or bottom of the provided bounds, with bottom being preferred. Horizontally system prefers placing the box at the right of the bounds, but may choose to align it with the left of the bounds if it offers more space for the contents.
GetBounds
Returns bounds around which to position the drop down box if one of the bounds positioning types is used.
GetPosition
Returns position around which to position the drop down box if position positioning type is used.
GetOptimalBounds
Calculates the optimal bounds to place an element of the specified size, within the available area using the internal data as a guide.
- size
- Size of the element to try to position, in pixels.
- availableArea
- Available area to try to position the element in, in pixels.
- outHorizontalDirection
- Output parameter that signals the preferred horizontal direction of the bounds (left or right).
- outVerticalDirection
- Output parameter that signals the preferred vertical direction of the bounds (up or down).