# CEGUI::ListHeaderSegment Class Reference

Base class for list header segment window. More...

Inheritance diagram for CEGUI::ListHeaderSegment:

[legend]
Collaboration diagram for CEGUI::ListHeaderSegment:

[legend]
List of all members.

## Public Types

enum | SortDirection { None, Ascending, Descending }
| Enumeration of possible values for sorting direction used with ListHeaderSegment classes. More...

## Public Member Functions

bool | isSizingEnabled (void) const
| Return whether this segment can be sized.
SortDirection | getSortDirection (void) const
| Return the current sort direction set for this segment.
bool | isDragMovingEnabled (void) const
| Return whether drag moving is enabled for this segment.
const Point & | getDragMoveOffset (void) const
| Return the current drag move position offset (in pixels relative to the top-left corner of the segment).
bool | isClickable (void) const
| Return whether the segment is clickable.
void | setSizingEnabled (bool setting)
| Set whether this segment can be sized.
void | setSortDirection (SortDirection sort_dir)
| Set the current sort direction set for this segment.
void | setDragMovingEnabled (bool setting)
| Set whether drag moving is allowed for this segment.
void | setClickable (bool setting)
| Set whether the segment is clickable.
| ListHeaderSegment (const String &type, const String &name)
| Constructor for list header segment base class.
virtual | ~ListHeaderSegment (void)
| Destructor for list header segment base class.

## Static Public Attributes

static const String | EventNamespace
| Namespace for global events.
static const String | EventSegmentClicked
| Event fired when the segment is clicked.
static const String | EventSplitterDoubleClicked
| Event fired when the sizer/splitter is double-clicked.
static const String | EventSizingSettingChanged
| Event fired when the sizing setting changes.
static const String | EventSortDirectionChanged
| Event fired when the sort direction value changes.
static const String | EventMovableSettingChanged
| Event fired when the movable setting changes.
static const String | EventSegmentDragStart
| Event fired when the segment has started to be dragged.
static const String | EventSegmentDragStop
| Event fired when segment dragging has stopped (via mouse release).
static const String | EventSegmentDragPositionChanged
| Event fired when the segment drag position has changed.
static const String | EventSegmentSized
| Event fired when the segment is sized.
static const String | EventClickableSettingChanged
| Event fired when the clickable state of the segment changes.
static const float | DefaultSizingArea = 8.0f
| Default size of the sizing area.
static const float | SegmentMoveThreshold = 12.0f
| Amount the mouse must be dragged before drag-moving is initiated.

## Protected Member Functions

void | addHeaderSegmentEvents (void)
| Add list header segment specific events.
void | doDragSizing (const Point &local_mouse)
| Update state for drag sizing.
void | doDragMoving (const Point &local_mouse)
| Update state for drag moving.
void | initDragMoving (void)
| Initialise the required states to put the widget into drag-moving mode.
void | initSizingHoverState (void)
| Initialise the required states when we are hovering over the sizing area.
void | initSegmentHoverState (void)
| Initialise the required states when we are hovering over the main segment area.
bool | isDragMoveThresholdExceeded (const Point &local_mouse)
| Return whether the required minimum movement threshold before initiating drag-moving has been exceeded.
virtual bool | testClassName_impl (const String &class_name) const
| Return whether this window was inherited from the given class name at some point in the inheritance heirarchy.
virtual void | onSegmentClicked (WindowEventArgs &e)
| Handler called when segment is clicked.
virtual void | onSplitterDoubleClicked (WindowEventArgs &e)
| Handler called when the sizer/splitter is double-clicked.
virtual void | onSizingSettingChanged (WindowEventArgs &e)
| Handler called when sizing setting changes.
virtual void | onSortDirectionChanged (WindowEventArgs &e)
| Handler called when the sort direction value changes.
virtual void | onMovableSettingChanged (WindowEventArgs &e)
| Handler called when the drag-movable setting is changed.
virtual void | onSegmentDragStart (WindowEventArgs &e)
| Handler called when the user starts dragging the segment.
virtual void | onSegmentDragStop (WindowEventArgs &e)
| Handler called when the user stops dragging the segment (releases mouse button).
virtual void | onSegmentDragPositionChanged (WindowEventArgs &e)
| Handler called when the drag position changes.
virtual void | onSegmentSized (WindowEventArgs &e)
| Handler called when the segment is sized.
virtual void | onClickableSettingChanged (WindowEventArgs &e)
| Handler called when the clickable setting for the segment changes.
virtual void | onMouseMove (MouseEventArgs &e)
| Handler called when the mouse cursor has been moved within this window's area.
virtual void | onMouseButtonDown (MouseEventArgs &e)
| Handler called when a mouse button has been depressed within this window's area.
virtual void | onMouseButtonUp (MouseEventArgs &e)
| Handler called when a mouse button has been released within this window's area.
virtual void | onMouseDoubleClicked (MouseEventArgs &e)
| Handler called when a mouse button has been double-clicked within this window's area.
virtual void | onMouseLeaves (MouseEventArgs &e)
| Handler called when the mouse cursor has left this window's area.
virtual void | onCaptureLost (WindowEventArgs &e)
| Handler called when this window loses capture of mouse inputs.

## Protected Attributes

const Image * | d_sizingMouseCursor
| Image to use for mouse when sizing (typically set by derived class).
const Image * | d_movingMouseCursor
| Image to use for mouse when moving (typically set by derived class).
float | d_splitterSize
| pixel width of the sizing area.
bool | d_splitterHover
| True if the mouse is over the splitter.
bool | d_dragSizing
| true when we are being sized.
Point | d_dragPoint
| point we are being dragged at when sizing or moving.
SortDirection | d_sortDir
| Direction for sorting (used for deciding what icon to display).
bool | d_segmentHover
| true when the mouse is within the segment area (and not in sizing area).
bool | d_segmentPushed
| true when the left mouse button has been pressed within the confines of the segment.
bool | d_sizingEnabled
| true when sizing is enabled for this segment.
bool | d_movingEnabled
| True when drag-moving is enabled for this segment;.
bool | d_dragMoving
| true when segment is being drag moved.
Point | d_dragPosition
| position of dragged segment.
bool | d_allowClicks
| true if the segment can be clicked.

## Detailed Description

Base class for list header segment window.

## Member Enumeration Documentation

enum CEGUI::ListHeaderSegment::SortDirection

Enumeration of possible values for sorting direction used with ListHeaderSegment classes.

Enumerator:

  None | Items under this segment should not be sorted.
  Ascending | Items under this segment should be sorted in ascending order.
  Descending | Items under this segment should be sorted in descending order.

## Member Function Documentation

void CEGUI::ListHeaderSegment::doDragMoving | ( | const Point & | local_mouse | ) | `[protected]`

Update state for drag moving.

Parameters:

  | local_mouse | Mouse position as a pixel offset from the top-left corner of this window.

Returns:
  Nothing.

void CEGUI::ListHeaderSegment::doDragSizing | ( | const Point & | local_mouse | ) | `[protected]`

Update state for drag sizing.

Parameters:

  | local_mouse | Mouse position as a pixel offset from the top-left corner of this window.

Returns:
  Nothing.

const Point& CEGUI::ListHeaderSegment::getDragMoveOffset | ( | void |  | ) | const`[inline]`

Return the current drag move position offset (in pixels relative to the top-left corner of the segment).

Returns:
  Point object describing the drag move offset position.

SortDirection CEGUI::ListHeaderSegment::getSortDirection | ( | void |  | ) | const`[inline]`

Return the current sort direction set for this segment.

Note that this has no impact on the way the segment functions (aside from the possibility of varied rendering). This is intended as a 'helper setting' to classes that make use of the ListHeaderSegment objects.

Returns:
  One of the SortDirection enumerated values indicating the current sort direction set for this segment.

bool CEGUI::ListHeaderSegment::isClickable | ( | void |  | ) | const`[inline]`

Return whether the segment is clickable.

Returns:
  true if the segment can be clicked, false of the segment can not be clicked (so no highlighting or events will happen).

bool CEGUI::ListHeaderSegment::isDragMoveThresholdExceeded | ( | const Point & | local_mouse | ) | `[protected]`

Return whether the required minimum movement threshold before initiating drag-moving has been exceeded.

Parameters:

  | local_mouse | Mouse position as a pixel offset from the top-left corner of this window.

Returns:
  true if the threshold has been exceeded and drag-moving should be initiated, or false if the threshold has not been exceeded.

bool CEGUI::ListHeaderSegment::isDragMovingEnabled | ( | void |  | ) | const`[inline]`

Return whether drag moving is enabled for this segment.

Returns:
  true if the segment can be drag moved, false if the segment can not be drag moved.

bool CEGUI::ListHeaderSegment::isSizingEnabled | ( | void |  | ) | const`[inline]`

Return whether this segment can be sized.

Returns:
  true if the segment can be horizontally sized, false if the segment can not be horizontally sized.

void CEGUI::ListHeaderSegment::onCaptureLost | ( | WindowEventArgs & | e | ) | `[protected, virtual]`

Handler called when this window loses capture of mouse inputs.

Parameters:

  | e | WindowEventArgs object whose 'window' pointer field is set to the window that triggered the event. For this event the trigger window is always 'this'.

Reimplemented from CEGUI::Window.

void CEGUI::ListHeaderSegment::onMouseButtonDown | ( | MouseEventArgs & | e | ) | `[protected, virtual]`

Handler called when a mouse button has been depressed within this window's area.

Parameters:

  | e | MouseEventArgs object. All fields are valid.

Reimplemented from CEGUI::Window.

void CEGUI::ListHeaderSegment::onMouseButtonUp | ( | MouseEventArgs & | e | ) | `[protected, virtual]`

Handler called when a mouse button has been released within this window's area.

Parameters:

  | e | MouseEventArgs object. All fields are valid.

Reimplemented from CEGUI::Window.

void CEGUI::ListHeaderSegment::onMouseDoubleClicked | ( | MouseEventArgs & | e | ) | `[protected, virtual]`

Handler called when a mouse button has been double-clicked within this window's area.

Parameters:

  | e | MouseEventArgs object. All fields are valid.

Reimplemented from CEGUI::Window.

void CEGUI::ListHeaderSegment::onMouseLeaves | ( | MouseEventArgs & | e | ) | `[protected, virtual]`

Handler called when the mouse cursor has left this window's area.

Parameters:

  | e | MouseEventArgs object. All fields are valid.

Reimplemented from CEGUI::Window.

void CEGUI::ListHeaderSegment::onMouseMove | ( | MouseEventArgs & | e | ) | `[protected, virtual]`

Handler called when the mouse cursor has been moved within this window's area.

Parameters:

  | e | MouseEventArgs object. All fields are valid.

Reimplemented from CEGUI::Window.

void CEGUI::ListHeaderSegment::setClickable | ( | bool | setting | ) |

Set whether the segment is clickable.

Parameters:

  | setting | true if the segment may be clicked, false of the segment may not be clicked (so no highlighting or events will happen).

Returns:
  Nothing.

void CEGUI::ListHeaderSegment::setDragMovingEnabled | ( | bool | setting | ) |

Set whether drag moving is allowed for this segment.

Parameters:

  | setting | true if the segment may be drag moved, false if the segment may not be drag moved.

Returns:
  Nothing.

void CEGUI::ListHeaderSegment::setSizingEnabled | ( | bool | setting | ) |

Set whether this segment can be sized.

Parameters:

  | setting | true if the segment may be horizontally sized, false if the segment may not be horizontally sized.

Returns:
  Nothing.

void CEGUI::ListHeaderSegment::setSortDirection | ( | SortDirection | sort_dir | ) |

Set the current sort direction set for this segment.

Note that this has no impact on the way the segment functions (aside from the possibility of varied rendering). This is intended as a 'helper setting' to classes that make use of the ListHeaderSegment objects.

Parameters:

  | sort_dir | One of the SortDirection enumerated values indicating the current sort direction set for this segment.

Returns:
  Nothing

virtual bool CEGUI::ListHeaderSegment::testClassName_impl | ( | const String & | class_name | ) | const`[inline, protected, virtual]`

Return whether this window was inherited from the given class name at some point in the inheritance heirarchy.

Parameters:

  | class_name | The class name that is to be checked.

Returns:
  true if this window was inherited from class_name. false if not.

Reimplemented from CEGUI::Window.