MQMenuItem class

(new in Rev4.30)

MQCheckBox class manages a menu item. It inherits a MQWidgetBase class.

Please refer the inherited class about member functions declared in the inherited class.

Class
MQMenuItem Constructor
~MQMenuItem Destructor
Member functions
GetText Get a displaying text
SetText Set a displaying text
GetChecked Get a checked status
SetChecked Set a checked status
GetToggle Get a toggle
SetToggle Set a toggle
GetClickClose Get close by clicking
SetClickClose Set close by clicking
GetSeparator Get a separator
SetSeparator Set a separator
GetShortcutString Get a shortcut string
SetShortcutString Set a shortcut string
Events
AddClickEvent Add an event for clicking

MQMenuItem::MQMenuItem(MQWidgetBase *parent);

MQMenuItem::MQMenuItem(int id);

parent
A parent widget (MQPopup or MQMenuItem)
id
A widget ID created outside the plug-in

It is a constructor.

Usually, a menu is not created by 'new'. It is created by MQPopup::CreateMenuItem() or MQPopup::CreateSubMenuItem().


virtual MQMenuItem::~MQMenuItem();

This method is a destructor. It is defined as a virtual function.


std::wstring MQMenuItem::GetText();

Return value
A displaying text

It returns a displaying text.


void MQMenuItem::SetText(const std::wstring& text);

text
A displaying text

It specifies a displaying text.


bool MQMenuItem::GetChecked();

Return value
A checked status

It returns whether a check is on or off.


void MQMenuItem::SetChecked(bool value);

value
A checked status

It specifies whether a check is on or off.


bool MQMenuItem::GetToggle();

Return value
A toggle status

It returns whether a check is toggled or not.


void MQMenuItem::SetToggle(bool value);

value
A toggle status

It specifies whether a check is toggled or not.


bool MQMenuItem::GetClickClose();

Return value
Close by clicking

It returns whether a popup is automatically closed or not by clicking.

The default value is true.


void MQMenuItem::SetClickClose(bool value);

value
Close by clicking

It specifies whether a popup is automatically closed or not by clicking.


bool MQMenuItem::GetSeparator();

Return value
A separation line

It returns whether by up and down menus are separately displayed by a line.


void MQMenuItem::SetSeparator(bool value);

value
A separation line

It specifies whether by up and down menus are separately displayed by a line.

When a separator is set, it cannot be clicked.


std::wstring MQMenuItem::GetShortcutString();

Return value
A shortcut sstring

(new in Rev4.60)

It returns a shortcut string displayed on a menu.


void MQMenuItem::SetShortcutString(const std::wstring& text);

text
A shortcut sstring

(new in Rev4.60)

It specifies a shortcut string displayed on a menu.


template<typename T> void MQMenuItem::AddClickEvent(T *p, BOOL (T::*f)(MQWidgetBase*, MQDocument), bool prior = false)

p
A widget to notify events
f
A member function to notify events
prior
An order to notify events
[true] Notify first
[false] Notify last

It adds events notified when a menu is clicked.