Spore ModAPI  2.4.0
API for creating C++ mods for Spore
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
UTFWin::IWindow Class Referenceabstract

An interface that represents a component in the user interface. More...

#include <IWindow.h>

Inheritance diagram for UTFWin::IWindow:
UTFWin::UTFWinObject Object UTFWin::Window UTFWin::InteractiveWindow UTFWin::SporeAnimatedIconWin UTFWin::WinButton UTFWin::WinGrid UTFWin::WinTreeView

Public Member Functions

virtual IWindowGetParent () const =0
 Returns the parent IWindow of this window, or nullptr if it has no parent window. More...
 
virtual IWindowManagerGetWindowManager () const =0
 Returns the WindowManager that is operating on this window. More...
 
virtual int func6 () const =0
 
virtual uint32_t GetControlID () const =0
 Sets the unique ID of this object. More...
 
virtual uint32_t GetCommandID () const =0
 Get the message ID sent by this window. More...
 
virtual int func9 () const =0
 
virtual WindowFlags GetFlags () const =0
 Gets the current window flags. More...
 
virtual int GetState () const =0
 Gets the current state (selected, pressed, mouse hover, etc) of this window. More...
 
virtual Math::Color GetShadeColor () const =0
 Returns the color modulation value. More...
 
virtual const Math::RectangleGetArea () const =0
 Gets the rectangular extent of this window, relative to the window's parent. More...
 
virtual const Math::RectangleGetRealArea () const =0
 Gets the real rectangular extent of this window, in window coordinates. More...
 
virtual const char16_t * GetCaption () const =0
 Returns the text contents or title of the window. More...
 
virtual uint32_t GetTextFontID () const =0
 Returns the text font style ID used in this window. More...
 
virtual const wchar_t * func17 () const =0
 
virtual int func18 () const =0
 
virtual int func19 () const =0
 
virtual void SetControlID (uint32_t controlID)=0
 Sets the unique ID of this object. More...
 
virtual void SetCommandID (uint32_t commandID)=0
 Set the message ID sent by this window. More...
 
virtual void SetState (int state)=0
 Sets the current state (selected, pressed, mouse hover, etc) of this window. More...
 
virtual void SetShadeColor (Color color)=0
 Returns the color modulation value. More...
 
virtual void SetArea (const Math::Rectangle &area)=0
 Sets the rectangular extent of this window. More...
 
virtual void SetLocation (float fX, float fY)=0
 Sets the location of this window, relative to its parent. More...
 
virtual void SetSize (float fWidth, float fHeight)=0
 Assigns the width and height of this window. More...
 
virtual void SetLayoutArea (const Math::Rectangle &layoutArea)=0
 Sets the area that this component should have, relative to its parent window, after all layout styles are applied. More...
 
virtual void SetLayoutLocation (float fX, float fY)=0
 Assigns the location, relative to the parent window, that this window should have after all layouts are applied. More...
 
virtual void SetLayoutSize (float fWidth, float fHeight)=0
 Assigns the width and height that this window should have after all layouts are applied. More...
 
virtual void func30 (int)=0
 
virtual void SetFlag (WindowFlags nFlag, bool bValue)=0
 Assigns the given value to the specified window flag. More...
 
virtual void SetCaption (const char16_t *pCaption)=0
 Assigns the text contents or title of the window. More...
 
virtual void SetTextFontID (uint32_t styleID)=0
 Sets the text font style ID used in this window. More...
 
virtual void func34 (int)=0
 
virtual void func35 (int)=0
 
virtual int Invalidate ()=0
 
virtual void Revalidate ()=0
 Updates the real area of this window and all its children, using the 'area' property and applying all the ILayoutStyle objects (added as IWinProc) in this window. More...
 
virtual int InvalidateTransform ()=0
 
virtual int func39 ()=0
 
virtual int func40 ()=0
 
virtual Color GetFillColor () const =0
 Returns the fill color of this window. More...
 
virtual IDrawableGetDrawable () const =0
 Returns the fill drawable of this window. More...
 
virtual void SetFillColor (Color color)=0
 Sets the fill color of this window. More...
 
virtual void SetDrawable (IDrawable *drawable)=0
 Sets the fill drawable of this window. More...
 
virtual int func45 (int)=0
 
virtual int func46 (int, int)=0
 
virtual int func47 (float, float)=0
 
virtual Point func48 (float, float)=0
 
virtual Point func49 (float, float)=0
 
virtual bool func50 (float, float, Point &dst)=0
 
virtual IWindowList_t::iterator GetChildrenBegin ()=0
 Returns the begin iterator of the list of children windows contained in this window. More...
 
virtual IWindowList_t::iterator GetChildrenEnd ()=0
 Returns the end iterator of the list of children windows contained in this window. More...
 
virtual IWindowList_t::iterator LocateChild (const IWindow *pChild) const =0
 Converts a pointer to a child window in the list back to an iterator, or returns end() if it is not part of the children list. More...
 
virtual void AddWindow (IWindow *pWindow)=0
 Adds the given window to this IWindow's children. More...
 
virtual void RemoveWindow (IWindow *pWindow)=0
 Removes the given window from this IWindow's children. More...
 
virtual void DisposeWindowFamily (IWindow *pChildWindow)=0
 Disposes the given window and all its hierarchy. More...
 
virtual void DisposeAllWindowFamilies ()=0
 Disposes all the children windows and all their hierarchy. More...
 
virtual void BringToFront (IWindow *pWindow)=0
 Moves the specified child window at the front of the rest of its siblings, so it is the last one to be rendered. More...
 
virtual void SendToBack (IWindow *pWindow)=0
 Moves the specified child window at the back of the rest of its siblings, so it is the first one to be rendered. More...
 
virtual IWindowFindWindowByID (uint32_t controlID, bool bRecursive=true)=0
 Returns the first child window that has the given controlID. More...
 
virtual IWindowFindWindowTypeByID (uint32_t controlID, uint32_t type, bool bRecursive=true)=0
 Returns the first child window that has the given controlID and is of the given type. More...
 
virtual bool IsAncestorOf (const IWindow *pChildWindow)=0
 Checks if the given window is contained in the component hierarchy of this IWindow. More...
 
virtual bool func63 (int index)=0
 
virtual bool func64 (int index)=0
 
virtual void AddWinProc (IWinProc *pWinProc)=0
 Adds the given IWinProc at the end of this window's list. More...
 
virtual void RemoveWinProc (IWinProc *pWinProc)=0
 Removes the given IWinProc from this window's list. More...
 
virtual IWinProcGetNextWinProc (const IWinProc *pWinProc=nullptr) const =0
 Gets the IWinProc in this window that follows the given procedure. More...
 
virtual int func68 (int)=0
 
virtual bool SendMsg (Message &msg)=0
 Sends the given message through this window, using this window as the source. More...
 
virtual const char * GetComponentName () const =0
 Returns the name of this component type (e.g. More...
 
WindowChildren children ()
 Returns an structure that allows to iterate through the children of this window. More...
 
WindowProcedures procedures ()
 Returns an structure that allows to iterate through the IWinProc objects of this window. More...
 
intrusive_ptr< IWinProcAddWinProc (HandleUILambda_t pFunction, int eventFlags=kEventFlagBasicInput|kEventFlagAdvanced, int priority=0)
 Adds an event listener, defined using a lambda function or by referencing a static function. More...
 
intrusive_ptr< IWinProcAddWinProcFilter (HandleUILambda_t function, const vector< MessageType > types, int priority=0)
 Adds an even listener that only handles the specified message types. More...
 
bool IsVisible () const
 Tells whether the window is visible. More...
 
void SetVisible (bool bVisible)
 Switches the visibility of this window. More...
 
bool IsEnabled () const
 Tells whether the window is visible. More...
 
void SetEnabled (bool bEnabled)
 Switches the visibility of this window. More...
 
- Public Member Functions inherited from Object
virtual int AddRef ()=0
 
virtual int Release ()=0
 
virtual void * Cast (uint32_t typeID) const =0
 

Static Public Member Functions

static void FitParentArea (IWindow *pWindow)
 Sets the given UTFWin::IWindow to fit the entire area of its parent. More...
 
static IWindowCreatePanel (IWindow *pParent)
 Creates a new window with standard properties, and adds it to fit the given window (if any is given). More...
 
static void SetOpacity (IWindow *pWindow, float fOpacity)
 Changes the opacity (opposite of transparency) of a window, which is done modifying the 'alpha' value of the shade color. More...
 
- Static Public Member Functions inherited from UTFWin::UTFWinObject
static void operator delete (void *p)
 
static void * operator new (size_t n, size_t align, const char *pName, ICoreAllocator *pAllocator=UTFWin::GetAllocator())
 
static void * operator new (size_t n)
 

Static Public Attributes

static const uint32_t TYPE = 0xEEEE8218
 
- Static Public Attributes inherited from Object
static const uint32_t TYPE = 0xEE3F516E
 

Additional Inherited Members

- Protected Member Functions inherited from Object
virtual ~Object ()
 

Detailed Description

An interface that represents a component in the user interface.

Windows occupy a rectangle in the screen and are fit inside a hierarchy: a window can have multiple children and only one parent. For more information, check the User Interface page.

Member Function Documentation

◆ AddWindow()

virtual void UTFWin::IWindow::AddWindow ( IWindow pWindow)
pure virtual

Adds the given window to this IWindow's children.

The window will be added last, so it will have the lowest Z-index. The parent of pWindow will be set to this object.

Parameters
pWindowThe window to add to this object's children.

Implemented in UTFWin::Window.

◆ AddWinProc() [1/2]

virtual void UTFWin::IWindow::AddWinProc ( IWinProc pWinProc)
pure virtual

Adds the given IWinProc at the end of this window's list.

IWinProcs are called when a message is received in the window. Also some of them might be called on layout-related methods. Some IWinProcs can also act as effects.

Parameters
pWinProcThe IWinProc to add.

Implemented in UTFWin::Window.

◆ AddWinProc() [2/2]

intrusive_ptr<IWinProc> UTFWin::IWindow::AddWinProc ( HandleUILambda_t  pFunction,
int  eventFlags = kEventFlagBasicInput|kEventFlagAdvanced,
int  priority = 0 
)

Adds an event listener, defined using a lambda function or by referencing a static function.

This listener will be called for the messages that are accepted by the event flags given; by default, this listens to basic input events and advanced events, defined by the kEventFlagBasicInput | kEventFlagAdvanced flags. The priority can also be specified, with 0 being default priority.

The method returns an IWinProc that can be used to remove this listener, by using IWindow::RemoveWinProc();

Parameters
functionThe lambda function that is called when a message is received.
eventFlags[Optional] A combination of kEventFlag... that defines which messages are received.
priority[Optional] The priority of this event listener.
Returns
The generated IWinProc object, that can be used to remove this listener.

◆ AddWinProcFilter()

intrusive_ptr<IWinProc> UTFWin::IWindow::AddWinProcFilter ( HandleUILambda_t  function,
const vector< MessageType types,
int  priority = 0 
)

Adds an even listener that only handles the specified message types.

The listener is defined using a lambda function or by referencing a static function. This listener will be called for the specified message types. The priority can also be specified, with 0 being default priority.

The method returns an IWinProc that can be used to remove this listener, by using IWindow::RemoveWinProc();

Parameters
functionThe lambda function that is called when a message is received.
typesA vector of message types that this procedure receives.
priority[Optional] The priority of this event listener.
Returns
The generated IWinProc object, that can be used to remove this listener.

◆ BringToFront()

virtual void UTFWin::IWindow::BringToFront ( IWindow pWindow)
pure virtual

Moves the specified child window at the front of the rest of its siblings, so it is the last one to be rendered.

This is the equivalent to setting the Z-index to the highest. Note that the window will remain behind of windows with the flag kWinFlagAlwaysInFront set to true.

Parameters
pWindowThe child window to bring to the front.

Implemented in UTFWin::Window.

◆ children()

WindowChildren UTFWin::IWindow::children ( )

Returns an structure that allows to iterate through the children of this window.

Example usage:

IWindow* pWindow = ...;
for (IWindow* pChild : children())
{
...
}

◆ CreatePanel()

static IWindow* UTFWin::IWindow::CreatePanel ( IWindow pParent)
static

Creates a new window with standard properties, and adds it to fit the given window (if any is given).

The properties are the following:

  • ControlID = 0
  • CommandID = 0
  • ShadeColor = 0xFFFFFFFF
  • FillColor = 0x00FFFFFF
  • Area = (0, 0, 100, 100), except if a parent is given; then it fits the parent.
  • kWinFlagVisible = true
  • kWinFlagEnabled = true
  • kWinFlagIgnoreMouse = false
    Parameters
    pParentThe parent window where the new window will be added. It can be nullptr.

◆ DisposeAllWindowFamilies()

virtual void UTFWin::IWindow::DisposeAllWindowFamilies ( )
pure virtual

Disposes all the children windows and all their hierarchy.

After this method is called, this window will not have any children.

Implemented in UTFWin::Window.

◆ DisposeWindowFamily()

virtual void UTFWin::IWindow::DisposeWindowFamily ( IWindow pChildWindow)
pure virtual

Disposes the given window and all its hierarchy.

If pChildWindow is a child of this window, it will be removed from it. The pChildWindow hierarchy will be disposed even if it is not a child of this window.

Parameters
pChildWindowThe IWindow to dispose.

Implemented in UTFWin::Window.

◆ FindWindowByID()

virtual IWindow* UTFWin::IWindow::FindWindowByID ( uint32_t  controlID,
bool  bRecursive = true 
)
pure virtual

Returns the first child window that has the given controlID.

By default, this also checks on the children' children, so the controlID is searched in all the window hierarchy.

Parameters
controlIDThe controlID of the window to find.
bRecursiveWhether the children hierarchy should be checked as well, true by default.
Returns
The first window in the hierarchy that has the given controlID, or nullptr if there is no match.

Implemented in UTFWin::Window.

◆ FindWindowTypeByID()

virtual IWindow* UTFWin::IWindow::FindWindowTypeByID ( uint32_t  controlID,
uint32_t  type,
bool  bRecursive = true 
)
pure virtual

Returns the first child window that has the given controlID and is of the given type.

The type is something like WinButton::TYPE, so it is safe to assume that the returned type will be a WinButton in this case. If a window with the given controlID is found but calling Cast(type) on it returns nullptr, nullptr will be returned (so it will stop searching). By default, this also checks on the children' children, so the controlID is searched in all the window hierarchy.

Parameters
controlIDThe controlID of the window to find.
typeThe type of the window to find. It will be used calling Cast(type) on the match.
bRecursiveWhether the children hierarchy should be checked as well, true by default.
Returns
The first window in the hierarchy that has the given controlID and type, or nullptr if there is no match.

Implemented in UTFWin::Window.

◆ FitParentArea()

static void UTFWin::IWindow::FitParentArea ( IWindow pWindow)
static

Sets the given UTFWin::IWindow to fit the entire area of its parent.

Parameters
pWindow

◆ func17()

virtual const wchar_t* UTFWin::IWindow::func17 ( ) const
pure virtual

Implemented in UTFWin::Window.

◆ func18()

virtual int UTFWin::IWindow::func18 ( ) const
pure virtual

Implemented in UTFWin::Window.

◆ func19()

virtual int UTFWin::IWindow::func19 ( ) const
pure virtual

Implemented in UTFWin::Window.

◆ func30()

virtual void UTFWin::IWindow::func30 ( int  )
pure virtual

Implemented in UTFWin::Window.

◆ func34()

virtual void UTFWin::IWindow::func34 ( int  )
pure virtual

Implemented in UTFWin::Window.

◆ func35()

virtual void UTFWin::IWindow::func35 ( int  )
pure virtual

Implemented in UTFWin::Window.

◆ func39()

virtual int UTFWin::IWindow::func39 ( )
pure virtual

Implemented in UTFWin::Window.

◆ func40()

virtual int UTFWin::IWindow::func40 ( )
pure virtual

Implemented in UTFWin::Window.

◆ func45()

virtual int UTFWin::IWindow::func45 ( int  )
pure virtual

Implemented in UTFWin::Window.

◆ func46()

virtual int UTFWin::IWindow::func46 ( int  ,
int   
)
pure virtual

Implemented in UTFWin::Window.

◆ func47()

virtual int UTFWin::IWindow::func47 ( float  ,
float   
)
pure virtual

Implemented in UTFWin::Window.

◆ func48()

virtual Point UTFWin::IWindow::func48 ( float  ,
float   
)
pure virtual

Implemented in UTFWin::Window.

◆ func49()

virtual Point UTFWin::IWindow::func49 ( float  ,
float   
)
pure virtual

Implemented in UTFWin::Window.

◆ func50()

virtual bool UTFWin::IWindow::func50 ( float  ,
float  ,
Point dst 
)
pure virtual

Implemented in UTFWin::Window.

◆ func6()

virtual int UTFWin::IWindow::func6 ( ) const
pure virtual

Implemented in UTFWin::Window.

◆ func63()

virtual bool UTFWin::IWindow::func63 ( int  index)
pure virtual

Implemented in UTFWin::Window.

◆ func64()

virtual bool UTFWin::IWindow::func64 ( int  index)
pure virtual

Implemented in UTFWin::Window.

◆ func68()

virtual int UTFWin::IWindow::func68 ( int  )
pure virtual

Implemented in UTFWin::Window.

◆ func9()

virtual int UTFWin::IWindow::func9 ( ) const
pure virtual

Implemented in UTFWin::Window.

◆ GetArea()

virtual const Math::Rectangle& UTFWin::IWindow::GetArea ( ) const
pure virtual

Gets the rectangular extent of this window, relative to the window's parent.

Note this is the 'area' property, but the real area of the window might be different depending on its parent and the IWinProcs operating in this window.

Returns
The area of this window, in screen coordinates.

Implemented in UTFWin::Window.

◆ GetCaption()

virtual const char16_t* UTFWin::IWindow::GetCaption ( ) const
pure virtual

Returns the text contents or title of the window.

This value might be used or not depending on the implementation and type of window.

Returns
The char16_t* caption used in this window.

Implemented in UTFWin::Window.

◆ GetChildrenBegin()

virtual IWindowList_t::iterator UTFWin::IWindow::GetChildrenBegin ( )
pure virtual

Returns the begin iterator of the list of children windows contained in this window.

Pair it with GetChildrenEnd() to iterate through the children. Children windows are listed according to their Z-index; that is, the first children is the one on front, and the last children is the one on the bottom.

Implemented in UTFWin::Window.

◆ GetChildrenEnd()

virtual IWindowList_t::iterator UTFWin::IWindow::GetChildrenEnd ( )
pure virtual

Returns the end iterator of the list of children windows contained in this window.

Pair it with GetChildrenBegin() to iterate through the children. Children windows are listed according to their Z-index; that is, the first children is the one on front, and the last children is the one on the bottom.

Implemented in UTFWin::Window.

◆ GetCommandID()

virtual uint32_t UTFWin::IWindow::GetCommandID ( ) const
pure virtual

Get the message ID sent by this window.

Returns
The value of the 'commandID' property.

Implemented in UTFWin::Window.

◆ GetComponentName()

virtual const char* UTFWin::IWindow::GetComponentName ( ) const
pure virtual

Returns the name of this component type (e.g.

"Window", "WinButton").

Implemented in UTFWin::Window.

◆ GetControlID()

virtual uint32_t UTFWin::IWindow::GetControlID ( ) const
pure virtual

Sets the unique ID of this object.

This ID is used to identfy windows, as it is the one used by FindWindowByID(). This ID can also be used on message handling, to check what window raised the message.

Returns
The value of the 'controlID' property.

Implemented in UTFWin::Window.

◆ GetDrawable()

virtual IDrawable* UTFWin::IWindow::GetDrawable ( ) const
pure virtual

Returns the fill drawable of this window.

When rendering the window, the area will be filled with the fill color and then the fill drawable will be drawn on top of it.

Returns
The drawable used in this window.

Implemented in UTFWin::Window.

◆ GetFillColor()

virtual Color UTFWin::IWindow::GetFillColor ( ) const
pure virtual

Returns the fill color of this window.

The fill color acts as a background color: when rendering the window, the area will be filled with the fill color and then the fill drawable will be drawn on top of it.

Returns
The integer color representation of the value of the 'fillColor' property.

Implemented in UTFWin::Window.

◆ GetFlags()

virtual WindowFlags UTFWin::IWindow::GetFlags ( ) const
pure virtual

Gets the current window flags.

This can be used, for example, to check if a window is visible:

IWindow* pWindow = ....;
if (pWindow->GetFlags() & kWinFlagVisible) ...
Returns
The value of the 'flags' property.

Implemented in UTFWin::Window.

◆ GetNextWinProc()

virtual IWinProc* UTFWin::IWindow::GetNextWinProc ( const IWinProc pWinProc = nullptr) const
pure virtual

Gets the IWinProc in this window that follows the given procedure.

If pWinProc is not included in this window, nullptr will be returned. If pWinProc is nullptr, the first IWinProc in this window will be returned.

Parameters
pWinProcThe IWinProc that comes after this one will be returned. nullptr to return the first one.
Returns
The next IWinProc, or nullptr if there's none.

Implemented in UTFWin::Window.

◆ GetParent()

virtual IWindow* UTFWin::IWindow::GetParent ( ) const
pure virtual

Returns the parent IWindow of this window, or nullptr if it has no parent window.

Returns
A pointer to the IWindow parent of this window, or nullptr if there is none.

Implemented in UTFWin::Window.

◆ GetRealArea()

virtual const Math::Rectangle& UTFWin::IWindow::GetRealArea ( ) const
pure virtual

Gets the real rectangular extent of this window, in window coordinates.

This has all the IWinProcs and parent position applied, so this is the real area of the window that gets painted onto the screen.

Returns
The real Math::Rectangle area of this window, in screen coordinates.

Implemented in UTFWin::Window.

◆ GetShadeColor()

virtual Math::Color UTFWin::IWindow::GetShadeColor ( ) const
pure virtual

Returns the color modulation value.

This color acts as a tint: after the window is painted, it gets multiplied by this color.

Returns
The integer color representation of the value of the 'shadeColor' property.

Implemented in UTFWin::Window.

◆ GetState()

virtual int UTFWin::IWindow::GetState ( ) const
pure virtual

Gets the current state (selected, pressed, mouse hover, etc) of this window.

Only certain types use this, like buttons.

Returns
The value of the 'state' property.

Implemented in UTFWin::Window.

◆ GetTextFontID()

virtual uint32_t UTFWin::IWindow::GetTextFontID ( ) const
pure virtual

Returns the text font style ID used in this window.

This value might be used or not depending on the implementation and type of window.

Returns
The text font ID used in this window.

Implemented in UTFWin::Window.

◆ GetWindowManager()

virtual IWindowManager* UTFWin::IWindow::GetWindowManager ( ) const
pure virtual

Returns the WindowManager that is operating on this window.

Returns
A pointer to the WindowManager being used in this window.

Implemented in UTFWin::Window.

◆ Invalidate()

virtual int UTFWin::IWindow::Invalidate ( )
pure virtual

Implemented in UTFWin::Window.

◆ InvalidateTransform()

virtual int UTFWin::IWindow::InvalidateTransform ( )
pure virtual

Implemented in UTFWin::Window.

◆ IsAncestorOf()

virtual bool UTFWin::IWindow::IsAncestorOf ( const IWindow pChildWindow)
pure virtual

Checks if the given window is contained in the component hierarchy of this IWindow.

All the hierarchy will be checked, so the function can return true even if this window is not a direct parent of pChildWindow.

Parameters
pChildWindowThe child window to check.
Returns
True if pChildWindow is contained in the hierarchy of this window, false otherwise.

Implemented in UTFWin::Window.

◆ IsEnabled()

bool UTFWin::IWindow::IsEnabled ( ) const
inline

Tells whether the window is visible.

This is equivalent to GetFlags() & kWinFlagEnabled.

◆ IsVisible()

bool UTFWin::IWindow::IsVisible ( ) const
inline

Tells whether the window is visible.

This is equivalent to GetFlags() & kWinFlagVisible.

◆ LocateChild()

virtual IWindowList_t::iterator UTFWin::IWindow::LocateChild ( const IWindow pChild) const
pure virtual

Converts a pointer to a child window in the list back to an iterator, or returns end() if it is not part of the children list.

This can be used to check if a window is a direct child of this window, using "LocateChild(pChild) != GetChildrenEnd()

Parameters
pChildThe IWindow whose next sibling will be returned.
Returns
The iterator to the next sibling of pChild.

Implemented in UTFWin::Window.

◆ procedures()

WindowProcedures UTFWin::IWindow::procedures ( )

Returns an structure that allows to iterate through the IWinProc objects of this window.

Example usage:

IWindow* pWindow = ...;
for (IWinProc* pProcedure : pWindow->procedures())
{
...
}

◆ RemoveWindow()

virtual void UTFWin::IWindow::RemoveWindow ( IWindow pWindow)
pure virtual

Removes the given window from this IWindow's children.

pWindow will be removed from its parent hierarchy even if its parent is not this object. The parent of pWindow will be set to nullptr.

Parameters
pWindowThe window to remove from this object's children.

Implemented in UTFWin::Window.

◆ RemoveWinProc()

virtual void UTFWin::IWindow::RemoveWinProc ( IWinProc pWinProc)
pure virtual

Removes the given IWinProc from this window's list.

IWinProcs are called when a message is received in the window. Also some of them might be called on layout-related methods. Some IWinProcs can also act as effects.

Parameters
pWinProcThe IWinProc to remove from this window.

Implemented in UTFWin::Window.

◆ Revalidate()

virtual void UTFWin::IWindow::Revalidate ( )
pure virtual

Updates the real area of this window and all its children, using the 'area' property and applying all the ILayoutStyle objects (added as IWinProc) in this window.

Implemented in UTFWin::Window.

◆ SendMsg()

virtual bool UTFWin::IWindow::SendMsg ( Message msg)
pure virtual

Sends the given message through this window, using this window as the source.

Parameters
msgThe message.
Returns
True if the message was handled successfully.

Implemented in UTFWin::Window.

◆ SendToBack()

virtual void UTFWin::IWindow::SendToBack ( IWindow pWindow)
pure virtual

Moves the specified child window at the back of the rest of its siblings, so it is the first one to be rendered.

This is the equivalent to setting the Z-index to the lowest. Note that the window will remain behind of windows with the flag kWinFlagAlwaysInFront set to true.

Parameters
pWindowThe child window to send to the back.

Implemented in UTFWin::Window.

◆ SetArea()

virtual void UTFWin::IWindow::SetArea ( const Math::Rectangle area)
pure virtual

Sets the rectangular extent of this window.

Note that this will only affect the 'area' property of the window; the real area might use these values differently depending on the IWinProc objects operating on this window (e.g. SimpleLayout). Calling this method effectively calls the Revalidate() method, which ensures the real area of the window is updated using the new values.

Parameters
areaThe new value of the 'area' property.

Implemented in UTFWin::Window.

◆ SetCaption()

virtual void UTFWin::IWindow::SetCaption ( const char16_t *  pCaption)
pure virtual

Assigns the text contents or title of the window.

This value might be used or not depending on the implementation and type of window.

Parameters
pCaptionThe text to be used as caption.

Implemented in UTFWin::Window.

◆ SetCommandID()

virtual void UTFWin::IWindow::SetCommandID ( uint32_t  commandID)
pure virtual

Set the message ID sent by this window.

Parameters
commandIDThe new value of the 'commandID' property.

Implemented in UTFWin::Window.

◆ SetControlID()

virtual void UTFWin::IWindow::SetControlID ( uint32_t  controlID)
pure virtual

Sets the unique ID of this object.

This ID is used to identfy windows, as it is the one used by FindWindowByID(). This ID can also be used on message handling, to check what window raised the message.

Parameters
commandIDThe new value of the 'controlID' property.

Implemented in UTFWin::Window.

◆ SetDrawable()

virtual void UTFWin::IWindow::SetDrawable ( IDrawable drawable)
pure virtual

Sets the fill drawable of this window.

When rendering the window, the area will be filled with the fill color and then the fill drawable will be drawn on top of it.

Implemented in UTFWin::Window.

◆ SetEnabled()

void UTFWin::IWindow::SetEnabled ( bool  bEnabled)
inline

Switches the visibility of this window.

This is equivalent to SetFlag(kWinFlagEnabled, bEnabled).

◆ SetFillColor()

virtual void UTFWin::IWindow::SetFillColor ( Color  color)
pure virtual

Sets the fill color of this window.

The fill color acts as a background color: when rendering the window, the area will be filled with the fill color and then the fill drawable will be drawn on top of it.

Parameters
colorThe color to use as the 'fillColor' property.

Implemented in UTFWin::Window.

◆ SetFlag()

virtual void UTFWin::IWindow::SetFlag ( WindowFlags  nFlag,
bool  bValue 
)
pure virtual

Assigns the given value to the specified window flag.

This can be used, for example, to toggle visibility:

IWindow* pWindow = ....;
pWindow->SetFlag(kWinFlagVisible, false); // hide this window
Parameters
nFlagThe window flag whose value will be changed.
bValueThe value that will be assigned to the flag.

Implemented in UTFWin::Window.

◆ SetLayoutArea()

virtual void UTFWin::IWindow::SetLayoutArea ( const Math::Rectangle layoutArea)
pure virtual

Sets the area that this component should have, relative to its parent window, after all layout styles are applied.

This will call the ILayoutStyle::RevertLayout() method on all the layout styles in this window, starting with the last one (so the first layout applied will be the last one to be reverted), and then SetArea is called. This ensures that the given layoutArea parameter will be the real area of this window, but relative to the parent.

Parameters
layoutAreaThe area this window should have.

Implemented in UTFWin::Window.

◆ SetLayoutLocation()

virtual void UTFWin::IWindow::SetLayoutLocation ( float  fX,
float  fY 
)
pure virtual

Assigns the location, relative to the parent window, that this window should have after all layouts are applied.

This will call the ILayoutStyle::RevertLayout() method on all the layout styles in this window, starting with the last one (so the first layout applied will be the last one to be reverted), and then SetArea is called. This ensures that the given location parameters will be the real loctions of this window (relative to its parent). Calling this method effectively calls the Revalidate() method, which ensures the real area of the window is updated using the new values.

Parameters
fXThe X coordinate, relative to the parent, that this window's location should have.
fYThe Y coordinate, relative to the parent, that this window's location should have.

Implemented in UTFWin::Window.

◆ SetLayoutSize()

virtual void UTFWin::IWindow::SetLayoutSize ( float  fWidth,
float  fHeight 
)
pure virtual

Assigns the width and height that this window should have after all layouts are applied.

This will call the ILayoutStyle::RevertLayout() method on all the layout styles in this window, starting with the last one (so the first layout applied will be the last one to be reverted), and then SetArea is called. This ensures that the given width and height parameters will be the real dimensions of this window. Calling this method effectively calls the Revalidate() method, which ensures the real area of the window is updated using the new values.

Parameters
fWidthThe width this window should have.
fHeightThe height this window should have.

Implemented in UTFWin::Window.

◆ SetLocation()

virtual void UTFWin::IWindow::SetLocation ( float  fX,
float  fY 
)
pure virtual

Sets the location of this window, relative to its parent.

Note that this will only affect the 'area' property of the window; the real area might use these values differently depending on the IWinProc objects operating on this window (e.g. SimpleLayout). Calling this method effectively calls the Revalidate() method, which ensures the real area of the window is updated using the new values.

Parameters
fXThe X coordinate to use in the 'area' property.
fYThe Y coordinate to use in the 'area' property.

Implemented in UTFWin::Window.

◆ SetOpacity()

static void UTFWin::IWindow::SetOpacity ( IWindow pWindow,
float  fOpacity 
)
static

Changes the opacity (opposite of transparency) of a window, which is done modifying the 'alpha' value of the shade color.

Parameters
pWindowThe component whose opacity must be changed.
fOpacityHow opaque the window must be. This follows the rule alpha = 1 - fOpacity.

◆ SetShadeColor()

virtual void UTFWin::IWindow::SetShadeColor ( Color  color)
pure virtual

Returns the color modulation value.

This color acts as a tint: after the window is painted, it gets multiplied by this color.

Parameters
colorThe color to use as the 'shadeColor' property.

Implemented in UTFWin::Window.

◆ SetSize()

virtual void UTFWin::IWindow::SetSize ( float  fWidth,
float  fHeight 
)
pure virtual

Assigns the width and height of this window.

Note that this will only affect the 'area' property of the window; the real area might use these values differently depending on the IWinProc objects operating on this window (e.g. SimpleLayout). Calling this method effectively calls the Revalidate() method, which ensures the real area of the window is updated using the new values.

Parameters
fWidthThe width to use in the 'area' property.
fHeightThe height to use in the 'area' property.

Implemented in UTFWin::Window.

◆ SetState()

virtual void UTFWin::IWindow::SetState ( int  state)
pure virtual

Sets the current state (selected, pressed, mouse hover, etc) of this window.

Only certain types use this, like buttons. This will generate a StateChanged message.

Parameters
stateThe new value of the 'state' property.

Implemented in UTFWin::Window.

◆ SetTextFontID()

virtual void UTFWin::IWindow::SetTextFontID ( uint32_t  styleID)
pure virtual

Sets the text font style ID used in this window.

This value might be used or not depending on the implementation and type of window. This method will not update the current text font.

Parameters
styleIDThe ID of the text font to use.

Implemented in UTFWin::Window.

◆ SetVisible()

void UTFWin::IWindow::SetVisible ( bool  bVisible)
inline

Switches the visibility of this window.

This is equivalent to SetFlag(kWinFlagVisible, bVisible).

Member Data Documentation

◆ TYPE

const uint32_t UTFWin::IWindow::TYPE = 0xEEEE8218
static

The documentation for this class was generated from the following file: