(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);
It is a constructor.
virtual MQButton::~MQButton();
This method is a destructor. It is defined as a virtual function.
std::wstring MQButton::GetText();
It returns a text displayed on a button.
void MQButton::SetText(const std::wstring& text);
It specifies a text displayed on a button.
bool MQButton::GetToggle();
It returns whether a button is automatically switched on and off when a button is pushed.
void MQButton::SetToggle(bool value);
It specifies whether a button is automatically switched on and off when a button is pushed.
bool MQButton::GetDown();
It returns whether a button is on or off.
void MQButton::SetDown(bool value);
It specifies whether a button is on or off.
bool MQButton::GetRepeat();
It returns whether events are repeatedly invoked while a button is held down.
void MQButton::SetRepeat(bool value);
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();
It returns whether a button is displayed with a connection to a neighbor button or not.
void MQButton::SetChain(bool value);
It specifies whether a button is displayed with a connection to a neighbor button or not.
void MQButton::SetDefault(bool value);
It specifies whether a button works or not when an Enter key is pressed in a dialog.
void MQButton::SetCancel(bool value);
It specifies whether a button works or not when an Esc key is pressed in a dialog.
void MQButton::SetModalResult(MQDialog::DIALOG_RESULT value);
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);
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);
It adds events notified when a button is held down.
It is necessary that 'true' is specified in SetRepeat() to notify this event.