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
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
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
GetEnterSelect Get an automatic text selection on entering mouse
SetEnterSelect Set an automatic text selection on entering mouse
GetEnterKeyDefault Get a default button procedure by Enter key
SetEnterKeyDefault Set a default button procedure by Enter key
SetFocus Set a focus
SelectAll Select all text
SelectRange Select text in specified range
GetSelectedRange Get a selected range of text
CutSelection Cut a selected text
CopySelection Copy a selected text
PasteFromClipboard Paste a text
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.


std::wstring MQEdit::GetFontName();

Return value
Font name

It returns a font name for displaying a text.


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

value
Font name

It specifies a font name for displaying a text.


bool MQEdit::GetFontBold();

Return value
Bold font

It returns whether a displayed font is bold or not.


void MQEdit::SetFontBold(bool value);

value
Bold font

It specifies whether a displayed font is bold or not.


double MQEdit::GetFontScale();

Return value
Font scaling

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

A default value is 1.0.


void MQEdit::SetFontScale(double value);

value
Font scaling

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


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.


bool MQEdit::GetEnterSelect();

Return value
Enable or disable automatic text selection

(new in Rev4.64)

It returns whether an automatic text selection is enabled or disabled when a mouse enters this widget.


void MQEdit::SetEnterSelect(bool value);

value
Enable or disable automatic text selection

(new in Rev4.64)

It specified whether to enable or disable an automatic text selection when a mouse enters this widget.


bool MQEdit::GetEnterKeyDefault();

Return value
Enable or disable a default button procedure

(new in Rev4.64)

It returns whether to enable a default button by MQButton::SetDefault() or not when Enter key is pressed.


void MQEdit::SetEnterKeyDefault(bool value);

value
Enable or disable a default button procedure

(new in Rev4.64)

It specified whether to enable a default button by MQButton::SetDefault() or not when Enter key is pressed.


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.


void MQEdit::SelectAll();

(new in Rev4.64)

It selects all text.


void MQEdit::SelectRange(size_t start, size_t end);

start
Start position
end
End position

(new in Rev4.64)

It selected a text in the specified range.


bool MQEdit::GetSelectedRange(size_t& start, size_t& end);

start
Start position (output)
end
End position (output)
Return value
Selected or not

(new in Rev4.64)

It returns a selected range of a text.


void MQEdit::CutSelection();

(new in Rev4.64)

It cuts a text in the selected range, and send to clipboard.


void MQEdit::CopySelection();

(new in Rev4.64)

It copies a text in the selected range to clipboard.


void MQEdit::PasteFromClipboard();

(new in Rev4.64)

It pastes a text from clipboard.


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.