Crazy Eddie's GUI System  0.8.4
CEGUI::ListHeaderSegment Class Reference

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

+ Inheritance diagram for CEGUI::ListHeaderSegment:
+ Collaboration diagram for CEGUI::ListHeaderSegment:

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 Vector2fgetDragMoveOffset (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.
bool isSegmentHovering (void) const
 Return whether the segment is currently in its hovering state.
bool isSegmentPushed (void) const
 Return whether the segment is currently in its pushed state.
bool isSplitterHovering (void) const
 Return whether the splitter is currently in its hovering state.
bool isBeingDragMoved (void) const
 Return whether the segment is currently being drag-moved.
bool isBeingDragSized (void) const
 Return whether the segment is currently being drag-moved.
const ImagegetSizingCursorImage () const
const ImagegetMovingCursorImage () const
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.
void setSizingCursorImage (const Image *image)
void setSizingCursorImage (const String &name)
void setMovingCursorImage (const Image *image)
void setMovingCursorImage (const String &name)
 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 WidgetTypeName
 Window factory name.
static const String EventSegmentClicked
static const String EventSplitterDoubleClicked
static const String EventSizingSettingChanged
static const String EventSortDirectionChanged
static const String EventMovableSettingChanged
static const String EventSegmentDragStart
static const String EventSegmentDragStop
static const String EventSegmentDragPositionChanged
static const String EventSegmentSized
static const String EventClickableSettingChanged
static const float DefaultSizingArea
 Default size of the sizing area.
static const float SegmentMoveThreshold
 Amount the mouse must be dragged before drag-moving is initiated.

Protected Member Functions

void doDragSizing (const Vector2f &local_mouse)
 Update state for drag sizing.
void doDragMoving (const Vector2f &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 Vector2f &local_mouse)
 Return whether the required minimum movement threshold before initiating drag-moving has been exceeded.
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 is no longer over this window's surface area. This will be called when the mouse is not over a part of this Window's actual surface - even though technically the mouse is still within the Window's area, for example if the mouse moves over a child window.
virtual void onCaptureLost (WindowEventArgs &e)
 Handler called when this window loses capture of mouse inputs.

Protected Attributes

const Imaged_sizingMouseCursor
 Image to use for mouse when sizing (typically set by derived class).
const Imaged_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.
Vector2f 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.
Vector2f 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

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 Vector2f local_mouse) [protected]

Update state for drag moving.

Parameters:
local_mouseMouse position as a pixel offset from the top-left corner of this window.
Returns:
Nothing.
void CEGUI::ListHeaderSegment::doDragSizing ( const Vector2f local_mouse) [protected]

Update state for drag sizing.

Parameters:
local_mouseMouse position as a pixel offset from the top-left corner of this window.
Returns:
Nothing.
const Vector2f& 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.

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 Vector2f local_mouse) [protected]

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

Parameters:
local_mouseMouse 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.
virtual void CEGUI::ListHeaderSegment::onCaptureLost ( WindowEventArgs e) [protected, virtual]

Handler called when this window loses capture of mouse inputs.

Parameters:
eWindowEventArgs 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.

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

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

Parameters:
eMouseEventArgs object. All fields are valid.

Reimplemented from CEGUI::Window.

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

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

Parameters:
eMouseEventArgs object. All fields are valid.

Reimplemented from CEGUI::Window.

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

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

Parameters:
eMouseEventArgs object. All fields are valid.

Reimplemented from CEGUI::Window.

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

Handler called when the mouse cursor is no longer over this window's surface area. This will be called when the mouse is not over a part of this Window's actual surface - even though technically the mouse is still within the Window's area, for example if the mouse moves over a child window.

Parameters:
eMouseEventArgs object. All fields are valid.
See also:
Window::onMouseLeavesArea

Reimplemented from CEGUI::Window.

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

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

Parameters:
eMouseEventArgs object. All fields are valid.

Reimplemented from CEGUI::Window.

Set whether the segment is clickable.

Parameters:
settingtrue if the segment may be clicked, false of the segment may not be clicked (so no highlighting or events will happen).
Returns:
Nothing.

Set whether drag moving is allowed for this segment.

Parameters:
settingtrue if the segment may be drag moved, false if the segment may not be drag moved.
Returns:
Nothing.

Set whether this segment can be sized.

Parameters:
settingtrue if the segment may be horizontally sized, false if the segment may not be horizontally sized.
Returns:
Nothing.

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_dirOne of the SortDirection enumerated values indicating the current sort direction set for this segment.
Returns:
Nothing

Member Data Documentation

Event fired when the clickable setting for the segment is changed. Hanlders are passed a const WindowEventArgs reference with WindowEventArgs::window set to the ListHeaderSegment whose setting that controls whether the segment is clickable has been changed.

Event fired when the user drag-movable setting is changed. Hanlders are passed a const WindowEventArgs reference with WindowEventArgs::window set to the ListHeaderSegment whose user drag-movable setting has been changed.

Event fired when the segment is clicked. Hanlders are passed a const WindowEventArgs reference with WindowEventArgs::window set to the ListHeaderSegment that was clicked.

Event fired when the segment drag position has changed. Hanlders are passed a const WindowEventArgs reference with WindowEventArgs::window set to the ListHeaderSegment whose position has changed due to being dragged.

Event fired when the segment has started to be dragged. Hanlders are passed a const WindowEventArgs reference with WindowEventArgs::window set to the ListHeaderSegment that has started to be dragged.

Event fired when segment dragging has stopped (via mouse release). Hanlders are passed a const WindowEventArgs reference with WindowEventArgs::window set to the ListHeaderSegment that is no longer being dragged.

Event fired when the segment is sized by the user. Hanlders are passed a const WindowEventArgs reference with WindowEventArgs::window set to the ListHeaderSegment that has been resized by the user dragging.

Event fired when the user drag-sizable setting is changed. Hanlders are passed a const WindowEventArgs reference with WindowEventArgs::window set to the ListHeaderSegment whose user sizable setting has been changed.

Event fired when the sort direction value is changed. Hanlders are passed a const WindowEventArgs reference with WindowEventArgs::window set to the ListHeaderSegment whose sort direction has been changed.

Event fired when the sizer/splitter is double-clicked. Hanlders are passed a const WindowEventArgs reference with WindowEventArgs::window set to the ListHeaderSegment whose sizer / splitter area was double-clicked.

 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends