📄 ceguilistheadersegment.h
字号:
/***********************************************************************
filename: CEGUIListHeaderSegment.h
created: 15/6/2004
author: Paul D Turner
purpose: Interface to list header segment class.
*************************************************************************/
/***************************************************************************
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
***************************************************************************/
#ifndef _CEGUIListHeaderSegment_h_
#define _CEGUIListHeaderSegment_h_
#include "CEGUIBase.h"
#include "CEGUIWindow.h"
#include "elements/CEGUIListHeaderSegmentProperties.h"
#if defined(_MSC_VER)
# pragma warning(push)
# pragma warning(disable : 4251)
#endif
// Start of CEGUI namespace section
namespace CEGUI
{
/*!
\brief
Base class for list header segment window
*/
class CEGUIEXPORT ListHeaderSegment : public Window
{
public:
static const String EventNamespace; //!< Namespace for global events
static const String WidgetTypeName; //!< Window factory name
/*************************************************************************
Constants
*************************************************************************/
// Event names
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.
// Defaults
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.
/*************************************************************************
Enumerated types
*************************************************************************/
/*!
\brief
Enumeration of possible values for sorting direction used with ListHeaderSegment classes
*/
enum SortDirection
{
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.
};
/*************************************************************************
Accessor Methods
*************************************************************************/
/*!
\brief
Return whether this segment can be sized.
\return
true if the segment can be horizontally sized, false if the segment can not be horizontally sized.
*/
bool isSizingEnabled(void) const {return d_sizingEnabled;}
/*!
\brief
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.
\return
One of the SortDirection enumerated values indicating the current sort direction set for this
segment.
*/
SortDirection getSortDirection(void) const {return d_sortDir;}
/*!
\brief
Return whether drag moving is enabled for this segment.
\return
true if the segment can be drag moved, false if the segment can not be drag moved.
*/
bool isDragMovingEnabled(void) const {return d_movingEnabled;}
/*!
\brief
Return the current drag move position offset (in pixels relative to the top-left corner of the segment).
\return
Point object describing the drag move offset position.
*/
const Point& getDragMoveOffset(void) const {return d_dragPosition;}
/*!
\brief
Return whether the segment is clickable.
\return
true if the segment can be clicked, false of the segment can not be clicked (so no highlighting or events will happen).
*/
bool isClickable(void) const {return d_allowClicks;}
/*!
\brief
Return whether the segment is currently in its hovering state.
*/
bool isSegmentHovering(void) const {return d_segmentHover;}
/*!
\brief
Return whether the segment is currently in its pushed state.
*/
bool isSegmentPushed(void) const {return d_segmentPushed;}
/*!
\brief
Return whether the splitter is currently in its hovering state.
*/
bool isSplitterHovering(void) const {return d_splitterHover;}
/*!
\brief
Return whether the segment is currently being drag-moved.
*/
bool isBeingDragMoved(void) const {return d_dragMoving;}
/*!
\brief
Return whether the segment is currently being drag-moved.
*/
bool isBeingDragSized(void) const {return d_dragSizing;}
const Image* getSizingCursorImage() const;
const Image* getMovingCursorImage() const;
/*************************************************************************
Manipulator Methods
*************************************************************************/
/*!
\brief
Set whether this segment can be sized.
\param setting
true if the segment may be horizontally sized, false if the segment may not be horizontally sized.
\return
Nothing.
*/
void setSizingEnabled(bool setting);
/*!
\brief
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.
\param sort_dir
One of the SortDirection enumerated values indicating the current sort direction set for this
segment.
\return
Nothing
*/
void setSortDirection(SortDirection sort_dir);
/*!
\brief
Set whether drag moving is allowed for this segment.
\param setting
true if the segment may be drag moved, false if the segment may not be drag moved.
\return
Nothing.
*/
void setDragMovingEnabled(bool setting);
/*!
\brief
Set whether the segment is clickable.
\param setting
true if the segment may be clicked, false of the segment may not be clicked (so no highlighting or events will happen).
\return
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -