MQLabel class

(new in Rev4.00)

MQLabel class manages a label to display a string. It inherites MQWidgetBase class.

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

Class
MQLabel Constructor
~MQLabel 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
GetVerticalText Get a vertical text
SetVerticalText Set a vertical text
GetWordWrap Get a word wrap
SetWordWrap Set a word wrap
GetFrame Get a frame to display
SetFrame Set a frame to display

MQLabel::MQLabel();

MQLabel::MQLabel(int id);

id
A widget ID created outside the plug-in

It is a constructor.


virtual MQLabel::~MQLabel();

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


std::wstring MQLabel::GetText();

Return value
A displayed string

It returns a displayed string.


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

text
A displayed string

It specifies a displayed string.


std::wstring MQLabel::GetFontName();

Return value
Font name

It returns a font name for displaying a text.


void MQLabel::SetFontName(const std::wstring& value);

value
Font name

It specifies a font name for displaying a text.


bool MQLabel::GetFontBold();

Return value
Bold font

It returns whether a displayed font is bold or not.


void MQLabel::SetFontBold(bool value);

value
Bold font

It specifies whether a displayed font is bold or not.


double MQLabel::GetFontScale();

Return value
Font scaling

It returns a font scaling ratio for a default font size.

A default value is 1.0.


void MQLabel::SetFontScale(double value);

value
Font scaling

It specifies a font scaling ratio for a default font size.


void MQLabel::GetFontColor(int& r, int& g, int& b, int& a);

r
Red value
g
Green value
b
Blue value
a
Opacity

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 MQLabel::SetFontColor(int r, int g, int b, int a);

r
Red value
g
Green value
b
Blue value
a
Opacity

It specifies a color of a displayed font. Each value is from 0 to 255.


MQLabel::MQLabelTextAlignment MQLabel::GetAlignment();

Return value
An alignment for a text
[ALIGN_LEFT] Left
[ALIGN_CENTER] Center
[ALIGN_RIGHT] Right

It returns an alignment for displaying a text.


void MQLabel::SetAlignment(MQLabelTextAlignment value);

value
An alignment for a text
[ALIGN_LEFT] Left
[ALIGN_CENTER] Center
[ALIGN_RIGHT] Right

It specifies an alignment for displaying a text.


bool MQLabel::GetVerticalText();

Return value
A vertical text

It returns whether a text is displayed horizontally(false) or vertically(true).


void MQLabel::SetVerticalText(bool value);

value
A vertical text

It specifies whether a text is displayed horizontally(false) or vertically(true).


bool MQLabel::GetWordWrap();

Return value
A word wrap

It returns whether a long sentence that cannot be with in a single line is displayed in multiple lines by separating between words.


void MQLabel::SetWordWrap(bool value);

value
A word wrap

It specifies whether a long sentence that cannot be with in a single line is displayed in multiple lines by separating between words.


bool MQLabel::GetFrame();

Return value
Displaying a frame

It returns whether to display a frame outside a text.


void MQLabel::SetFrame(bool value);

value
Displaying a frame

It specifies whether to display a frame outside a text.