Palettes::PaletteUI class

This class holds all information related to the user interface of a palette.

It's the UI representation of a Palettes::PaletteMain.

Base classes

class UTFWin::IWinProc
This class is a window procedure, also known as an event/message listener.
class DefaultRefCounted
The default implementation of a reference counted class.

Public types

enum ControlIDs { kControlLeftArrowBtn = 0x5AEC4B8, kControlRightArrowBtn = 0x05AEC4B9, kControlCategoryButtons = 0x72DF4CEE, kControlCategoryContent = 0x93019DBC }

Public static variables

static const static uint32_t TYPE

Constructors, destructors, conversion operators

PaletteUI()
~PaletteUI() virtual

Public functions

void Load(PaletteMain* pPalette, IWindow* pWindow, bool, void*)
The UI is generated in the following steps:
void Update(int msTime)
auto AddRef() -> int virtual
auto Release() -> int virtual
auto Cast(uint32_t) -> void* virtual
auto GetEventFlags() const -> int override
Gets the flags that represent which type of messages this IWinProc can handle.
auto HandleUIMessage(IWindow* pWindow, const Message& message) -> bool override
Method called every time a message is received on a window that has this IWinProc added.

Public variables

intrusive_ptr<UILayout> mpLayout
The layout of the palette, loaded using the ID in Palettes::PaletteMain::mLayoutID.
IWindow* mpCategoryButtonsWindow
The window that contains the category selection buttons.
IWindow* field_14
IWindow* field_18
IWindow* field_1C
SporeAnimatedIconWin* mpAnimatedWindow
IWindow* mpCategoryContent
The window that is used to display the category content (e.g. its pages)
IWindow* mpMainWindow
The main window of the UILayout, with ControlID 0xFFFFFFFF.
intrusive_ptr<PaletteMain> mpPalette
The Palettes::PaletteMain that this UI displays.
intrusive_ptr<DefaultRefCounted> field_30
vector<intrusive_ptr<PaletteCategoryUI>> mCategories
The UI objects for all categories contained in the palette. They are in the same order as the PaletteMain::mCategories field.
vector<int> field_48
int field_5C
int field_60
int field_64
bool field_68
bool field_69

Enum documentation

enum Palettes::PaletteUI::ControlIDs

Enumerators
kControlLeftArrowBtn

The ControlID and CommandID of the left arrow button that changes the categories displayed.

kControlRightArrowBtn

The ControlID and CommandID of the right arrow button that changes the categories displayed.

kControlCategoryButtons

The ControlID of the window that contains the category selection buttons.

kControlCategoryContent

The ControlID of the window that is used to display the category content (e.g. its pages)

Function documentation

void Palettes::PaletteUI::Load(PaletteMain* pPalette, IWindow* pWindow, bool, void*)

The UI is generated in the following steps:

  1. The UILayout of the palette is loaded; it's parent is set to pWindow using the UTFWin::UILayout::SetParentWindow() method.
  2. The mpMainWindow is set to the window with ControlID 0xFFFFFFFF; if it exists, the method IWindow::FitParentArea() will be called.
  3. The mAnimatedWindow is set to the window with ControlID 0x49AFE6A1, and it is set invisible.
  4. This object is added as a IWinProc in the windows with ControlID: kControlLeftArrowBtn, kControlRightArrowBtn and 0x7BCE6E8

int Palettes::PaletteUI::GetEventFlags() const override

Gets the flags that represent which type of messages this IWinProc can handle.

This allows for better performance, since generally a procedure only needs to listen specific events. The flags are in the kEventFlag... values.

bool Palettes::PaletteUI::HandleUIMessage(IWindow* pWindow, const Message& message) override

Method called every time a message is received on a window that has this IWinProc added.

Parameters
pWindow The window that received this message.
message The message received.
Returns Whether the message was handled or not.

This method is responsible of handling (or not) the message. This method receives the IWindow that is currently receiving the message; this way, the same IWinProc can be listening for more than one window. This method returns whether the message was handled or not; if it was handled, no other IWinProcs will be called on that window.