MQEdit class

(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);

id
A widget ID created outside the plug-in

It is a constructor.


virtual MQEdit::~MQEdit();

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


std::wstring MQEdit::GetText();

Return value
A displayed string

It returns a text displayed in the input area.


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

text
A displayed string

It specifies a text displayed in the input area.


bool MQEdit::GetReadOnly();

Return value
Read-only mode

It returns whether to input characters by keys (false) or reject key inputs (true).


void MQEdit::SetReadOnly(bool value);

value
Read-only mode

It returns whether to input characters by keys (false) or reject key inputs (true).


bool MQEdit::GetPassword();

Return value
Password mode

It returns whether characters are displayed as '*' marks or not.


void MQEdit::SetPassword(bool value);

value
Password mode

It specifies whether characters are displayed as '*' marks or not.


MQEdit::MQEditTextAlignment MQEdit::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 MQEdit::SetAlignment(MQEditTextAlignment value);

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

It specifies an alignment for displaying a text.


MQEdit::MQEditNumericType MQEdit::GetNumeric();

Return value
A numeric input mode
[NUMERIC_TEXT] For a text
[NUMERIC_INT] For an integer
[NUMERIC_DOUBLE] For a real number

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);

value
A numeric input mode
[NUMERIC_TEXT] For a text
[NUMERIC_INT] For an integer
[NUMERIC_DOUBLE] For a real number

It specifies a numeric input mode.

When an integer or a real number is specified, characters except numbers are restricted.


int MQEdit::GetMaxLength();

Return value
A maximum number of characters

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);

value
A maximum number of characters

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();

Return value
A maximum number of characters

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);

value
A maximum number of characters

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();

Return value
A number of characters within the width

It returns a number of characters to calculate a proper width.


void MQEdit::SetVisibleColumn(int value);

value
A number of characters within the width

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);

value
A focus status

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)

p
A widget to notify events
f
A member function to notify events
prior
An order to notify events
[true] Notify first
[false] Notify last

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)

p
A widget to notify events
f
A member function to notify events
prior
An order to notify events
[true] Notify first
[false] Notify last

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.