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. | |
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 Image * | getSizingCursorImage () const |
const Image * | getMovingCursorImage () 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 &imageset, const String &image) |
void | setMovingCursorImage (const Image *image) |
void | setMovingCursorImage (const String &imageset, const String &image) |
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 |
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 | 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 hierarchy. | |
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. |
Enumeration of possible values for sorting direction used with ListHeaderSegment classes.
void CEGUI::ListHeaderSegment::doDragMoving | ( | const Point & | local_mouse | ) | [protected] |
Update state for drag moving.
local_mouse | Mouse position as a pixel offset from the top-left corner of this window. |
References d_dragPoint, d_dragPosition, CEGUI::Vector2::d_x, CEGUI::Vector2::d_y, and onSegmentDragPositionChanged().
Referenced by onMouseMove().
void CEGUI::ListHeaderSegment::doDragSizing | ( | const Point & | local_mouse | ) | [protected] |
Update state for drag sizing.
local_mouse | Mouse position as a pixel offset from the top-left corner of this window. |
References CEGUI::UDim::asAbsolute(), CEGUI::Window::d_area, d_dragPoint, CEGUI::URect::d_max, CEGUI::Window::d_maxSize, CEGUI::URect::d_min, CEGUI::Window::d_minSize, CEGUI::Window::d_pixelSize, CEGUI::Size::d_width, CEGUI::UVector2::d_x, CEGUI::Vector2::d_x, CEGUI::UVector2::d_y, CEGUI::System::getRenderer(), CEGUI::System::getSingleton(), CEGUI::URect::getSize(), CEGUI::Renderer::getWidth(), onSegmentSized(), and CEGUI::Window::setArea_impl().
Referenced by onMouseMove().
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).
Referenced by CEGUI::FalagardListHeaderSegment::render().
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.
Referenced by CEGUI::FalagardListHeaderSegment::render().
bool CEGUI::ListHeaderSegment::isClickable | ( | void | ) | const [inline] |
Return whether the segment is clickable.
Referenced by initSegmentHoverState(), and CEGUI::FalagardListHeaderSegment::render().
bool CEGUI::ListHeaderSegment::isDragMoveThresholdExceeded | ( | const Point & | local_mouse | ) | [protected] |
Return whether the required minimum movement threshold before initiating drag-moving has been exceeded.
local_mouse | Mouse position as a pixel offset from the top-left corner of this window. |
References d_dragPoint, CEGUI::Vector2::d_x, CEGUI::Vector2::d_y, and SegmentMoveThreshold.
Referenced by onMouseMove().
bool CEGUI::ListHeaderSegment::isDragMovingEnabled | ( | void | ) | const [inline] |
Return whether drag moving is enabled for this segment.
bool CEGUI::ListHeaderSegment::isSizingEnabled | ( | void | ) | const [inline] |
Return whether this segment can be sized.
Referenced by onMouseButtonDown().
void CEGUI::ListHeaderSegment::onCaptureLost | ( | WindowEventArgs & | e | ) | [protected, virtual] |
Handler called when this window loses capture of mouse inputs.
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.
References d_dragMoving, d_dragSizing, d_segmentPushed, and CEGUI::EventArgs::handled.
void CEGUI::ListHeaderSegment::onMouseButtonDown | ( | MouseEventArgs & | e | ) | [protected, virtual] |
Handler called when a mouse button has been depressed within this window's area.
e | MouseEventArgs object. All fields are valid. |
Reimplemented from CEGUI::Window.
References CEGUI::MouseEventArgs::button, CEGUI::Window::captureInput(), d_dragPoint, d_dragSizing, d_segmentPushed, d_splitterHover, CEGUI::EventArgs::handled, isSizingEnabled(), CEGUI::LeftButton, CEGUI::MouseEventArgs::position, and CEGUI::CoordConverter::screenToWindow().
void CEGUI::ListHeaderSegment::onMouseButtonUp | ( | MouseEventArgs & | e | ) | [protected, virtual] |
Handler called when a mouse button has been released within this window's area.
e | MouseEventArgs object. All fields are valid. |
Reimplemented from CEGUI::Window.
References CEGUI::MouseEventArgs::button, d_dragMoving, d_segmentHover, d_segmentPushed, CEGUI::Window::getMouseCursor(), CEGUI::MouseCursor::getSingleton(), CEGUI::EventArgs::handled, CEGUI::LeftButton, onSegmentClicked(), onSegmentDragStop(), CEGUI::Window::releaseInput(), and CEGUI::MouseCursor::setImage().
void CEGUI::ListHeaderSegment::onMouseDoubleClicked | ( | MouseEventArgs & | e | ) | [protected, virtual] |
Handler called when a mouse button has been double-clicked within this window's area.
e | MouseEventArgs object. All fields are valid. |
Reimplemented from CEGUI::Window.
References CEGUI::MouseEventArgs::button, d_splitterHover, CEGUI::EventArgs::handled, CEGUI::LeftButton, and onSplitterDoubleClicked().
void CEGUI::ListHeaderSegment::onMouseLeaves | ( | MouseEventArgs & | e | ) | [protected, virtual] |
Handler called when the mouse cursor has left this window's area.
e | MouseEventArgs object. All fields are valid. |
Reimplemented from CEGUI::Window.
References d_dragSizing, d_segmentHover, d_splitterHover, and CEGUI::Window::requestRedraw().
void CEGUI::ListHeaderSegment::onMouseMove | ( | MouseEventArgs & | e | ) | [protected, virtual] |
Handler called when the mouse cursor has been moved within this window's area.
e | MouseEventArgs object. All fields are valid. |
Reimplemented from CEGUI::Window.
References d_dragMoving, d_dragSizing, CEGUI::Window::d_pixelSize, d_segmentHover, d_segmentPushed, d_sizingEnabled, d_splitterHover, d_splitterSize, CEGUI::Size::d_width, CEGUI::Vector2::d_x, doDragMoving(), doDragSizing(), CEGUI::Window::getMouseCursor(), CEGUI::MouseCursor::getSingleton(), CEGUI::EventArgs::handled, initDragMoving(), initSegmentHoverState(), initSizingHoverState(), isDragMoveThresholdExceeded(), CEGUI::Window::isHit(), CEGUI::MouseEventArgs::position, CEGUI::Window::requestRedraw(), CEGUI::CoordConverter::screenToWindow(), and CEGUI::MouseCursor::setImage().
void CEGUI::ListHeaderSegment::setClickable | ( | bool | setting | ) |
Set whether the segment is clickable.
setting | true if the segment may be clicked, false of the segment may not be clicked (so no highlighting or events will happen). |
References d_allowClicks, and onClickableSettingChanged().
Referenced by CEGUI::ListHeader::createInitialisedSegment().
void CEGUI::ListHeaderSegment::setDragMovingEnabled | ( | bool | setting | ) |
Set whether drag moving is allowed for this segment.
setting | true if the segment may be drag moved, false if the segment may not be drag moved. |
References d_movingEnabled, and onMovableSettingChanged().
Referenced by CEGUI::ListHeader::createInitialisedSegment().
void CEGUI::ListHeaderSegment::setSizingEnabled | ( | bool | setting | ) |
Set whether this segment can be sized.
setting | true if the segment may be horizontally sized, false if the segment may not be horizontally sized. |
References d_dragSizing, d_sizingEnabled, onSizingSettingChanged(), and CEGUI::Window::releaseInput().
Referenced by CEGUI::ListHeader::createInitialisedSegment().
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.
sort_dir | One of the SortDirection enumerated values indicating the current sort direction set for this segment. |
References d_sortDir, onSortDirectionChanged(), and CEGUI::Window::requestRedraw().
Referenced by CEGUI::ListHeader::setSortColumn(), and CEGUI::ListHeader::setSortDirection().
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 hierarchy.
class_name | The class name that is to be checked. |
Reimplemented from CEGUI::Window.
References CEGUI::Window::testClassName_impl().