(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 |
GetFontName | Get a font name |
SetFontName | Set a font name |
GetFontBold | Get a bold font |
SetFontBold | Set a bold font |
GetFontScale | Get a font scaling |
SetFontScale | Set a font scaling |
GetFontColor | Get a font color |
SetFontColor | Set a font color |
GetAlignment | Get an alignment for a text |
SetAlignment | Set an alignment for a text |
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.
std::wstring MQButton::GetFontName();
It returns a font name for displaying a text.
void MQButton::SetFontName(const std::wstring& value);
It specifies a font name for displaying a text.
bool MQButton::GetFontBold();
It returns whether a displayed font is bold or not.
void MQButton::SetFontBold(bool value);
It specifies whether a displayed font is bold or not.
double MQButton::GetFontScale();
It returns a font scaling ratio for a default font size.
A default value is 1.0.
void MQButton::SetFontScale(double value);
It specifies a font scaling ratio for a default font size.
void MQButton::GetFontColor(int& r, int& g, int& b, int& a);
It returns a color of a displayed font. Each value is from 0 to 255.
When a is 0, a text is drawn with a default color.
void MQButton::SetFontColor(int r, int g, int b, int a);
It specifies a color of a displayed font. Each value is from 0 to 255.
MQButton::MQButtonTextAlignment MQButton::GetAlignment();
(new in Rev4.20)
It returns an alignment for displaying a text.
void MQButton::SetAlignment(MQMQButtonTextAlignment value);
(new in Rev4.20)
It specifies an alignment for displaying a text.
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.