(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 |
GetFlat | Get a flat style |
SetFlat | Set a flat style |
GetPaddingX | Get a horizontal padding |
SetPaddingX | Set a horizontal padding |
GetPaddingY | Get a vertical padding |
SetPaddingY | Set a vertical padding |
SetSystemSVGFile | Set a system SVG file |
GetImageScale | Get a scale for an image |
SetImageScale | Set a scale for an image |
GetImagePosition | Get a position for an image |
SetImagePosition | Set a position for an image |
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 |
Static functions | |
ReorderOKButton | Swap display order of OK button |
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.
bool GetFlat()
(new in Rev4.60)
It returns whether a button is displayed as a flat style.
bool SetFlat()
(new in Rev4.60)
It specifies whether a button is displayed as a flat style.
double MQButton::GetPaddingX();
(new in Rev4.30)
It returns a horizontal padding between a text, an icon and so on.
void MQButton::SetPaddingX(double value);
(new in Rev4.30)
It specifies a horizontal padding between a text, an icon and so on.
double MQButton::GetPaddingY();
(new in Rev4.30)
It returns a vertical padding between a text, an icon and so on.
void MQButton::SetPaddingY(double value);
(new in Rev4.30)
It specifies a vertical padding between a text, an icon and so on.
void MQButton::SetSystemSVGFile(const wchar_t *filename);
(new in Rev4.30)
It shows a svg image prepared by a system as an icon.
double MQButton::GetImageScale();
(new in Rev4.32)
It returns a scaling factor for a svg image.
void MQButton::SetImageScale(double value);
(new in Rev4.32)
It specifies a scaling factor for a svg image.
MQButton::MQButtonImagePosition MQButton::GetImagePosition();
(new in Rev4.32)
It returns where a svg image is shown.
void MQButton::SetImagePosition(MQButtonImagePosition value);
(new in Rev4.32)
It specifies where a svg image is shown.
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.
static void MQButton::ReorderOKButton(MQWidgetBase *parent, MQButton *btn1, MQButton *btn2);
(new in Rev4.59)
It swaps the placement of the OK button and the Cancel button on MacOS.
It does nothing on Windows, but same code can be writable on Windows and Mac.