Crazy Eddie's GUI System
0.8.4
|
Abstract base class for a movable, sizable, window with a title-bar and a frame. More...
Public Types | |
enum | SizingLocation { SizingNone, SizingTopLeft, SizingTopRight, SizingBottomLeft, SizingBottomRight, SizingTop, SizingLeft, SizingBottom, SizingRight } |
Enumeration that defines the set of possible locations for the mouse on a frame windows sizing border. More... | |
Public Member Functions | |
virtual void | initialiseComponents (void) |
Initialises the Window based object ready for use. | |
bool | isSizingEnabled (void) const |
Return whether this window is sizable. Note that this requires that the window have an enabled frame and that sizing itself is enabled. | |
bool | isFrameEnabled (void) const |
Return whether the frame for this window is enabled. | |
bool | isTitleBarEnabled (void) const |
Return whether the title bar for this window is enabled. | |
bool | isCloseButtonEnabled (void) const |
Return whether this close button for this window is enabled. | |
bool | isRollupEnabled (void) const |
Return whether roll up (a.k.a shading) is enabled for this window. | |
void | setRolledup (bool val) |
Sets whether the window is currently rolled up (a.k.a shaded). | |
bool | isRolledup (void) const |
Return whether the window is currently rolled up (a.k.a shaded). | |
float | getSizingBorderThickness (void) const |
Return the thickness of the sizing border. | |
void | setSizingEnabled (bool setting) |
Enables or disables sizing for this window. | |
void | setFrameEnabled (bool setting) |
Enables or disables the frame for this window. | |
void | setTitleBarEnabled (bool setting) |
Enables or disables the title bar for the frame window. | |
void | setCloseButtonEnabled (bool setting) |
Enables or disables the close button for the frame window. | |
void | setRollupEnabled (bool setting) |
Enables or disables roll-up (shading) for this window. | |
void | toggleRollup (void) |
Toggles the state of the window between rolled-up (shaded) and normal sizes. This requires roll-up to be enabled. | |
void | setSizingBorderThickness (float pixels) |
Set the size of the sizing border for this window. | |
void | offsetPixelPosition (const Vector2f &offset) |
Move the window by the pixel offsets specified in offset. | |
bool | isDragMovingEnabled (void) const |
Return whether this FrameWindow can be moved by dragging the title bar. | |
void | setDragMovingEnabled (bool setting) |
Set whether this FrameWindow can be moved by dragging the title bar. | |
const Image * | getNSSizingCursorImage () const |
Return a pointer to the currently set Image to be used for the north-south sizing mouse cursor. | |
const Image * | getEWSizingCursorImage () const |
Return a pointer to the currently set Image to be used for the east-west sizing mouse cursor. | |
const Image * | getNWSESizingCursorImage () const |
Return a pointer to the currently set Image to be used for the northwest-southeast sizing mouse cursor. | |
const Image * | getNESWSizingCursorImage () const |
Return a pointer to the currently set Image to be used for the northeast-southwest sizing mouse cursor. | |
void | setNSSizingCursorImage (const Image *image) |
Set the Image to be used for the north-south sizing mouse cursor. | |
void | setEWSizingCursorImage (const Image *image) |
Set the Image to be used for the east-west sizing mouse cursor. | |
void | setNWSESizingCursorImage (const Image *image) |
Set the Image to be used for the northwest-southeast sizing mouse cursor. | |
void | setNESWSizingCursorImage (const Image *image) |
Set the Image to be used for the northeast-southwest sizing mouse cursor. | |
void | setNSSizingCursorImage (const String &name) |
Set the image to be used for the north-south sizing mouse cursor. | |
void | setEWSizingCursorImage (const String &name) |
Set the image to be used for the east-west sizing mouse cursor. | |
void | setNWSESizingCursorImage (const String &name) |
Set the image to be used for the northwest-southeast sizing mouse cursor. | |
void | setNESWSizingCursorImage (const String &name) |
Set the image to be used for the northeast-southwest sizing mouse cursor. | |
bool | isHit (const Vector2f &position, const bool) const |
check if the given pixel position would hit this window. | |
Titlebar * | getTitlebar () const |
Return a pointer to the Titlebar component widget for this FrameWindow. | |
PushButton * | getCloseButton () const |
Return a pointer to the close button component widget for this FrameWindow. | |
FrameWindow (const String &type, const String &name) | |
Constructor for FrameWindow objects. | |
virtual | ~FrameWindow (void) |
Destructor for FramwWindow objects. | |
Static Public Attributes | |
static const String | EventNamespace |
Namespace for global events. | |
static const String | WidgetTypeName |
Window factory name. | |
static const String | EventRollupToggled |
static const String | EventCloseClicked |
static const String | EventDragSizingStarted |
static const String | EventDragSizingEnded |
static const float | DefaultSizingBorderSize |
Default size for the sizing border (in pixels) | |
static const String | TitlebarName |
Widget name for the titlebar component. | |
static const String | CloseButtonName |
Widget name for the close button component. | |
Protected Member Functions | |
bool | moveLeftEdge (float delta, URect &out_area) |
move the window's left edge by 'delta'. The rest of the window does not move, thus this changes the size of the Window. | |
bool | moveRightEdge (float delta, URect &out_area) |
move the window's right edge by 'delta'. The rest of the window does not move, thus this changes the size of the Window. | |
bool | moveTopEdge (float delta, URect &out_area) |
move the window's top edge by 'delta'. The rest of the window does not move, thus this changes the size of the Window. | |
bool | moveBottomEdge (float delta, URect &out_area) |
move the window's bottom edge by 'delta'. The rest of the window does not move, thus this changes the size of the Window. | |
SizingLocation | getSizingBorderAtPoint (const Vector2f &pt) const |
check local pixel co-ordinate point 'pt' and return one of the SizingLocation enumerated values depending where the point falls on the sizing border. | |
bool | isLeftSizingLocation (SizingLocation loc) const |
return true if given SizingLocation is on left edge. | |
bool | isRightSizingLocation (SizingLocation loc) const |
return true if given SizingLocation is on right edge. | |
bool | isTopSizingLocation (SizingLocation loc) const |
return true if given SizingLocation is on top edge. | |
bool | isBottomSizingLocation (SizingLocation loc) const |
return true if given SizingLocation is on bottom edge. | |
bool | closeClickHandler (const EventArgs &e) |
Method to respond to close button click events and fire our close event. | |
void | setCursorForPoint (const Vector2f &pt) const |
Set the appropriate mouse cursor for the given window-relative pixel point. | |
virtual Rectf | getSizingRect (void) const |
Return a Rect that describes, in window relative pixel co-ordinates, the outer edge of the sizing area for this window. | |
virtual void | onRollupToggled (WindowEventArgs &e) |
Event generated internally whenever the roll-up / shade state of the window changes. | |
virtual void | onCloseClicked (WindowEventArgs &e) |
Event generated internally whenever the close button is clicked. | |
virtual void | onDragSizingStarted (WindowEventArgs &e) |
Handler called when drag-sizing of the FrameWindow starts. | |
virtual void | onDragSizingEnded (WindowEventArgs &e) |
Handler called when drag-sizing of the FrameWindow ends. | |
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 | onCaptureLost (WindowEventArgs &e) |
Handler called when this window loses capture of mouse inputs. | |
virtual void | onTextChanged (WindowEventArgs &e) |
Handler called when the window's text is changed. | |
virtual void | onActivated (ActivationEventArgs &e) |
Handler called when this window has become the active window. | |
virtual void | onDeactivated (ActivationEventArgs &e) |
Handler called when this window has lost input focus and has been deactivated. | |
Protected Attributes | |
bool | d_frameEnabled |
true if window frame should be drawn. | |
bool | d_rollupEnabled |
true if roll-up of window is allowed. | |
bool | d_rolledup |
true if window is rolled up. | |
bool | d_sizingEnabled |
true if sizing is enabled for this window. | |
bool | d_beingSized |
true if window is being sized. | |
float | d_borderSize |
thickness of the sizing border around this window | |
Vector2f | d_dragPoint |
point window is being dragged at. | |
const Image * | d_nsSizingCursor |
North/South sizing cursor image. | |
const Image * | d_ewSizingCursor |
East/West sizing cursor image. | |
const Image * | d_nwseSizingCursor |
North-West/South-East cursor image. | |
const Image * | d_neswSizingCursor |
North-East/South-West cursor image. | |
bool | d_dragMovable |
true if the window will move when dragged by the title bar. |
Abstract base class for a movable, sizable, window with a title-bar and a frame.
Enumeration that defines the set of possible locations for the mouse on a frame windows sizing border.
PushButton* CEGUI::FrameWindow::getCloseButton | ( | ) | const |
Return a pointer to the close button component widget for this FrameWindow.
UnknownObjectException | Thrown if the close button component does not exist. |
const Image* CEGUI::FrameWindow::getEWSizingCursorImage | ( | ) | const |
const Image* CEGUI::FrameWindow::getNESWSizingCursorImage | ( | ) | const |
const Image* CEGUI::FrameWindow::getNSSizingCursorImage | ( | ) | const |
const Image* CEGUI::FrameWindow::getNWSESizingCursorImage | ( | ) | const |
SizingLocation CEGUI::FrameWindow::getSizingBorderAtPoint | ( | const Vector2f & | pt | ) | const [protected] |
check local pixel co-ordinate point 'pt' and return one of the SizingLocation enumerated values depending where the point falls on the sizing border.
pt | Point object describing, in pixels, the window relative offset to check. |
float CEGUI::FrameWindow::getSizingBorderThickness | ( | void | ) | const [inline] |
Return the thickness of the sizing border.
Titlebar* CEGUI::FrameWindow::getTitlebar | ( | ) | const |
Return a pointer to the Titlebar component widget for this FrameWindow.
UnknownObjectException | Thrown if the Titlebar component does not exist. |
virtual void CEGUI::FrameWindow::initialiseComponents | ( | void | ) | [virtual] |
Initialises the Window based object ready for use.
Reimplemented from CEGUI::Window.
bool CEGUI::FrameWindow::isBottomSizingLocation | ( | SizingLocation | loc | ) | const [inline, protected] |
return true if given SizingLocation is on bottom edge.
loc | SizingLocation value to be checked. |
bool CEGUI::FrameWindow::isCloseButtonEnabled | ( | void | ) | const |
Return whether this close button for this window is enabled.
bool CEGUI::FrameWindow::isDragMovingEnabled | ( | void | ) | const [inline] |
Return whether this FrameWindow can be moved by dragging the title bar.
bool CEGUI::FrameWindow::isFrameEnabled | ( | void | ) | const [inline] |
Return whether the frame for this window is enabled.
bool CEGUI::FrameWindow::isHit | ( | const Vector2f & | position, |
const bool | allow_disabled | ||
) | const [inline, virtual] |
check if the given pixel position would hit this window.
position | Vector2 object describing the position to check. The position describes a pixel offset from the top-left corner of the display. |
allow_disabled |
|
Reimplemented from CEGUI::Window.
References CEGUI::Window::isHit().
bool CEGUI::FrameWindow::isLeftSizingLocation | ( | SizingLocation | loc | ) | const [inline, protected] |
return true if given SizingLocation is on left edge.
loc | SizingLocation value to be checked. |
bool CEGUI::FrameWindow::isRightSizingLocation | ( | SizingLocation | loc | ) | const [inline, protected] |
return true if given SizingLocation is on right edge.
loc | SizingLocation value to be checked. |
bool CEGUI::FrameWindow::isRolledup | ( | void | ) | const [inline] |
Return whether the window is currently rolled up (a.k.a shaded).
bool CEGUI::FrameWindow::isRollupEnabled | ( | void | ) | const [inline] |
Return whether roll up (a.k.a shading) is enabled for this window.
bool CEGUI::FrameWindow::isSizingEnabled | ( | void | ) | const [inline] |
Return whether this window is sizable. Note that this requires that the window have an enabled frame and that sizing itself is enabled.
bool CEGUI::FrameWindow::isTitleBarEnabled | ( | void | ) | const |
Return whether the title bar for this window is enabled.
bool CEGUI::FrameWindow::isTopSizingLocation | ( | SizingLocation | loc | ) | const [inline, protected] |
return true if given SizingLocation is on top edge.
loc | SizingLocation value to be checked. |
bool CEGUI::FrameWindow::moveBottomEdge | ( | float | delta, |
URect & | out_area | ||
) | [protected] |
move the window's bottom edge by 'delta'. The rest of the window does not move, thus this changes the size of the Window.
delta | float value that specifies the amount to move the window edge, and in which direction. Positive values make window larger. |
bool CEGUI::FrameWindow::moveLeftEdge | ( | float | delta, |
URect & | out_area | ||
) | [protected] |
move the window's left edge by 'delta'. The rest of the window does not move, thus this changes the size of the Window.
delta | float value that specifies the amount to move the window edge, and in which direction. Positive values make window smaller. |
bool CEGUI::FrameWindow::moveRightEdge | ( | float | delta, |
URect & | out_area | ||
) | [protected] |
move the window's right edge by 'delta'. The rest of the window does not move, thus this changes the size of the Window.
delta | float value that specifies the amount to move the window edge, and in which direction. Positive values make window larger. |
bool CEGUI::FrameWindow::moveTopEdge | ( | float | delta, |
URect & | out_area | ||
) | [protected] |
move the window's top edge by 'delta'. The rest of the window does not move, thus this changes the size of the Window.
delta | float value that specifies the amount to move the window edge, and in which direction. Positive values make window smaller. |
void CEGUI::FrameWindow::offsetPixelPosition | ( | const Vector2f & | offset | ) |
Move the window by the pixel offsets specified in offset.
This is intended for internal system use - it is the method by which the title bar moves the frame window.
offset | Vector2 object containing the offsets to apply (offsets are in screen pixels). |
virtual void CEGUI::FrameWindow::onActivated | ( | ActivationEventArgs & | e | ) | [protected, virtual] |
Handler called when this window has become the active window.
e | ActivationEventArgs class whose 'otherWindow' field is set to the window that previously was active, or NULL for none. |
Reimplemented from CEGUI::Window.
virtual void CEGUI::FrameWindow::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.
virtual void CEGUI::FrameWindow::onDeactivated | ( | ActivationEventArgs & | e | ) | [protected, virtual] |
Handler called when this window has lost input focus and has been deactivated.
e | ActivationEventArgs object whose 'otherWindow' field is set to the window that has now become active, or NULL for none. |
Reimplemented from CEGUI::Window.
virtual void CEGUI::FrameWindow::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.
virtual void CEGUI::FrameWindow::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.
virtual void CEGUI::FrameWindow::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.
virtual void CEGUI::FrameWindow::onTextChanged | ( | WindowEventArgs & | e | ) | [protected, virtual] |
Handler called when the window's text is changed.
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.
void CEGUI::FrameWindow::setCloseButtonEnabled | ( | bool | setting | ) |
Enables or disables the close button for the frame window.
setting | Set to true to enable the close button (if one is attached), or false to disable the close button. |
void CEGUI::FrameWindow::setDragMovingEnabled | ( | bool | setting | ) |
Set whether this FrameWindow can be moved by dragging the title bar.
setting | true if the Window should move when the user drags the title bar, false if the window should not move. |
void CEGUI::FrameWindow::setEWSizingCursorImage | ( | const Image * | image | ) |
void CEGUI::FrameWindow::setEWSizingCursorImage | ( | const String & | name | ) |
Set the image to be used for the east-west sizing mouse cursor.
UnknownObjectException | thrown if either imageset or image refer to non-existant entities. |
void CEGUI::FrameWindow::setFrameEnabled | ( | bool | setting | ) |
Enables or disables the frame for this window.
setting | set to true to enable the frame for this window, or false to disable the frame for this window. |
void CEGUI::FrameWindow::setNESWSizingCursorImage | ( | const Image * | image | ) |
void CEGUI::FrameWindow::setNESWSizingCursorImage | ( | const String & | name | ) |
Set the image to be used for the northeast-southwest sizing mouse cursor.
UnknownObjectException | thrown if either imageset or image refer to non-existant entities. |
void CEGUI::FrameWindow::setNSSizingCursorImage | ( | const Image * | image | ) |
void CEGUI::FrameWindow::setNSSizingCursorImage | ( | const String & | name | ) |
Set the image to be used for the north-south sizing mouse cursor.
UnknownObjectException | thrown if either imageset or image refer to non-existant entities. |
void CEGUI::FrameWindow::setNWSESizingCursorImage | ( | const Image * | image | ) |
void CEGUI::FrameWindow::setNWSESizingCursorImage | ( | const String & | name | ) |
Set the image to be used for the northwest-southeast sizing mouse cursor.
UnknownObjectException | thrown if either imageset or image refer to non-existant entities. |
void CEGUI::FrameWindow::setRolledup | ( | bool | val | ) |
Sets whether the window is currently rolled up (a.k.a shaded).
void CEGUI::FrameWindow::setRollupEnabled | ( | bool | setting | ) |
Enables or disables roll-up (shading) for this window.
setting | Set to true to enable roll-up for the frame window, or false to disable roll-up. |
void CEGUI::FrameWindow::setSizingBorderThickness | ( | float | pixels | ) | [inline] |
Set the size of the sizing border for this window.
pixels | float value specifying the thickness for the sizing border in screen pixels. |
void CEGUI::FrameWindow::setSizingEnabled | ( | bool | setting | ) |
Enables or disables sizing for this window.
setting | set to true to enable sizing (also requires frame to be enabled), or false to disable sizing. |
void CEGUI::FrameWindow::setTitleBarEnabled | ( | bool | setting | ) |
Enables or disables the title bar for the frame window.
setting | set to true to enable the title bar (if one is attached), or false to disable the title bar. |
void CEGUI::FrameWindow::toggleRollup | ( | void | ) |
Toggles the state of the window between rolled-up (shaded) and normal sizes. This requires roll-up to be enabled.
const String CEGUI::FrameWindow::EventCloseClicked [static] |
Event fired when the close button for the window is clicked. Handlers are passed a const WindowEventArgs reference with WindowEventArgs::window set to the FrameWindow whose close button was clicked.
const String CEGUI::FrameWindow::EventDragSizingEnded [static] |
Event fired when drag-sizing of the window ends. Handlers are passed a const WindowEventArgs reference with WindowEventArgs::window set to the FrameWindow for which drag sizing has ended.
const String CEGUI::FrameWindow::EventDragSizingStarted [static] |
Event fired when drag-sizing of the window starts. Handlers are passed a const WindowEventArgs reference with WindowEventArgs::window set to the FrameWindow that has started to be drag sized.
const String CEGUI::FrameWindow::EventRollupToggled [static] |
Event fired when the rollup (shade) state of the window is changed. Handlers are passed a const WindowEventArgs reference with WindowEventArgs::window set to the FrameWindow whose rolled up state has been changed.