class ToolbarItemManager

Tracks toolbar items that are registered in managed code using the ToolbarItem attribute.

Public

Constructors

ToolbarItemManager

ToolbarItemManager(ScriptAssemblyManager &scriptObjectManager)

Methods

~ToolbarItemManager

~ToolbarItemManager() noexcept

staticInstance

static T &Instance()

Returns a reference to the module instance.

Module has to have been started up first otherwise an exception will be thrown.

staticInstancePtr

static T *InstancePtr()

Returns a pointer to the module instance.

Module has to have been started up first otherwise an exception will be thrown.

staticShutDown

static void ShutDown()

Shuts down this module and frees any resources it is using.

staticIsStarted

static bool IsStarted()

Query if the module has been started.

Protected

Methods

~Module<T>

virtual ~Module<T>() = default

OnStartUp

virtual void OnStartUp()

Override if you want your module to be notified once it has been constructed and started.

OnShutDown

virtual void OnShutDown()

Override if you want your module to be notified just before it is deleted.

staticInstanceInternal

static T *&InstanceInternal()

Returns a singleton instance of this module.

staticIsDestroyed

static bool &IsDestroyed()

Checks has the Module been shut down.

staticIsStartedUp

static bool &IsStartedUp()

Checks has the Module been started up.

Private

Methods

ClearToolbarItems

void ClearToolbarItems()

Removes all managed toolbar items from the main menu.

ReloadAssemblyData

void ReloadAssemblyData()

Reloads all assembly types and attempts to find uses of ToolbarItem.

Old toolbar items are cleared and new are added.

ParseToolbarItemMethod

bool ParseToolbarItemMethod(MonoMethod *method, String &name, HSpriteImage &icon, HString &tooltip, i32 &priority, bool &separator) const

Parse the provided method and detect whether it has a ToolbarItem attribute.

If it has extract needed data from it.

method
Managed method to parse.
name
Output name defined in the ToolbarItem attribute.
icon
Image defined in the ToolbarItem attribute.
tooltip
Optional tooltip defined in the ToolbarItem attribute.
priority
Menu item priority defined in the MenuItem attribute.
separator
Should the separator be inserted before the menu item.

Returns: True if the method has a ToolbarItem attribute. If false is returned output parameters from this method are undefined.

staticToolbarItemCallback

static void ToolbarItemCallback(MonoMethod *method)

Triggered when one of the managed toolbar items is clicked.

method
Managed method that the ToolbarItem is referencing.

Fields

mScriptObjectManager

ScriptAssemblyManager & mScriptObjectManager

mOnAssemblyRefreshAssembliesLoadedConnection

HEvent mOnAssemblyRefreshAssembliesLoadedConnection

mToolbarItemAttribute

MonoClass * mToolbarItemAttribute

mNameField

MonoField * mNameField

mIconField

MonoField * mIconField

mStockIconField

MonoField * mStockIconField

mTooltipField

MonoField * mTooltipField

mPriorityField

MonoField * mPriorityField

mSeparatorField

MonoField * mSeparatorField

mToolbarItems

Vector<String> mToolbarItems