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 uint32_t TYPE

Constructors, destructors, conversion operators

PaletteUI()
~PaletteUI() virtual

Public functions

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

Public variables

UILayoutPtr mpLayout
The layout of the palette, loaded using the ID in Palettes::PaletteMain::mLayoutID.
UTFWin::IWindow* mpCategoryButtonsWindow
The window that contains the category selection buttons.
UTFWin::IWindow* field_14
UTFWin::IWindow* field_18
UTFWin::IWindow* field_1C
UTFWin::SporeAnimatedIconWin* mpAnimatedWindow
UTFWin::IWindow* mpCategoryContent
The window that is used to display the category content (e.g. its pages)
UTFWin::IWindow* mpMainWindow
The main window of the UILayout, with ControlID 0xFFFFFFFF.
PaletteMainPtr mpPalette
The Palettes::PaletteMain that this UI displays.
PaletteInfoPtr mpPaletteInfo
eastl::vector<PaletteCategoryUIPtr> mCategories
The UI objects for all categories contained in the palette. They are in the same order as the PaletteMain::mCategories field.
eastl::vector<int> field_48
int field_5C
int field_60
PaletteCategoryUIPtr mpActiveCategory
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, UTFWin::IWindow* pWindow, bool, PaletteInfo* pInfo)

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(UTFWin::IWindow* pWindow, const UTFWin::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.