MQButton class

(new in Rev4.00)

MQButton class manges a button. It inherits a MQWidgetBase class.

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

Class
MQButton Constructor
~MQButton Destructor
Member functions
GetText Get a displayed string
SetText Set a displayed string
GetToggle Get an automatic switching
SetToggle Set an automatic switching
GetDown Get a down status
SetDown Set a down status
GetRepeat Get a repeatability
SetRepeat Set a repeatability
GetChain Get a chain display
SetChain Set a chain display
SetDefault Set as a default button
SetCancel Set as a cancel button
SetModalResult Set a result for a dialog
Events
AddClickEvent Add an event for a click
AddRepeatEvent Add an event for holding down

MQButton::MQButton();

MQButton::MQButton(int id);

id
A widget ID created outside the plug-in

It is a constructor.


virtual MQButton::~MQButton();

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


std::wstring MQButton::GetText();

Return value
A displayed text

It returns a text displayed on a button.


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

text
A displayed text

It specifies a text displayed on a button.


bool MQButton::GetToggle();

Return value
Automatic switching

It returns whether a button is automatically switched on and off when a button is pushed.


void MQButton::SetToggle(bool value);

value
Automatic switching

It specifies whether a button is automatically switched on and off when a button is pushed.


bool MQButton::GetDown();

Return value
Down or up

It returns whether a button is on or off.


void MQButton::SetDown(bool value);

value
Down or up

It specifies whether a button is on or off.


bool MQButton::GetRepeat();

Return value
Repeatability

It returns whether events are repeatedly invoked while a button is held down.


void MQButton::SetRepeat(bool value);

value
Repeatability

It specifies whether events are repeatedly invoked while a button is held down.

A function specified in AddRepeatEvent will be called in the case that 'true' is specified.


bool MQButton::GetChain();

Return value
A chain status

It returns whether a button is displayed with a connection to a neighbor button or not.


void MQButton::SetChain(bool value);

value
A chain status

It specifies whether a button is displayed with a connection to a neighbor button or not.


void MQButton::SetDefault(bool value);

value
As a default button

It specifies whether a button works or not when an Enter key is pressed in a dialog.


void MQButton::SetCancel(bool value);

value
As a cancel button

It specifies whether a button works or not when an Esc key is pressed in a dialog.


void MQButton::SetModalResult(MQDialog::DIALOG_RESULT value);

value
A result value for a dialog
[DIALOG_NONE] None
[DIALOG_OK] As a 'OK' button
[DIALOG_CANCEL] As a 'Cancel' button
[DIALOG_YES] As a 'Yes' button
[DIALOG_NO] As a 'No' button
[DIALOG_ALL] As an 'All' button

It specifies a return value of MQDialog::Execute when a button is pushed.

A dialog will be closed automatically when a button is pushed in the case that a result value except DIALOG_NONE is specified.


template<typename T> void MQButton::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 button is pushed.


template<typename T> void MQButton::AddRepeatEvent(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 button is held down.

It is necessary that 'true' is specified in SetRepeat() to notify this event.