CEGUI::Window Class Reference

An abstract base class providing common functionality and specifying the required interface for derived classes. More...

Inherits CEGUI::PropertySet, and CEGUI::EventSet.

Inherited by CEGUI::ButtonBase, CEGUI::ClippedContainer, CEGUI::Combobox, CEGUI::DragContainer, CEGUI::Editbox, CEGUI::FrameWindow, CEGUI::GroupBox, CEGUI::GUISheet, CEGUI::ItemEntry, CEGUI::ItemListBase, CEGUI::Listbox, CEGUI::ListHeader, CEGUI::ListHeaderSegment, CEGUI::MultiColumnList, CEGUI::MultiLineEditbox, CEGUI::ProgressBar, CEGUI::ScrollablePane, CEGUI::Scrollbar, CEGUI::ScrolledContainer, CEGUI::Slider, CEGUI::Spinner, CEGUI::TabControl, CEGUI::Titlebar, CEGUI::Tooltip, and CEGUI::Tree.

Collaboration diagram for CEGUI::Window:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Window (const String &type, const String &name)
 Constructor for Window base class.
virtual ~Window (void)
 Destructor for Window base class.
const StringgetType (void) const
 return a String object holding the type name for this Window.
const StringgetName (void) const
 return a String object holding the name of this Window.
const StringgetPrefix (void) const
bool isDestroyedByParent (void) const
 returns whether or not this Window is set to be destroyed when its parent window is destroyed.
bool isAlwaysOnTop (void) const
 returns whether or not this Window is an always on top Window. Also known as a top-most window.
bool isDisabled (bool localOnly=false) const
 return whether the Window is currently disabled
bool isVisible (bool localOnly=false) const
 return true if the Window is currently visible.
bool isActive (void) const
 return true if this is the active Window. An active window is a window that may receive user inputs.
bool isClippedByParent (void) const
 return true if this Window is clipped so that its rendering will not pass outside of its parent Window area.
uint getID (void) const
 return the ID code currently assigned to this Window by client code.
size_t getChildCount (void) const
 return the number of child Window objects currently attached to this Window.
bool isChild (const String &name) const
 returns whether a Window with the specified name is currently attached to this Window as a child.
bool isChild (uint ID) const
 returns whether at least one window with the given ID code is attached to this Window as a child.
bool isChildRecursive (uint ID) const
 returns whether at least one window with the given ID code is attached to this Window or any of it's children as a child.
bool isChild (const Window *window) const
 return true if the given Window is a child of this window.
WindowgetChild (const String &name) const
 return a pointer to the child window with the specified name.
WindowrecursiveChildSearch (const String &name) const
 This is / was intended for internal use only (should have had protected visibility). This function is deprecated - do not use this function at all, ever. The only reason this function is still here is to maintain ABI compatibility for the 0.6.x series of releases. This function will be gone in 0.7.0.
WindowgetChild (uint ID) const
 return a pointer to the first attached child window with the specified ID value.
WindowgetChildRecursive (const String &name) const
 return a pointer to the first attached child window with the specified name. Children are traversed recursively.
WindowgetChildRecursive (uint ID) const
 return a pointer to the first attached child window with the specified ID value. Children are traversed recursively.
WindowgetChildAtIdx (size_t idx) const
 return a pointer to the child window that is attached to 'this' at the given index.
WindowgetActiveChild (void)
 return a pointer to the Window that currently has input focus starting with this Window.
const WindowgetActiveChild (void) const
bool isAncestor (const String &name) const
 return true if the specified Window is some ancestor of this Window
bool isAncestor (uint ID) const
 return true if any Window with the given ID is some ancestor of this Window.
bool isAncestor (const Window *window) const
 return true if the specified Window is some ancestor of this Window.
FontgetFont (bool useDefault=true) const
 return the active Font object for the Window.
const StringgetText (void) const
 return the current text for the Window
bool inheritsAlpha (void) const
 return true if the Window inherits alpha from its parent(s).
float getAlpha (void) const
 return the current alpha value set for this Window
float getEffectiveAlpha (void) const
 return the effective alpha value that will be used when rendering this window, taking into account inheritance of parent window(s) alpha.
Rect getPixelRect (void) const
 return a Rect object describing the Window area in screen space.
virtual Rect getPixelRect_impl (void) const
 return a Rect object describing the Window area in screen space.
Rect getInnerRect (void) const
 return a Rect object describing the clipped inner area for this window.
Rect getUnclippedPixelRect (void) const
 return a Rect object describing the Window area unclipped, in screen space.
Rect getUnclippedInnerRect (void) const
 Return a Rect object that describes, unclipped, the inner rectangle for this window. The inner rectangle is typically an area that excludes some frame or other rendering that should not be touched by subsequent rendering.
virtual Rect getUnclippedInnerRect_impl (void) const
 Return a Rect object that describes, unclipped, the inner rectangle for this window. The inner rectangle is typically an area that excludes some frame or other rendering that should not be touched by subsequent rendering.
bool isCapturedByThis (void) const
 return true if this Window has input captured.
bool isCapturedByAncestor (void) const
 return true if an ancestor window has captured inputs.
bool isCapturedByChild (void) const
 return true if a child window has captured inputs.
virtual bool isHit (const Vector2 &position) const
 check if the given pixel position would hit this window.
WindowgetChildAtPosition (const Vector2 &position) const
 return the child Window that is hit by the given pixel position
WindowgetTargetChildAtPosition (const Vector2 &position) const
 return the child Window that is 'hit' by the given position, and is allowed to handle mouse events.
WindowgetParent (void) const
 return the parent of this Window.
const ImagegetMouseCursor (bool useDefault=true) const
 Return a pointer to the mouse cursor image to use when the mouse cursor is within this window's area.
Size getPixelSize (void) const
 Return the window size in pixels.
void * getUserData (void) const
 Return the user data set for this Window.
bool restoresOldCapture (void) const
 Return whether this window is set to restore old input capture when it loses input capture.
bool isZOrderingEnabled (void) const
 Return whether z-order changes are enabled or disabled for this Window.
bool wantsMultiClickEvents (void) const
 Return whether this window will receive multi-click events or multiple 'down' events instead.
bool isMouseAutoRepeatEnabled (void) const
 Return whether mouse button down event autorepeat is enabled for this window.
float getAutoRepeatDelay (void) const
 Return the current auto-repeat delay setting for this window.
float getAutoRepeatRate (void) const
 Return the current auto-repeat rate setting for this window.
bool distributesCapturedInputs (void) const
 Return whether the window wants inputs passed to its attached child windows when the window has inputs captured.
bool isUsingDefaultTooltip (void) const
 Return whether this Window is using the system default Tooltip for its Tooltip window.
TooltipgetTooltip (void) const
 Return a pointer to the Tooltip object used by this Window. The value returned may point to the system default Tooltip, a custom Window specific Tooltip, or be NULL.
String getTooltipType (void) const
 Return the custom tooltip type.
const StringgetTooltipText (void) const
 Return the current tooltip text set for this Window.
bool inheritsTooltipText (void) const
 Return whether this window inherits Tooltip text from its parent when its own tooltip text is not set.
bool isRiseOnClickEnabled (void) const
 Return whether this window will rise to the top of the z-order when clicked with the left mouse button.
bool testClassName (const String &class_name) const
 Return whether this window was inherited from the given class name at some point in the inheritance hierarchy.
VerticalAlignment getVerticalAlignment () const
 Get the vertical alignment.
HorizontalAlignment getHorizontalAlignment () const
 Get the horizontal alignment.
RenderCachegetRenderCache ()
 Return the RenderCache object for this Window.
const StringgetLookNFeel () const
 Get the name of the LookNFeel assigned to this window.
bool getModalState (void) const
 Get whether or not this Window is the modal target.
const StringgetUserString (const String &name) const
 Returns a named user string.
bool isUserStringDefined (const String &name) const
 Return whether a user string with the specified name exists.
WindowgetActiveSibling ()
 Returns the active sibling window.
Size getParentPixelSize (void) const
 Return the pixel size of the parent element. This always returns a valid object.
float getParentPixelWidth (void) const
 Return the pixel Width of the parent element. This always returns a valid number.
float getParentPixelHeight (void) const
 Return the pixel Height of the parent element. This always returns a valid number.
bool isMousePassThroughEnabled (void) const
 Returns whether this window should ignore mouse event and pass them through to and other windows behind it. In effect making the window transparent to the mouse.
bool isAutoWindow (void) const
 Returns whether this window is an auto-child window. All auto-child windows have "__auto_" in their name, but this is faster.
bool isWritingXMLAllowed (void) const
 Returns whether this window is allowed to write XML.
EventSet::Iterator getEventIterator () const
 Helper method that returns an EventSet::Iterator object that can be used to iterate over the events currently added to the EventSet of this Window.
PropertySet::Iterator getPropertyIterator () const
 Helper method that returns a PropertySet::Iterator object that can be used to iterate over the events currently added to the PropertySet of this Window.
bool isDragDropTarget () const
 Returns whether this Window object will receive events generated by the drag and drop support in the system.
void rename (const String &new_name)
 Renames the window.
virtual void initialiseComponents (void)
 Initialises the Window based object ready for use.
void setDestroyedByParent (bool setting)
 Set whether or not this Window will automatically be destroyed when its parent Window is destroyed.
void setAlwaysOnTop (bool setting)
 Set whether this window is always on top, or not.
void setEnabled (bool setting)
 Set whether this window is enabled or disabled. A disabled window normally can not be interacted with, and may have different rendering.
void enable (void)
 enable the Window to allow interaction.
void disable (void)
 disable the Window to prevent interaction.
void setVisible (bool setting)
 Set whether the Window is visible or hidden.
void show (void)
 show the Window.
void hide (void)
 hide the Window.
void activate (void)
 Activate the Window giving it input focus and bringing it to the top of all windows with the same always-on-top settig as this Window.
void deactivate (void)
 Deactivate the window. No further inputs will be received by the window until it is re-activated either programmatically or by the user interacting with the gui.
void setClippedByParent (bool setting)
 Set whether this Window will be clipped by its parent window(s).
void setID (uint ID)
 Set the current ID for the Window.
void setPrefix (String prefix)
void setText (const String &text)
 Set the current text string for the Window.
void insertText (const String &text, const String::size_type position)
 Insert the text string text into the current text string for the Window object at the position specified by position.
void appendText (const String &text)
 Append the string text to the currect text string for the Window object.
void setFont (Font *font)
 Set the font used by this Window.
void setFont (const String &name)
 Set the font used by this Window.
void addChildWindow (const String &name)
 Add the named Window as a child of this Window. If the Window name is already attached to a Window, it is detached before being added to this Window.
void addChildWindow (Window *window)
 Add the specified Window as a child of this Window. If the Window window is already attached to a Window, it is detached before being added to this Window.
void removeChildWindow (const String &name)
 Remove the named Window from this windows child list.
void removeChildWindow (Window *window)
 Remove the specified Window form this windows child list.
void removeChildWindow (uint ID)
 Remove the first child Window with the specified ID. If there is more than one attached Window objects with the specified ID, only the fist one encountered will be removed.
void moveToFront ()
 Move the Window to the top of the z order.
void moveToBack ()
 Move the Window to the bottom of the Z order.
bool captureInput (void)
 Captures input to this window.
void releaseInput (void)
 Releases input capture from this Window. If this Window does not have inputs captured, nothing happens.
void setRestoreCapture (bool setting)
 Set whether this window will remember and restore the previous window that had inputs captured.
void setAlpha (float alpha)
 Set the current alpha value for this window.
void setInheritsAlpha (bool setting)
 Sets whether this Window will inherit alpha from its parent windows.
void requestRedraw (void) const
 Signal the System object to redraw (at least) this Window on the next render cycle.
void setMouseCursor (const Image *image)
 Set the mouse cursor image to be used when the mouse enters this window.
void setMouseCursor (MouseCursorImage image)
 Set the mouse cursor image to be used when the mouse enters this window.
void setMouseCursor (const String &imageset, const String &image_name)
 Set the mouse cursor image to be used when the mouse enters this window.
void setUserData (void *user_data)
 Set the user data set for this Window.
void setZOrderingEnabled (bool setting)
 Set whether z-order changes are enabled or disabled for this Window.
void setWantsMultiClickEvents (bool setting)
 Set whether this window will receive multi-click events or multiple 'down' events instead.
void setMouseAutoRepeatEnabled (bool setting)
 Set whether mouse button down event autorepeat is enabled for this window.
void setAutoRepeatDelay (float delay)
 Set the current auto-repeat delay setting for this window.
void setAutoRepeatRate (float rate)
 Set the current auto-repeat rate setting for this window.
void setDistributesCapturedInputs (bool setting)
 Set whether the window wants inputs passed to its attached child windows when the window has inputs captured.
void notifyDragDropItemEnters (DragContainer *item)
 Internal support method for drag & drop. You do not normally call this directly from client code. See the DragContainer class.
void notifyDragDropItemLeaves (DragContainer *item)
 Internal support method for drag & drop. You do not normally call this directly from client code. See the DragContainer class.
void notifyDragDropItemDropped (DragContainer *item)
 Internal support method for drag & drop. You do not normally call this directly from client code. See the DragContainer class.
virtual void destroy (void)
 Internal destroy method which actually just adds the window and any parent destructed child windows to the dead pool.
void setTooltip (Tooltip *tooltip)
 Set the custom Tooltip object for this Window. This value may be 0 to indicate that the Window should use the system default Tooltip object.
void setTooltipType (const String &tooltipType)
 Set the custom Tooltip to be used by this Window by specifying a Window type.
void setTooltipText (const String &tip)
 Set the tooltip text for this window.
void setInheritsTooltipText (bool setting)
 Set whether this window inherits Tooltip text from its parent when its own tooltip text is not set.
void setRiseOnClickEnabled (bool setting)
 Set whether this window will rise to the top of the z-order when clicked with the left mouse button.
void setVerticalAlignment (const VerticalAlignment alignment)
 Set the vertical alignment.
void setHorizontalAlignment (const HorizontalAlignment alignment)
 Set the horizontal alignment.
virtual void setLookNFeel (const String &look)
 Set the LookNFeel that shoule be used for this window.
void setModalState (bool state)
 Set the modal state for this Window.
virtual void performChildWindowLayout ()
 method called to perform extended laying out of attached child windows.
void setUserString (const String &name, const String &value)
 Sets the value a named user string, creating it as required.
void setArea (const UDim &xpos, const UDim &ypos, const UDim &width, const UDim &height)
 Set the window area.
void setArea (const UVector2 &pos, const UVector2 &size)
 Set the window area.
void setArea (const URect &area)
 Set the window area.
void setPosition (const UVector2 &pos)
 Set the window's position.
void setXPosition (const UDim &x)
 Set the window's X position.
void setYPosition (const UDim &y)
 Set the window's Y position.
void setSize (const UVector2 &size)
 Set the window's size.
void setWidth (const UDim &width)
 Set the window's width.
void setHeight (const UDim &height)
 Set the window's height.
void setMaxSize (const UVector2 &size)
 Set the window's maximum size.
void setMinSize (const UVector2 &size)
 Set the window's minimum size.
const URectgetArea () const
 Return the windows area.
const UVector2getPosition () const
 Get the window's position.
const UDimgetXPosition () const
 Get the window's X position.
const UDimgetYPosition () const
 Get the window's Y position.
UVector2 getSize () const
 Get the window's size.
UDim getWidth () const
 Get the window's width.
UDim getHeight () const
 Get the window's height.
const UVector2getMaxSize () const
 Get the window's maximum size.
const UVector2getMinSize () const
 Get the window's minimum size.
void render (void)
 Causes the Window object to render itself and all of it's attached children.
void update (float elapsed)
 Cause window to update itself and any attached children. Client code does not need to call this method; to ensure full, and proper updates, call the injectTimePulse methodname method provided by the System class.
virtual void writeXMLToStream (XMLSerializer &xml_stream) const
 Writes an xml representation of this window object to out_stream.
virtual void beginInitialisation (void)
 Sets the internal 'initialising' flag to true. This can be use to optimize initialisation of some widgets, and is called automatically by the layout XML handler when it has created a window. That is just after the window has been created, but before any children or properties are read.
virtual void endInitialisation (void)
 Sets the internal 'initialising' flag to false. This is called automatically by the layout XML handler when it is done creating a window. That is after all properties and children have been loaded and just before the next sibling gets created.
void setMousePassThroughEnabled (bool setting)
 Sets whether this window should ignore mouse events and pass them through to any windows behind it. In effect making the window transparent to the mouse.
void setWindowRenderer (const String &name)
 Assign the WindowRenderer to specify the Look'N'Feel specification to be used.
WindowRenderergetWindowRenderer (void) const
 Get the currently assigned WindowRenderer. (Look'N'Feel specification).
String getWindowRendererName (void) const
 Get the factory name of the currently assigned WindowRenderer. (Look'N'Feel specification).
void setWritingXMLAllowed (bool allow)
 Sets whether this window is allowed to write XML.
void notifyScreenAreaChanged (void)
 Recursively inform all children that the screen area has changed, and needs to be re-cached.
void setFalagardType (const String &type, const String &rendererType="")
 Changes the widget's falagard type, thus changing its look'n'feel and optionally its renderer in the process.
void setDragDropTarget (bool setting)
 Specifies whether this Window object will receive events generated by the drag and drop support in the system.

Static Public Member Functions

static WindowgetCaptureWindow (void)
 return the Window that currently has inputs captured.

Static Public Attributes

static const String EventNamespace
 < Namespace for global events
static const String EventWindowUpdated
static const String EventParentSized
 Parent of this Window has been re-sized.
static const String EventSized
 Window size has changed.
static const String EventMoved
 Window position has changed.
static const String EventTextChanged
 Text string for the Window has changed.
static const String EventFontChanged
 Font object for the Window has been changed.
static const String EventAlphaChanged
 Alpha blend value for the Window has changed.
static const String EventIDChanged
 Client assigned ID code for the Window has changed.
static const String EventActivated
 Window has been activated (has input focus).
static const String EventDeactivated
 Window has been deactivated (loses input focus).
static const String EventShown
 Window has been made visible.
static const String EventHidden
 Window has been hidden from view.
static const String EventEnabled
 Window has been enabled (interaction is possible).
static const String EventDisabled
 Window has been disabled (interaction is no longer possible).
static const String EventClippedByParentChanged
 Clipping by parent mode has been modified.
static const String EventDestroyedByParentChanged
 Destruction by parent mode has been modified.
static const String EventInheritsAlphaChanged
 Alpha inherited from parent mode has been modified.
static const String EventAlwaysOnTopChanged
 Always on top mode has been modified.
static const String EventInputCaptureGained
 Window has captured all inputs.
static const String EventInputCaptureLost
 Window has lost it's capture on inputs.
static const String EventRenderingStarted
 Rendering of the Window has started.
static const String EventRenderingEnded
 Rendering for the Window has finished.
static const String EventChildAdded
 A child Window has been added.
static const String EventChildRemoved
 A child window has been removed.
static const String EventDestructionStarted
 Destruction of the Window is about to begin.
static const String EventZOrderChanged
 The z-order of the window has changed.
static const String EventDragDropItemEnters
 A DragContainer has been dragged over this window.
static const String EventDragDropItemLeaves
 A DragContainer has left this window.
static const String EventDragDropItemDropped
 A DragContainer was dropped on this Window.
static const String EventVerticalAlignmentChanged
 The vertical alignment of the window has changed.
static const String EventHorizontalAlignmentChanged
 The vertical alignment of the window has changed.
static const String EventWindowRendererAttached
 The a new window renderer was attached.
static const String EventWindowRendererDetached
 The currently assigned window renderer was detached.
static const String EventMouseEnters