(new in Rev4.00)
MQEdit class manages an edit for inputting a string or a number. It inherits a MQWidgetBase class.
Please refer the inherited class about member functions declared in the inherited class.
Class | |
MQEdit | Constructor |
~MQEdit | Destructor |
Member functions | |
GetText | Get a displayed string |
SetText | Set a displayed string |
GetReadOnly | Get a read-only mode |
SetReadOnly | Set a read-only mode |
GetPassword | Get a password mode |
SetPassword | Set a password mode |
GetAlignment | Get an alignment for a text |
SetAlignment | Set an alignment for a text |
GetNumeric | Get a numeric input mode |
SetNumeric | Set a numeric input mode |
GetMaxLength | Get a maximum number of wide characters |
SetMaxLength | Set a maximum number of wide characters |
GetMaxAnsiLength | Get a maximum number of ANSI characters |
SetMaxAnsiLength | Set a maximum number of ANSI characters |
GetVisibleColumn | Get a number of columns to display |
SetVisibleColumn | Set a number of columns to display |
SetFocus | Set a focus |
Events | |
AddChangedEvent | Add an event after finishing to change a text |
AddChangingEvent | Add an event while changing a text |
MQEdit::MQEdit();
MQEdit::MQEdit(int id);
It is a constructor.
virtual MQEdit::~MQEdit();
This method is a destructor. It is defined as a virtual function.
std::wstring MQEdit::GetText();
It returns a text displayed in the input area.
void MQEdit::SetText(const std::wstring& text);
It specifies a text displayed in the input area.
bool MQEdit::GetReadOnly();
It returns whether to input characters by keys (false) or reject key inputs (true).
void MQEdit::SetReadOnly(bool value);
It returns whether to input characters by keys (false) or reject key inputs (true).
bool MQEdit::GetPassword();
It returns whether characters are displayed as '*' marks or not.
void MQEdit::SetPassword(bool value);
It specifies whether characters are displayed as '*' marks or not.
MQEdit::MQEditTextAlignment MQEdit::GetAlignment();
It returns an alignment for displaying a text.
void MQEdit::SetAlignment(MQEditTextAlignment value);
It specifies an alignment for displaying a text.
MQEdit::MQEditNumericType MQEdit::GetNumeric();
It returns a numeric input mode.
When an integer or a real number is specified, characters except numbers are restricted.
void MQEdit::SetNumeric(MQEditNumericType value);
It specifies a numeric input mode.
When an integer or a real number is specified, characters except numbers are restricted.
int MQEdit::GetMaxLength();
It returns a maximum number of characters.
The number is counted in wide characters. There is no limit when 0 is specified.
void MQEdit::SetMaxLength(int value);
It specifies a maximum number of characters.
The number is counted in wide characters. There is no limit when 0 is specified.
int MQEdit::GetMaxAnsiLength();
It returns a maximum number of characters.
The number is counted in ANSI characters. There is no limit when 0 is specified.
void MQEdit::SetMaxAnsiLength(int value);
It specifies a maximum number of characters.
The number is counted in ANSI characters. There is no limit when 0 is specified.
int MQEdit::GetVisibleColumn();
It returns a number of characters to calculate a proper width.
void MQEdit::SetVisibleColumn(int value);
It specifies a number of characters to calculate a proper width.
When LAYOUT_AUTO in SetHorzLayout() is specified, a width is calculated to contain a specified number of characters. However, a width of a character is different with a proportional font, it is not ensured the specified number of characters are always contained in the width.
void MQEdit::SetFocus(bool value);
It focuses this widget.
When this widget is focused, keyboard messages are notified to this widget.
When other widget has a focus and 'true' is specified, the focus will move from the widget to this.
template<typename T> void MQEdit::AddChangedEvent(T *p, BOOL (T::*f)(MQWidgetBase*, MQDocument), bool prior = false)
It adds events notified when a text has been changed by user's operation.
An event by AddChangingEvent() is invoked when characters are modified by key input, and an event by AddChangedEvent() is invoked when Enter key is pressed or a focus removed by Tab key or a mouse operation.
template<typename T> void MQEdit::AddChangingEvent(T *p, BOOL (T::*f)(MQWidgetBase*, MQDocument), bool prior = false)
It adds events notified when a text is changing by user's operation.
An event by AddChangingEvent() is invoked when characters are modified by key input, and an event by AddChangedEvent() is invoked when Enter key is pressed or a focus removed by Tab key or a mouse operation.