📄 ceguiframewindow.h
字号:
/***********************************************************************
filename: CEGUIFrameWindow.h
created: 13/4/2004
author: Paul D Turner
purpose: Interface to base class for FrameWindow
*************************************************************************/
/***************************************************************************
* 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 _CEGUIFrameWindow_h_
#define _CEGUIFrameWindow_h_
#include "CEGUIBase.h"
#include "CEGUIWindow.h"
#include "elements/CEGUIFrameWindowProperties.h"
#if defined(_MSC_VER)
# pragma warning(push)
# pragma warning(disable : 4251)
#endif
// Start of CEGUI namespace section
namespace CEGUI
{
/*!
\brief
Abstract base class for a movable, sizable, window with a title-bar and a frame.
*/
class CEGUIEXPORT FrameWindow : public Window
{
public:
static const String EventNamespace; //!< Namespace for global events
static const String WidgetTypeName; //!< Window factory name
/*************************************************************************
Constants
*************************************************************************/
// additional event names for this window
static const String EventRollupToggled; //!< Fired when the rollup (shade) state of the window changes
static const String EventCloseClicked; //!< Fired when the close button for the window is clicked.
// other bits
static const float DefaultSizingBorderSize; //!< Default size for the sizing border (in pixels)
/*************************************************************************
Child Widget name suffix constants
*************************************************************************/
static const String TitlebarNameSuffix; //!< Widget name suffix for the titlebar component.
static const String CloseButtonNameSuffix; //!< Widget name suffix for the close button component.
/*!
\brief
Enumeration that defines the set of possible locations for the mouse on a frame windows sizing border.
*/
enum SizingLocation {
SizingNone, //!< Position is not a sizing location.
SizingTopLeft, //!< Position will size from the top-left.
SizingTopRight, //!< Position will size from the top-right.
SizingBottomLeft, //!< Position will size from the bottom left.
SizingBottomRight, //!< Position will size from the bottom right.
SizingTop, //!< Position will size from the top.
SizingLeft, //!< Position will size from the left.
SizingBottom, //!< Position will size from the bottom.
SizingRight //!< Position will size from the right.
};
/*!
\brief
Initialises the Window based object ready for use.
\note
This must be called for every window created. Normally this is handled automatically by the WindowFactory for each Window type.
\return
Nothing
*/
virtual void initialiseComponents(void);
/*!
\brief
Return whether this window is sizable. Note that this requires that the window have an enabled frame and that sizing itself is enabled
\return
true if the window can be sized, false if the window can not be sized
*/
bool isSizingEnabled(void) const {return d_sizingEnabled && isFrameEnabled();}
/*!
\brief
Return whether the frame for this window is enabled.
\return
true if the frame for this window is enabled, false if the frame for this window is disabled.
*/
bool isFrameEnabled(void) const {return d_frameEnabled;}
/*!
\brief
Return whether the title bar for this window is enabled.
\return
true if the window has a title bar and it is enabled, false if the window has no title bar or if the title bar is disabled.
*/
bool isTitleBarEnabled(void) const;
/*!
\brief
Return whether this close button for this window is enabled.
\return
true if the window has a close button and it is enabled, false if the window either has no close button or if the close button is disabled.
*/
bool isCloseButtonEnabled(void) const;
/*!
\brief
Return whether roll up (a.k.a shading) is enabled for this window.
\return
true if roll up is enabled, false if roll up is disabled.
*/
bool isRollupEnabled(void) const {return d_rollupEnabled;}
/*!
\brief
Return whether the window is currently rolled up (a.k.a shaded).
\return
true if the window is rolled up, false if the window is not rolled up.
*/
bool isRolledup(void) const {return d_rolledup;}
/*!
\brief
Return the thickness of the sizing border.
\return
float value describing the thickness of the sizing border in screen pixels.
*/
float getSizingBorderThickness(void) const {return d_borderSize;}
/*!
\brief
Enables or disables sizing for this window.
\param setting
set to true to enable sizing (also requires frame to be enabled), or false to disable sizing.
\return
nothing
*/
void setSizingEnabled(bool setting);
/*!
\brief
Enables or disables the frame for this window.
\param setting
set to true to enable the frame for this window, or false to disable the frame for this window.
\return
Nothing.
*/
void setFrameEnabled(bool setting);
/*!
\brief
Enables or disables the title bar for the frame window.
\param setting
set to true to enable the title bar (if one is attached), or false to disable the title bar.
\return
Nothing.
*/
void setTitleBarEnabled(bool setting);
/*!
\brief
Enables or disables the close button for the frame window.
\param setting
Set to true to enable the close button (if one is attached), or false to disable the close button.
\return
Nothing.
*/
void setCloseButtonEnabled(bool setting);
/*!
\brief
Enables or disables roll-up (shading) for this window.
\param setting
Set to true to enable roll-up for the frame window, or false to disable roll-up.
\return
Nothing.
*/
void setRollupEnabled(bool setting);
/*!
\brief
Toggles the state of the window between rolled-up (shaded) and normal sizes. This requires roll-up to be enabled.
\return
Nothing
*/
void toggleRollup(void);
/*!
\brief
Set the size of the sizing border for this window.
\param pixels
float value specifying the thickness for the sizing border in screen pixels.
\return
Nothing.
*/
void setSizingBorderThickness(float pixels) {d_borderSize = pixels;}
/*!
\brief
Move the window by the pixel offsets specified in \a offset.
This is intended for internal system use - it is the method by which the title bar moves the frame window.
\param offset
Vector2 object containing the offsets to apply (offsets are in screen pixels).
\return
Nothing.
*/
void offsetPixelPosition(const Vector2& offset);
/*!
\brief
Return whether this FrameWindow can be moved by dragging the title bar.
\return
true if the Window will move when the user drags the title bar, false if the window will not move.
*/
bool isDragMovingEnabled(void) const {return d_dragMovable;}
/*!
\brief
Set whether this FrameWindow can be moved by dragging the title bar.
\param setting
true if the Window should move when the user drags the title bar, false if the window should not move.
\return
Nothing.
*/
void setDragMovingEnabled(bool setting);
/*!
\brief
Return a pointer to the currently set Image to be used for the north-south
sizing mouse cursor.
\return
Pointer to an Image object, or 0 for none.
*/
const Image* getNSSizingCursorImage() const;
/*!
\brief
Return a pointer to the currently set Image to be used for the east-west
sizing mouse cursor.
\return
Pointer to an Image object, or 0 for none.
*/
const Image* getEWSizingCursorImage() const;
/*!
\brief
Return a pointer to the currently set Image to be used for the northwest-southeast
sizing mouse cursor.
\return
Pointer to an Image object, or 0 for none.
*/
const Image* getNWSESizingCursorImage() const;
/*!
\brief
Return a pointer to the currently set Image to be used for the northeast-southwest
sizing mouse cursor.
\return
Pointer to an Image object, or 0 for none.
*/
const Image* getNESWSizingCursorImage() const;
/*!
\brief
Set the Image to be used for the north-south sizing mouse cursor.
\param image
Pointer to an Image object, or 0 for none.
\return
Nothing.
*/
void setNSSizingCursorImage(const Image* image);
/*!
\brief
Set the Image to be used for the east-west sizing mouse cursor.
\param image
Pointer to an Image object, or 0 for none.
\return
Nothing.
*/
void setEWSizingCursorImage(const Image* image);
/*!
\brief
Set the Image to be used for the northwest-southeast sizing mouse cursor.
\param image
Pointer to an Image object, or 0 for none.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -