UTFWin namespace

The user interface system.

UTFWin is the user interface system in Spore. The ModAPI defines some functionalities of this system; even though a user interface can be created via coding, it is recommended to use the SPUI Editor in SporeModder FX instead. The ModAPI can be useful for programatically creating pieces of interfaces (like the editor categories) and listening to UI Events.

The basic unit in UTFWin is the IWindow, an abstract class that defines an area in the screen. All classes whose name start with 'Win...' are IWindows. The basic implementation is Window; there's another class called InteractiveWindow which is prepared to receive events.

Another key piece in UTFWin is IWinProc, 'window procedures'. Window procedures receive events (aka messages) received on windows, therefore they act as event listeners; they are the UI equivalent to IMessageListener.

For rendering windows, the IDrawable interface is used. Windows can only have one (or none) IDrawable object assigned; depending on the window implementation, the drawable might only be used to render certain parts.

Namespaces

namespace ButtonFlags
namespace ButtonStateFlags

Classes

class BehaviourTimeOscillator
class BehaviourTimeRamp
class BehaviourTimeSmoothRamp
class BiStateEffect
class ButtonDrawableRadio
The standard IDrawable for a standard, simple radio or checkbox button component.
class ButtonDrawableStandard
The standard IDrawable for a standard, simple button component.
class CascadeEffect
template<typename Pointer, typename Reference>
class ChildrenIterator
class ComboBoxDrawable
The standard IDrawable for a combo box component.
struct ComponentSerialization
A structure that defines how a class is stored in an SPUI.
class cSPUIMessageBox
class DefaultDrawable
A class that implements all the methods of an IDrawable.
class DefaultLayoutElement
A default implementation of ILayoutElement.
class DialogDrawable
The standard IDrawable for a dialog component.
class EventPropertyObject
class EventTimeFunctionBase
class FadeEffect
class FrameDrawable
FrameDrawable is a procedural drawable that renders multiple frame styles depending on the current state.
struct FrameStyle
class GlideEffect
class Graphics2D
A class that can be used to draw things in the user interface.
class GridUnknown
class IBiStateEffect
class IButton
An interface that declares all the functions needed by a button component.
class IButtonDrawable
This class is a type of UTFWin::IDrawable capable of rendering an UTFWin::IButton.
class IButtonDrawableRadio
An abstract class that has the methods that a drawable for a simple radio or checkbox button would require.
class IButtonDrawableStandard
An abstract class that has the methods that a drawable for a simple standard button would require.
class ICascadeEffect
class IComboBox
class IComboBoxDrawable
An abstract class that has the methods that a drawable for a combo box would require.
class IDialogDrawable
An abstract class that has the methods that a drawable for a dialog would require.
class IDrawable
A class that is capable of drawing a user interface component.
class IEventTimeFunction
class IGlideEffect
class IImageDrawable
An abstract class that has the methods that a drawable that renders an image would require.
class IInflateEffect
class ILayoutElement
This class represents an element that is part of a user interfaces.
class ILayoutStyle
This class represents an object that can apply a certain layout to a given Rectangle area.
class Image
A layout element that represents an image.
class ImageDrawable
A standard IDrawable that renders an image.
class IModulateEffect
class InflateEffect
class InteractiveWindow
class InteractiveWinProc
class IPerspectiveEffect
class IRotateEffect
class IScrollbarDrawable
An abstract class that has the methods that a drawable for a scrollbar would require.
class ISlider
class ISliderDrawable
An abstract class that has the methods that a drawable for a slider would require.
class ISpinnerDrawable
An abstract class that has the methods that a drawable for a spinner would require.
class IStdDrawable
An abstract class that has the methods that a standard drawable would require.
class ITextEdit
class ITreeNode
class ITreeView
class IWindow
An interface that represents a component in the user interface.
class IWindowManager
class IWinProc
This class is a window procedure, also known as an event/message listener.
class LambdaFilterProc
class LambdaProc
class LayoutObjectsContainer
class LayoutReader
class Message
class MessageBoxCallback
class ModulateEffect
class OutlineFormat
class PerspectiveEffect
template<typename Pointer, typename Reference>
class ProcIterator
struct PropertyMethods
Structure used to define access methods for special property types.
class ProportionalLayout
struct RenderParams
A structure used to represent various parameters for the IDrawable::Paint() method, like which image to draw, the current state of the window, etc.
class RotateEffect
class ScrollbarDrawable
The standard IDrawable for a scrollbar component.
class SerializationService
struct SerializedProperty
Defines how a member of a class is stored in an SPUI.
struct Serializer
A structure that defines how an object must be read in an SPUI.
class SimpleLayout
class SliderDrawable
The standard IDrawable for a slider component.
class SpinnerDrawable
The standard IDrawable for a spinner component.
class SporeAnimatedIconWin
class SporeStdDrawable
class SporeStdDrawableImageInfo
A structure that represents an state of a SporeStdDrawable.
class SporeTooltipWinProc
class StdDrawable
The standard IDrawable for user interactive components.
struct StructSerialization
struct TextChange
This struct is used in kMsgTextChanged messages to represent the text in a ITextEdit.
class TreeNode
class UILayout
An object used to load and contain user interfaces.
class UILayoutObjects
class UIRenderer
class UTFWinObject
class VariableWidthDrawable
A drawable that completely fills the window of variable width with a graphic without a horizontal stretch.
class WinButton
class Window
struct Window_intrusive_list_node
class WindowChildren
class WindowProcedures
class WinGrid
class WinTreeView

Enums

enum class OscillatorTimeFunction: uint32_t { Wave = 1 }
enum EventFlags { kEventFlagBasicInput = 0x01, kEventFlagUpdate = 0x02, kEventFlagPaint = 0x04, kEventWindowChanged = 0x08, kEventStateChanged = 0x10, kEventRefresh = 0x40, kEventFlagAdvanced = 0x80, kEventFlagLayout = 0x108, kEventFlagElement = 0x400 }
enum MessageType { kMsgKeyDown = 0x01, kMsgKeyUp = 0x02, kMsgKeyDown2 = 0x03, kMsgKeyUp2 = 0x04, kMsgKeyPress = 0x05, kMsgMouseDown = 0x06, kMsgMouseUp = 0x07, kMsgMouseMove = 0x08, kMsgMouseWheel = 0x09, kMsgRefresh = 0x0A, kMsgUpdate = 0x0C, kMsgPaint = 0x0D, kMsgWindowChanged = 0x0E, kMsgLayout = 0x10, kMsgElementAdded = 0x11, kMsgElementRemoved = 0x12, kMsgStateChanged = 0x13, kMsgCollisionDetect = 0x14, kMsgTransformed = 0x15, kMsgButtonClick = 0x17, kMsgButtonSelect = 0x18, kMsgMouseEnter = 0x1B, kMsgMouseLeave = 0x1C, kMsgWinProcAdded = 0x1000, kMsgWinProcRemoved = 0x1001, kMsgComponentActivated = 0x287259F6, kMsgTextChanged = 0x9B1552DA }
enum RefreshType { kRefreshMouse = 1, kRefreshKeyboard = 0 }
enum class BackgroundTiling: uint32_t { Stretch = 0, Tile = 1, CenterStretch = 2, CenterTile = 3 }
enum class TriggerType { Visible = 0, Invisible = 1, Enabled = 2, Disabled = 3, MouseFocus = 4, KeyboardFocus = 5, AnyFocus = 6, NoMouseFocus = 7, NoKeyboardFocus = 8, NoFocus = 9, ButtonSelected = 10, ButtonUnselected = 11 }
enum class InterpolationType { Linear = 0, EaseInEaseOut = 1, DampedSpring = 2 }
enum ButtonFlags { kBtnFlagTriggerOnDown = 0x00000001, kBtnFlagFixedWidth = 0x00000002, kBtnFlagFixedHeight = 0x00000004 }
Flags that can be set to an UTFWin::IButton.
enum ButtonStateFlags { kBtnStateSelected = 4 }
Flags relted to the state of a button that can be set to an UTFWin::IButton.
enum ComboBoxFlags { kComboBoxOutline = 0x00000001 }
enum class ComboBoxColors { Foreground = 0, Background = 1, HighlightedForeground = 2, HighlightedBackground = 3, SelectedForeground = 4, SelectedBackground = 5 }
enum class Scaling { StretchImage = 1, StretchCenter = 2, TileImage = 3, TileCenter = 4 }
An enumeration used by certain drawables, that determines how to draw the images.
enum class AlignmentH { Left = 1, Right = 2, Center = 3 }
enum class AlignmentV { Top = 1, Bottom = 2, Middle = 3 }
enum class FontAlignmentH { Default = 0, Left = 1, Right = 2, Center = 3 }
enum class FontAlignmentV { Default = 0, Top = 1, Bottom = 2, Middle = 3 }
enum class Orientation { Horizontal = 1, Vertical = 2 }
enum class ButtonTypes { Standard = 1, Toggle = 2, Radio = 3 }
enum class StateIndices: uint32_t { Normal = 0, Disabled = 1, Highlighted = 2, Active = 3, CheckedNormal = 4, CheckedDisabled = 5, CheckedHighlighted = 6, CheckedActive = 7 }
enum class ImageTiling { None = 0, Standard = 1, Edge = 2 }
An enumeration used by ImageDrawable, that determine how the image is tiled.
enum class TextColors { Text = 0, Background = 1, DisabledText = 2, DisabledBackground = 3, SelectedText = 4, SelectedBackground = 5, Caret = 6, CaretBackground = 7 }
enum class TextEditWarpMode: uint32_t { SingleLine = 0, MultiLine = 1, MultiLineWordWrap = 2 }
enum class ScrollbarEnDis: uint32_t { Never = 0, AsNeeded = 1, Always = 2 }
enum WindowFlags { kWinFlagVisible = 0x1, kWinFlagEnabled = 0x2, kWinFlagClickToFront = 0x4, kWinFlagIgnoreMouse = 0x10, kWinFlagAlwaysInFront = 0x40, kWinFlagClip = 0x400, kWinFlagIgnoreMouseChildren = 0x1000 }
enum (anonymous) { kStateEnabled = 1, kStateClicked = 2, kStateHover = 8 }
enum SerializedTypes { kTypeParent = 1, kTypeBool = 2, kTypeUInt8 = 3, kTypeUInt16 = 4, kTypeUInt32 = 5, kTypeUInt64 = 6, kTypeInt8 = 7, kTypeInt16 = 8, kTypeInt32 = 9, kTypeInt64 = 10, kTypeFloat = 11, kTypeDim = 15, kTypeVec4 = 16, kTypeVec2 = 17, kTypeText = 18, kTypePointer = 19, kTypeStruct = 20, kFlagArray = 0x8000 }
The possible property types used in SPUI serialization.
enum LayoutAnchor { kAnchorTop = 1, kAnchorBottom = 2, kAnchorLeft = 4, kAnchorRight = 8 }
enum class IconDrawModes: uint32_t { ImageSize = 0, WindowSize = 1 }
enum class ShadowModes: uint32_t { None = 0, Full = 1, Background = 2, Icon = 3 }
enum class TooltipBehaviour: uint32_t { Default = 0, UnderWindow = 1, Offset = 2 }

Typedefs

using Effect = InteractiveWinProc
using IWindowList_t = intrusive_list<Window_intrusive_list_node>
using HandleUILambda_t = function<bool(IWindow*, const Message&)>
using Tooltip = SporeTooltipWinProc
using ProgressBarDrawable = VariableWidthDrawable

Functions

auto GetAllocator() -> ICoreAllocator*
auto Addresses(ButtonDrawableRadio) -> namespace
auto Addresses(ButtonDrawableStandard) -> namespace
auto Addresses(CascadeEffect) -> namespace
auto Addresses(ComboBoxDrawable) -> namespace
auto GetEventFlags(MessageType type) -> EventFlags
auto Addresses(cSPUIMessageBox) -> namespace
auto Addresses(DialogDrawable) -> namespace
auto Addresses(BiStateEffect) -> namespace
auto Addresses(FadeEffect) -> namespace
auto Addresses(FrameDrawable) -> namespace
auto Addresses(GlideEffect) -> namespace
auto Addresses(Graphics2D) -> namespace
auto Addresses(IButton) -> namespace
auto Addresses(Image) -> namespace
auto Addresses(ImageDrawable) -> namespace
auto Addresses(IImageDrawable) -> namespace
auto Addresses(InflateEffect) -> namespace
auto Addresses(InteractiveWinProc) -> namespace
auto Addresses(ITextEdit) -> namespace
auto Addresses(IWindowManager) -> namespace
auto Addresses(ModulateEffect) -> namespace
auto Addresses(PerspectiveEffect) -> namespace
auto Addresses(ProportionalLayout) -> namespace
auto Addresses(RotateEffect) -> namespace
auto Addresses(ScrollbarDrawable) -> namespace
auto Addresses(SimpleLayout) -> namespace
auto Addresses(SliderDrawable) -> namespace
auto Addresses(SpinnerDrawable) -> namespace
auto Addresses(SporeStdDrawable) -> namespace
auto Addresses(SporeStdDrawableImageInfo) -> namespace
auto CreateTooltip(const char16_t* pText, const char16_t* pDetailedText = nullptr, const char16_t* pLayoutName = u"tooltips", uint32_t controlID = 0x3754E6C, uint32_t detailControlID = 0x3754E6C) -> Tooltip*
Creates an instance of the Tooltip class that can be used to display the given text as a tooltip.
auto Addresses(SporeTooltipWinProc) -> namespace
auto Addresses(StdDrawable) -> namespace
auto Addresses(TreeNode) -> namespace
auto Addresses(UILayout) -> namespace
auto Addresses(UIRenderer) -> namespace
auto Addresses(UTFWinObject) -> namespace
auto Addresses(VariableWidthDrawable) -> namespace
auto Addresses(Window) -> namespace

Enum documentation

enum class UTFWin::OscillatorTimeFunction: uint32_t

enum UTFWin::EventFlags

Enumerators
kEventFlagBasicInput

A flag to listen to message types 0x01 – 0x09 and 0x17 – 0x1A, that is, all the ones related to keyboard and mouse input.

kEventFlagUpdate

A flag to listen to the message type kMsgUpdate.

kEventFlagPaint

A flag to listen to the message type kMsgPaint.

kEventWindowChanged

A flag to listen to the message type kMsgWindowChanged and 0x0F.

kEventStateChanged

A flag to listen to the message type kMsgStateChanged.

kEventRefresh

A flag to listen to the message types kMsgRefresh, kMsgMouseEnter and kMsgMouseLeave.

kEventFlagAdvanced

A flag to listen to the rest of message tyoes, all the ones above 0x1C.

This does not include the kMsgWinProcAdded and kMsgWinProcRemoved, which are ALWAYS listened.

kEventFlagLayout

Some flags to listen to the message type kMsgLayout. This is composed of multiple flags.

kEventFlagElement

A flag to listen to the message types kMsgElementAdded and kMsgElementRemoved.

enum UTFWin::MessageType

Enumerators
kMsgKeyDown

Occurs when a key is pressed while the component has focus.

kMsgKeyUp

Occurs when a key is released while the component has focus.

kMsgKeyDown2

Occurs when a key is pressed while the component has focus.

kMsgKeyUp2

Occurs when a key is released while the component has focus.

kMsgKeyPress

Occurs when a character. space or backspace key is pressed while the control has focus.

kMsgMouseDown

Occurs when the mouse pointer is over the component and a mouse button is pressed.

kMsgMouseUp

Occurs when the mouse pointer is over the component and a mouse button is released.

kMsgMouseMove

Occurs when the mouse pointer is moved over the component.

kMsgMouseWheel

Occurs when the mouse wheel moves while the component has focus.

kMsgRefresh

Occurs when the mouse pointer leaves or enters the component.

kMsgUpdate

Occurs every game loop, not all components receive this message.

kMsgPaint

Occurs when the component is redrawn.

kMsgWindowChanged

Occurs when something in the window (caption, flags or drawable) changes.

kMsgLayout

Occurs every time the window area is changed, when IWindow::Revalidate() is called.

kMsgElementAdded

Occurs every time a window or procedure is added.

kMsgElementRemoved

Occurs every time a window is removed.

kMsgStateChanged

Occurs when the state of a window changes.

kMsgCollisionDetect

Occurs when a window is checked to see if it contains the mouse pointer.

kMsgTransformed

Occurs when a transformation is applied to a window.

kMsgButtonClick

Occurs when a standard button is clicked.

kMsgButtonSelect

Occurs when a toggle or radio button is selected.

kMsgMouseEnter

Occurs when the mouse pointer enters the component.

kMsgMouseLeave

Occurs when the mouse pointer leaves the component.

kMsgWinProcAdded

Occurs inmediately after a IWinProc is added to a component.

This is called directly on the IWinProc.

kMsgWinProcRemoved

Occurs inmediately after a IWinProc is removed from a component.

This is called directly on the IWinProc.

kMsgComponentActivated

kMsgTextChanged

Occurs when the text inside a ITextEdit is changed.

enum UTFWin::RefreshType

enum class UTFWin::BackgroundTiling: uint32_t

Enumerators
Stretch

Stretches background image.

Tile

Tiles image.

CenterStretch

Stretches center of image and tiles edges,.

CenterTile

Tiles center and edges.

enum class UTFWin::TriggerType

enum class UTFWin::InterpolationType

enum UTFWin::ButtonFlags

Flags that can be set to an UTFWin::IButton.

Enumerators
kBtnFlagTriggerOnDown

Button considers itself clicked on mouse/key down rather than mouse/key up.

kBtnFlagFixedWidth

Button is fixed width - this means that you can still resize the window area but the actual button width will remain fixed and and it will be positioned within a given window area. Most often used with radio and check box buttons with caption text positioned to the left or right of the button.

kBtnFlagFixedHeight

Button is fixed height - this means that you can still resize the window area but the actual button height will remain fixed and and it will be positioned within a given window area. Most often used with radio and check box buttons with caption text positioned to the left or right of the button.

enum UTFWin::ButtonStateFlags

Flags relted to the state of a button that can be set to an UTFWin::IButton.

enum UTFWin::ComboBoxFlags

Enumerators
kComboBoxOutline

An outline is drawn around the control when highlighted.

enum class UTFWin::ComboBoxColors

enum class UTFWin::Scaling

An enumeration used by certain drawables, that determines how to draw the images.

Enumerators
StretchImage

Stretch the entire image so it fills all the space.

StretchCenter

Draw the edges of the image normally and then stretch the center.

TileImage

Use tiling to fill the space, repeatedly rendering the image.

TileCenter

Draw the edges of the iamge normally, and then tile the center.

enum class UTFWin::AlignmentH

enum class UTFWin::AlignmentV

enum class UTFWin::FontAlignmentH

enum class UTFWin::FontAlignmentV

enum class UTFWin::Orientation

enum class UTFWin::ButtonTypes

enum class UTFWin::StateIndices: uint32_t

enum class UTFWin::ImageTiling

An enumeration used by ImageDrawable, that determine how the image is tiled.

Enumerators
None

No tiling is used.

Standard

The entire image is tiled to fill the space.

Edge

Draws the edges (whcih are considered 1/3 of the space) normally and tiles the rest of the image until it fills all the space.

enum class UTFWin::TextColors

enum class UTFWin::TextEditWarpMode: uint32_t

Enumerators
SingleLine

All text in one line.

MultiLine

Wrap on hard linebreaks only.

MultiLineWordWrap

Multiline with soft wordwrap.

enum class UTFWin::ScrollbarEnDis: uint32_t

enum UTFWin::WindowFlags

Enumerators
kWinFlagVisible

Flag indicating that this window is visible.

kWinFlagEnabled

Flag to put the window into an interactive state.

kWinFlagClickToFront

If true, window will move to front when clicked.

kWinFlagIgnoreMouse

Flag indicating that this window can't recieve mouse events.

kWinFlagAlwaysInFront

If true, window will always be in front of windows that don't have this flag.

kWinFlagClip

Flag indicating whether child windows should be clipped.

kWinFlagIgnoreMouseChildren

Flag indicating that this window's children can't recieve mouse events.

enum UTFWin::(anonymous)

enum UTFWin::SerializedTypes

The possible property types used in SPUI serialization.

enum class UTFWin::IconDrawModes: uint32_t

enum class UTFWin::ShadowModes: uint32_t

Enumerators
None

Don't use shadows.

Full

Use shadows for both the background and the icon.

Background

Only use shadows for the background.

Icon

Only use shadows for the icon.

enum class UTFWin::TooltipBehaviour: uint32_t

Typedef documentation

typedef intrusive_list<Window_intrusive_list_node> UTFWin::IWindowList_t

typedef function<bool(IWindow*, const Message&)> UTFWin::HandleUILambda_t

Function documentation

namespace UTFWin::Addresses(BiStateEffect)

namespace UTFWin::Addresses(FadeEffect)

namespace UTFWin::Addresses(GlideEffect)

namespace UTFWin::Addresses(Graphics2D)

namespace UTFWin::Addresses(IButton)

namespace UTFWin::Addresses(Image)

namespace UTFWin::Addresses(ITextEdit)

Tooltip* UTFWin::CreateTooltip(const char16_t* pText, const char16_t* pDetailedText = nullptr, const char16_t* pLayoutName = u"tooltips", uint32_t controlID = 0x3754E6C, uint32_t detailControlID = 0x3754E6C)

Creates an instance of the Tooltip class that can be used to display the given text as a tooltip.

Parameters
pText The text the tooltip displays.
pDetailedText [Optional] The detailed text showed when the mouse has been a while hovering.
pLayoutName [Optional] The name of the UI layout used in the tooltip.
controlID [Optional] The ControlID of the window in the layout that will display the text.
detailControlID [Optional] The ControlID of the window in the layout that will display the detailed text.

Tooltips are window procedures, so you can add it to a window with IWindow::AddWinProc().

namespace UTFWin::Addresses(StdDrawable)

namespace UTFWin::Addresses(TreeNode)

namespace UTFWin::Addresses(UILayout)

namespace UTFWin::Addresses(UIRenderer)

namespace UTFWin::Addresses(Window)