📄 ceguidragcontainer.h
字号:
/***********************************************************************
filename: CEGUIDragContainer.h
created: 14/2/2005
author: Paul D Turner
*************************************************************************/
/***************************************************************************
* 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 _CEGUIDragContainer_h_
#define _CEGUIDragContainer_h_
#include "CEGUIWindow.h"
#include "CEGUIWindowFactory.h"
#include "elements/CEGUIDragContainerProperties.h"
#if defined(_MSC_VER)
# pragma warning(push)
# pragma warning(disable : 4251)
#endif
// Start of CEGUI namespace section
namespace CEGUI
{
/*!
\brief
Generic drag & drop enabled window class
*/
class CEGUIEXPORT DragContainer : public Window
{
public:
/*************************************************************************
Constants
*************************************************************************/
static const String WidgetTypeName; //!< Type name for DragContainer.
static const String EventNamespace; //!< Namespace for global events
static const String EventDragStarted; //!< Name of the event fired when the user begins dragging the thumb.
static const String EventDragEnded; //!< Name of the event fired when the user releases the thumb.
static const String EventDragPositionChanged; //!< Event fired when the drag position has changed.
static const String EventDragEnabledChanged; //!< Event fired when dragging is enabled or disabled.
static const String EventDragAlphaChanged; //!< Event fired when the alpha value used when dragging is changed.
static const String EventDragMouseCursorChanged;//!< Event fired when the mouse cursor used when dragging is changed.
static const String EventDragThresholdChanged; //!< Event fired when the drag pixel threshold is changed.
static const String EventDragDropTargetChanged; //!< Event fired when the drop target changes.
/*************************************************************************
Object Construction and Destruction
*************************************************************************/
/*!
\brief
Constructor for DragContainer objects
*/
DragContainer(const String& type, const String& name);
/*!
\brief
Destructor for DragContainer objects
*/
virtual ~DragContainer(void);
/*************************************************************************
Public Interface to DragContainer
*************************************************************************/
/*!
\brief
Return whether dragging is currently enabled for this DragContainer.
\return
- true if dragging is enabled and the DragContainer may be dragged.
- false if dragging is disabled and the DragContainer may not be dragged.
*/
bool isDraggingEnabled(void) const;
/*!
\brief
Set whether dragging is currently enabled for this DragContainer.
\param setting
- true to enable dragging so that the DragContainer may be dragged.
- false to disabled dragging so that the DragContainer may not be dragged.
\return
Nothing.
*/
void setDraggingEnabled(bool setting);
/*!
\brief
Return whether the DragContainer is currently being dragged.
\return
- true if the DragContainer is being dragged.
- false if te DragContainer is not being dragged.
*/
bool isBeingDragged(void) const;
/*!
\brief
Return the current drag threshold in pixels.
The drag threshold is the number of pixels that the mouse must be
moved with the left button held down in order to commence a drag
operation.
\return
float value indicating the current drag threshold value.
*/
float getPixelDragThreshold(void) const;
/*!
\brief
Set the current drag threshold in pixels.
The drag threshold is the number of pixels that the mouse must be
moved with the left button held down in order to commence a drag
operation.
\param pixels
float value indicating the new drag threshold value.
\return
Nothing.
*/
void setPixelDragThreshold(float pixels);
/*!
\brief
Return the alpha value that will be set on the DragContainer while a drag operation is
in progress.
\return
Current alpha value to use whilst dragging.
*/
float getDragAlpha(void) const;
/*!
\brief
Set the alpha value to be set on the DragContainer when a drag operation is
in progress.
This method can be used while a drag is in progress to update the alpha. Note that
the normal setAlpha method does not affect alpha while a drag is in progress, but
once the drag operation has ended, any value set via setAlpha will be restored.
\param alpha
Alpha value to use whilst dragging.
\return
Nothing.
*/
void setDragAlpha(float alpha);
/*!
\brief
Return the Image currently set to be used for the mouse cursor when a
drag operation is in progress.
\return
Image object currently set to be used as the mouse cursor when dragging.
*/
const Image* getDragCursorImage(void) const;
/*!
\brief
Set the Image to be used for the mouse cursor when a drag operation is
in progress.
This method may be used during a drag operation to update the current mouse
cursor image.
\param image
Image object to be used as the mouse cursor while dragging.
\return
Nothing.
*/
void setDragCursorImage(const Image* image);
/*!
\brief
Set the Image to be used for the mouse cursor when a drag operation is
in progress.
This method may be used during a drag operation to update the current mouse
cursor image.
\param image
One of the MouseCursorImage enumerated values.
\return
Nothing.
*/
void setDragCursorImage(MouseCursorImage image);
/*!
\brief
Set the Image to be used for the mouse cursor when a drag operation is
in progress.
This method may be used during a drag operation to update the current mouse
cursor image.
\param imageset
String holding the name of the Imageset that contains the Image to be used.
\param image
Image defined for the Imageset \a imageset to be used as the mouse cursor
when dragging.
\return
Nothing.
\exception UnknownObjectException thrown if either \a imageset or \a image are unknown.
*/
void setDragCursorImage(const String& imageset, const String& image);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -