MiniGUI API Reference (MiniGUI-Standalone)  v3.2.0
A mature and proven cross-platform GUI system for embedded and smart IoT devices
Data Structures | Macros | Typedefs
Messages of edit control

Data Structures

struct  _TEXTPOSINFO
 

Macros

#define EM_GETSEL   0xF0B0
 Gets the selected string in the edit control. More...
 
#define EM_SETSEL   0xF0B1
 Sets the selected point in the edit control and makes the text between insertion point and selection point selected. More...
 
#define EM_SETSELPOS   EM_SETSEL
 
#define EM_SETSELECTION   EM_SETSEL
 
#define EM_SELECTALL   0xF0B2
 Selects all the texts, the same meaning as ctrl+a. More...
 
#define EM_GETSELPOS   0xF0B3
 Gets the position of the selection point. More...
 
#define EM_INSERTCBTEXT   0xF0B4
 Inserts the text in the clipboard to the current caret position. More...
 
#define EM_COPYTOCB   0xF0B5
 Copies the currently selected text to the clipboard. More...
 
#define EM_CUTTOCB   0xF0B6
 Cuts the currently selected text to the clipboard. More...
 
#define EM_SETLFDISPCHAR   0xF0B7
 Sets the char used to represent the line seperator. More...
 
#define EM_SETLINESEP   0xF0B8
 Sets the line seperator. More...
 
#define EM_GETCARETPOS   0xF0B9
 Gets the position of the caret. More...
 
#define EM_SETCARETPOS   0xF0BA
 Sets the position of the caret. More...
 
#define EM_SETINSERTION   EM_SETCARETPOS
 
#define EM_GETLINECOUNT   0xF0BC
 Gets the line number. More...
 
#define EM_GETLINEHEIGHT   0xF0BD
 Gets the height of a line. More...
 
#define EM_SETLINEHEIGHT   0xF0BE
 Sets the height of a line. More...
 
#define EM_LINESCROLL   0xF0BF
 reserved. More...
 
#define EM_INSERTTEXT   0xF0C0
 Inserts the specified text to the current caret position. More...
 
#define EM_LINELENGTH   0xF0C1
 reserved. More...
 
#define EM_REPLACESEL   0xF0C2
 reserved. More...
 
#define EM_GETMAXLIMIT   0xF0C3
 Get text limit of a single-line edit control. More...
 
#define EM_GETLINE   0xF0C4
 reserved. More...
 
#define EM_LIMITTEXT   0xF0C5
 Set text limit of an edit control. More...
 
#define EM_REDO   0xF0C6
 Redo operation. More...
 
#define EM_UNDO   0xF0C7
 Undo operation. More...
 
#define EM_FMTLINES   0xF0C8
 reserved. More...
 
#define EM_LINEFROMCHAR   0xF0C9
 reserved. More...
 
#define EM_SETTABSTOPS   0xF0CB
 reserved. More...
 
#define EM_SETPASSWORDCHAR   0xF0CC
 Defines the character that edit control uses in conjunction with the ES_PASSWORD style. More...
 
#define EM_SETREADONLY   0xF0CF
 Sets or removes the read-only style (ES_READONLY) in an edit control. More...
 
#define EM_SETDRAWSELECTFUNC   0xF0D0
 Sets the callback function on drawing selected chars. More...
 
#define EM_SETGETCARETWIDTHFUNC   0xF0D1
 Sets the callback function on getting caret width. More...
 
#define EM_GETPASSWORDCHAR   0xF0D2
 Returns the character that edit controls uses in conjunction with the ES_PASSWORD style. More...
 
#define EM_SETLIMITTEXT   EM_LIMITTEXT
 
#define ED_CARETSHAPE_LINE   0
 Line-shaped caret. More...
 
#define ED_CARETSHAPE_BLOCK   1
 Block-shaped caret. More...
 
#define EM_CHANGECARETSHAPE   0xF0D3
 Changes the shape of the caret. More...
 
#define EM_REFRESHCARET   0xF0D4
 Refresh caret of the edit control. More...
 
#define EM_ENABLECARET   0xF0D5
 To enable or disable the input caret. More...
 
#define EM_GETLIMITTEXT   0xF0D6
 Get text limit value of the edit control. More...
 
#define EM_SETTITLETEXT   0xF0DC
 Sets the title text displayed before content text. More...
 
#define EM_GETTITLETEXT   0xF0DD
 Gets the title text displayed before content text. More...
 
#define EM_SETTIPTEXT   0xF0DE
 Sets the tip text displayed when content is empty. More...
 
#define EM_GETTIPTEXT   0xF0DF
 Gets the tip text displayed when content is empty. More...
 
#define EM_GETNUMOFPARAGRAPHS   0xF0E0
 Gets the number of paragraphs in textedit control. More...
 
#define EM_GETPARAGRAPHLENGTH   0xF0E1
 Gets the specified paragraph length in textedit control. More...
 
#define EM_GETPARAGRAPHTEXT   0xF0E2
 Gets the specified paragraph text from textedit control. More...
 
#define EM_SETCARETPOSBYLINE   0xF0D9
 Sets the selected point in the edit control and makes the text between insertion point and selection point selected. This is set by really line. That means if you set the TES_AUTOWRAP, the line number you set, the caret pos line number you see. This is different from EM_SETCARETPOS. More...
 
#define EM_GETCARETPOSBYLINE   0xF0DA
 Gets the position of the caret. More...
 
#define EM_SETSELPOSBYLINE   0xF0DB
 
#define EM_GETSELPOSBYLINE   0xF0E4
 Gets the position of the selection point. More...
 
#define EM_GETPARAGRAPHLENGTHINMCHAR   0xF0E5
 Gets the specified paragraph length in textedit control. in text not charactors. More...
 
#define EM_GETLINELENGTHINMCHAR   0xF0E6
 Gets the specified line length in textedit control. in charactors not byte. More...
 
#define EM_GETLINELENGTH   0xF0E7
 Gets the specified line length in textedit control. More...
 
#define EM_GETLINETEXT   0xF0E8
 Gets the specified line text from textedit control. More...
 

Typedefs

typedef int(* ED_DRAWSEL_FUNC) (HWND, HDC, int, int, const char *, int, int)
 Type of the edit control callback function on drawing selected strings. More...
 
typedef struct _TEXTPOSINFO TEXTPOSINFO
 

Detailed Description

Macro Definition Documentation

#define ED_CARETSHAPE_BLOCK   1

Block-shaped caret.

Definition at line 776 of file edit.h.

#define ED_CARETSHAPE_LINE   0

Line-shaped caret.

Definition at line 770 of file edit.h.

#define EM_CHANGECARETSHAPE   0xF0D3

Changes the shape of the caret.

1 EM_CHANGECARETSHAPE
2 
3 int caret_shape;
4 
5 wParam = (WPARAM)caret_shape;
6 lParam = 0;
Parameters
caret_shapeShape index of the caret, can be ED_CARETSHAPE_LINE or ED_CARETSHAPE_BLOCK.
Returns
The old create shape

Definition at line 795 of file edit.h.

#define EM_COPYTOCB   0xF0B5

Copies the currently selected text to the clipboard.

1 EM_COPYTOCB
2 
3 wParam = 0;
4 lParam = 0
Returns
Length of the text which is really copied to clipboard.

Definition at line 352 of file edit.h.

#define EM_CUTTOCB   0xF0B6

Cuts the currently selected text to the clipboard.

1 EM_CUTTOCB
2 
3 wParam = 0;
4 lParam = 0
Returns
Length of the text which is really copied to clipboard.

Definition at line 367 of file edit.h.

#define EM_ENABLECARET   0xF0D5

To enable or disable the input caret.

1 EM_ENABLECARET
2 
3 BOOL bEnable;
4 
5 wParam = (WPARAM)bEnable;
6 lParam = 0;
Parameters
bEnableTRUE to enable caret.
Returns
The previous caret enabled status.

Definition at line 820 of file edit.h.

#define EM_FMTLINES   0xF0C8

reserved.

Definition at line 630 of file edit.h.

#define EM_GETCARETPOS   0xF0B9

Gets the position of the caret.

1 EM_GETCARETPOS
2 int* line_pos;
3 int* char_pos;
4 
5 wParam = (WPARAM)line_pos;
6 lParam = (LPARAM)char_pos;
Parameters
line_posPointer to a integer buffer to save the caret line position. For single line editor, it is always zero. Note : Here "line" means a text string ended with a line seperator, not a single text line in wrap mode. So, char_pos means the character position in a text string.
char_posPointer to a integer buffer to save the caret character position.
Returns
The string length of the text from the beginning to the caret pos.

Definition at line 435 of file edit.h.

#define EM_GETCARETPOSBYLINE   0xF0DA

Gets the position of the caret.

1 EM_GETCARETPOSBYLINE
2 int* line_pos;
3 int* char_pos;
4 
5 wParam = (WPARAM)line_pos;
6 lParam = (LPARAM)char_pos;
Parameters
line_posPointer to a integer buffer to save the caret line position. For single line editor, it is always zero.
char_posPointer to a integer buffer to save the caret character position.
Returns
The string length of the text from the beginning to the caret pos.

Definition at line 1094 of file edit.h.

#define EM_GETLIMITTEXT   0xF0D6

Get text limit value of the edit control.

Returns
-1 when user doesn't set limit value, otherwise return current limit value.

Definition at line 829 of file edit.h.

#define EM_GETLINE   0xF0C4

reserved.

Definition at line 579 of file edit.h.

#define EM_GETLINECOUNT   0xF0BC

Gets the line number.

1 EM_GETLINECOUNT
2 
3 wParam = 0;
4 lParam = 0;
Returns
Line number on success, otherwise -1.
Note
Implemented for TextEdit control.

Definition at line 485 of file edit.h.

#define EM_GETLINEHEIGHT   0xF0BD

Gets the height of a line.

1 EM_GETLINEHEIGHT
2 
3 wParam = 0;
4 lParam = 0;
Returns
Height value.
Note
Implemented for TextEdit control.

Definition at line 501 of file edit.h.

#define EM_GETLINELENGTH   0xF0E7

Gets the specified line length in textedit control.

1 EM_GETLINELENGTH
2 wParam = (WPARAM) index;
Returns
The length of text.

Definition at line 1162 of file edit.h.

#define EM_GETLINELENGTHINMCHAR   0xF0E6

Gets the specified line length in textedit control. in charactors not byte.

1 EM_GETLINELENGTHINMCHAR
2 wParam = (WPARAM) index;
Returns
The length of text.

Definition at line 1149 of file edit.h.

#define EM_GETLINETEXT   0xF0E8

Gets the specified line text from textedit control.

1 EM_GETLINETEXT
2 const char buffer[BUF_SIZE];
3 TEXTPOSINFO info;
4 
5 info.start_pos = 0;
6 info.copy_len = BUF_SIZE;
7 info.buff = buffer;
8 info.line_index = -1;
9 
10 wParam = (WPARAM)&info;
Returns
The copied length of text which doesn't include terminate character 0x0.

Definition at line 1184 of file edit.h.

#define EM_GETMAXLIMIT   0xF0C3

Get text limit of a single-line edit control.

Definition at line 571 of file edit.h.

#define EM_GETNUMOFPARAGRAPHS   0xF0E0

Gets the number of paragraphs in textedit control.

Returns
The number of paragraphs.

Definition at line 997 of file edit.h.

#define EM_GETPARAGRAPHLENGTH   0xF0E1

Gets the specified paragraph length in textedit control.

1 EM_GETPARAGRAPHLENGTH
2 wParam = (WPARAM) index;
Returns
The length of text.

Definition at line 1009 of file edit.h.

#define EM_GETPARAGRAPHLENGTHINMCHAR   0xF0E5

Gets the specified paragraph length in textedit control. in text not charactors.

1 EM_GETPARAGRAPHLENGTHINCHAR
2 wParam = (WPARAM) index;
Returns
The length of text.

Definition at line 1135 of file edit.h.

#define EM_GETPARAGRAPHTEXT   0xF0E2

Gets the specified paragraph text from textedit control.

1 EM_GETPARAGRAPHTEXT
2 const char buffer[BUF_SIZE];
3 TEXTPOSINFO info;
4 
5 info.start_pos = 0;
6 info.copy_len = BUF_SIZE;
7 info.buff = buffer;
8 info.paragraph_index = -1;
9 
10 wParam = (WPARAM)&info;
Returns
The copied length of text which doesn't include terminate character 0x0.

Definition at line 1030 of file edit.h.

#define EM_GETPASSWORDCHAR   0xF0D2

Returns the character that edit controls uses in conjunction with the ES_PASSWORD style.

1 EM_GETPASSWORDCHAR
2 
3 wParam = 0;
4 lParam = 0;
Returns
The currently used password character

Definition at line 758 of file edit.h.

#define EM_GETSEL   0xF0B0

Gets the selected string in the edit control.

1 EM_GETSEL
2 
3 char *buffer;
4 int len;
5 
6 wParam = (WPARAM)len;
7 lParam = (LPARAM)buffer;
Parameters
lenLength of buffer.
bufferPointer to the string buffer
Returns
Length of the selected string

Definition at line 241 of file edit.h.

#define EM_GETSELPOS   0xF0B3

Gets the position of the selection point.

1 EM_GETSELPOS
2 int* line_pos;
3 int* char_pos;
4 
5 wParam = (WPARAM)line_pos;
6 lParam = (LPARAM)char_pos;
Parameters
line_posPointer to a integer buffer to save the selection line position. For single line editor, it is always zero. Note : Here "line" means a text string ended with a line seperator, not a single text line in wrap mode. So, char_pos means the character position in a text string.
char_posPointer to a integer buffer to save the selection character position.
Returns
The string length of the text from the beginning to the selection point.

Definition at line 319 of file edit.h.

#define EM_GETSELPOSBYLINE   0xF0E4

Gets the position of the selection point.

1 EM_GETSELPOSBYLINE
2 int* line_pos;
3 int* char_pos;
4 
5 wParam = (WPARAM)line_pos;
6 lParam = (LPARAM)char_pos;
Parameters
line_posPointer to a integer buffer to save the selection line position. For single line editor, it is always zero.
char_posPointer to a integer buffer to save the selection character position.
Returns
The string length of the text from the beginning to the selection point.

Definition at line 1121 of file edit.h.

#define EM_GETTIPTEXT   0xF0DF

Gets the tip text displayed when content is empty.

1 EM_GETTIPTEXT
2 const char *buffer;
3 int len;
4 
5 wParam = (WPARAM)len;
6 lParam = (LPARAM)buffer;
Parameters
lenShould be length of buffer minus 1, left space for '\0'
bufferString buffer
Returns
Length of tip text

Definition at line 969 of file edit.h.

#define EM_GETTITLETEXT   0xF0DD

Gets the title text displayed before content text.

1 EM_GETTITLETEXT
2 const char *buffer;
3 int len;
4 
5 wParam = (WPARAM)len;
6 lParam = (LPARAM)buffer;
Parameters
lenShould be length of buffer minus 1, left space for '\0'
bufferString buffer
Returns
Length of title
Note
Implemented for TextEdit control.

Definition at line 933 of file edit.h.

#define EM_INSERTCBTEXT   0xF0B4

Inserts the text in the clipboard to the current caret position.

1 EM_INSERTCBTEXT
2 int len;
3 const char *string;
4 
5 wParam = (WPARAM)len;
6 lParam = (LPARAM)string;
Parameters
lenLength of string
stringPointer to the text string

Definition at line 337 of file edit.h.

#define EM_INSERTTEXT   0xF0C0

Inserts the specified text to the current caret position.

Normally used to input a long string.

1 EM_INSERTTEXT
2 int len;
3 const char *string;
4 
5 wParam = (WPARAM)len;
6 lParam = (LPARAM)string;
Parameters
lenLength of string
stringPointer to the text string

Definition at line 549 of file edit.h.

#define EM_LIMITTEXT   0xF0C5

Set text limit of an edit control.

1 EM_LIMITTEXT
2 int newLimit;
3 
4 wParam = (WPARAM)newLimit;
5 lParam = 0;
Parameters
newLimitThe new text limit of an edit control, by character.

Definition at line 595 of file edit.h.

#define EM_LINEFROMCHAR   0xF0C9

reserved.

Definition at line 638 of file edit.h.

#define EM_LINELENGTH   0xF0C1

reserved.

Definition at line 557 of file edit.h.

#define EM_LINESCROLL   0xF0BF

reserved.

Definition at line 529 of file edit.h.

#define EM_REDO   0xF0C6

Redo operation.

1 wParam = 0;
2 lParam = 0;

Definition at line 608 of file edit.h.

#define EM_REFRESHCARET   0xF0D4

Refresh caret of the edit control.

Definition at line 801 of file edit.h.

#define EM_REPLACESEL   0xF0C2

reserved.

Definition at line 565 of file edit.h.

#define EM_SELECTALL   0xF0B2

Selects all the texts, the same meaning as ctrl+a.

1 EM_SELECTALL
2 
3 wParam = 0;
4 lParam = 0;

Definition at line 295 of file edit.h.

#define EM_SETCARETPOS   0xF0BA

Sets the position of the caret.

1 EM_SETCARETPOS
2 int line_pos;
3 int char_pos;
4 
5 wParam = (WPARAM)line_pos;
6 lParam = (LPARAM)char_pos;
Parameters
line_posThe new caret line position. For single line editor, it will be ignored. Note : Here "line" means a text string ended with a line seperator, not a single text line in wrap mode. So, char_pos means the character position in a text string.
char_posThe new caret character position.
Returns
Length of the string from the beginning to the caret position on success, otherwise -1.

Definition at line 459 of file edit.h.

#define EM_SETCARETPOSBYLINE   0xF0D9

Sets the selected point in the edit control and makes the text between insertion point and selection point selected. This is set by really line. That means if you set the TES_AUTOWRAP, the line number you set, the caret pos line number you see. This is different from EM_SETCARETPOS.

1 EM_SETCARETPOSBYLINE
2 
3 int line_pos;
4 int char_pos;
5 
6 wParam = (WPARAM)line_pos;
7 lParam = (LPARAM)char_pos;
Parameters
line_posLine position of the selection point. For single line editor, it is always zero. Note : For multi-line editor, "line" means a text string ended with a line seperator, in wrap mode there also is the really line number. So, char_pos means the character position in a text string.
char_posCharacter(wide character) position of the selection point.
Returns
Length of the selected string

Definition at line 1072 of file edit.h.

#define EM_SETDRAWSELECTFUNC   0xF0D0

Sets the callback function on drawing selected chars.

1 EM_SETDRAWSELECTFUNC
2 ED_DRAWSEL_FUNC drawsel;
3 
4 wParam = 0;
5 lParam = (LPARAM)drawsel;
Parameters
drawselThe callback function used to draw selected strings.

Definition at line 718 of file edit.h.

#define EM_SETGETCARETWIDTHFUNC   0xF0D1

Sets the callback function on getting caret width.

1 EM_SETGETCARETWIDTHFUNC
2 int (*get_caret_width) (HWND, int);
3 
4 wParam = 0;
5 lParam = (LPARAM)get_caret_width;
Parameters
get_caret_widthThe callback function used to get caret width. The window handle and the maximum caret width are passed as arguments.
Returns
The desired caret width.

Definition at line 737 of file edit.h.

#define EM_SETINSERTION   EM_SETCARETPOS
See also
EM_SETCARETPOS

Definition at line 465 of file edit.h.

#define EM_SETLFDISPCHAR   0xF0B7

Sets the char used to represent the line seperator.

In default case, the line sperator will not be shown. If the char used to represent the line seperator is not zero, this char will be shown in place of line seperator.

1 EM_SETLFDISPCHAR
2 unsigned char ch;
3 
4 wParam = 0;
5 lParam = ch;
Parameters
chThe char used to represent the line seperator

Definition at line 387 of file edit.h.

#define EM_SETLIMITTEXT   EM_LIMITTEXT
See also
EM_LIMITTEXT

Definition at line 764 of file edit.h.

#define EM_SETLINEHEIGHT   0xF0BE

Sets the height of a line.

1 EM_SETLINEHEIGHT
2 
3 wParam = (WPARAM)height;
4 lParam = 0;
Returns
The old height value.
Note
Implemented for TextEdit control.

Definition at line 517 of file edit.h.

#define EM_SETLINESEP   0xF0B8

Sets the line seperator.

In default case, the line sperator is Line Feed characters(LF , ASCII 10, '
').

1 EM_SETLINESEP
2 unsigned char ch;
3 
4 wParam = 0;
5 lParam = ch;
Parameters
chThe new line seperator

Definition at line 406 of file edit.h.

#define EM_SETPASSWORDCHAR   0xF0CC

Defines the character that edit control uses in conjunction with the ES_PASSWORD style.

1 EM_SETPASSWORDCHAR
2 char passwdChar;
3 
4 wParam = (WPARAM)passwdChar;
5 lParam = 0;

Definition at line 661 of file edit.h.

#define EM_SETREADONLY   0xF0CF

Sets or removes the read-only style (ES_READONLY) in an edit control.

1 EM_SETREADONLY
2 int readonly;
3 
4 wParam = (WPARAM)readonly;
5 lParam = 0;
Parameters
readonlyIndicates whether the edit control is read-only:
  • Zero
    Not read-only.
  • Non zero
    Read-only.

Definition at line 686 of file edit.h.

#define EM_SETSEL   0xF0B1

Sets the selected point in the edit control and makes the text between insertion point and selection point selected.

Generally, you should send EM_SETCARETPOS first to set insertion point before you use EM_SETSEL to select text.

1 EM_SETSEL
2 
3 int line_pos;
4 int char_pos;
5 
6 wParam = (WPARAM)line_pos;
7 lParam = (LPARAM)char_pos;
Parameters
line_posLine position of the selection point. For single line editor, it is always zero. Note : For multi-line editor, "line" means a text string ended with a line seperator, not a single text line in wrap mode. So, char_pos means the character position in a text string.
char_posCharacter(wide character) position of the selection point.
Returns
Length of the selected string

Definition at line 270 of file edit.h.

#define EM_SETSELECTION   EM_SETSEL
See also
EM_SETSEL

Definition at line 282 of file edit.h.

#define EM_SETSELPOS   EM_SETSEL
See also
EM_SETSEL

Definition at line 276 of file edit.h.

#define EM_SETSELPOSBYLINE   0xF0DB
See also
EM_SETSELBYLINE

Definition at line 1100 of file edit.h.

#define EM_SETTABSTOPS   0xF0CB

reserved.

Definition at line 646 of file edit.h.

#define EM_SETTIPTEXT   0xF0DE

Sets the tip text displayed when content is empty.

1 EM_SETTIPTEXT
2 const char *buffer;
3 int len;
4 
5 wParam = (WPARAM)len;
6 lParam = (LPARAM)buffer;

Definition at line 949 of file edit.h.

#define EM_SETTITLETEXT   0xF0DC

Sets the title text displayed before content text.

1 EM_SETTITLETEXT
2 const char *title;
3 int len;
4 
5 wParam = (WPARAM)len;
6 lParam = (LPARAM)title;
Note
Implemented for TextEdit control.

Definition at line 911 of file edit.h.

#define EM_UNDO   0xF0C7

Undo operation.

1 wParam = 0;
2 lParam = 0;

Definition at line 622 of file edit.h.

Typedef Documentation

typedef int(* ED_DRAWSEL_FUNC)(HWND hWnd, HDC hdc, int startx, int starty, const char *content, int len, int selout)

Type of the edit control callback function on drawing selected strings.

Parameters
hWndHandle of the edit control.
startxx value of the beginning drawing position.
startyy value of the beginning drawing position.
contentThe string which will be drawed.
lenLength of the string which should be drawed by this callback.
seloutLength of the selected string that have been drawed before calling this callback function.
Returns
Width of the outputed strings.

Definition at line 701 of file edit.h.

typedef struct _TEXTPOSINFO TEXTPOSINFO

Structure defines text position information.