📄 edit.h
字号:
#define EM_LIMITTEXT 0xF0C5
/**
* \def EM_REDO
* \brief Redo operation.
*
* \code
*
* wParam = 0;
* lParam = 0;
* \endcode
*
*/
#define EM_REDO 0xF0C6
/*#define EM_CANUNDO 0xF0C6 */
/**
* \def EM_UNDO
* \brief Undo operation.
*
* \code
*
* wParam = 0;
* lParam = 0;
* \endcode
*
*/
#define EM_UNDO 0xF0C7
/* Not use */
#define EM_FMTLINES 0xF0C8
/* Not use */
#define EM_LINEFROMCHAR 0xF0C9
/* Not use */
#define EM_SETTABSTOPS 0xF0CB
/**
* \def EM_SETPASSWORDCHAR
* \brief Defines the character that edit control uses in conjunction with
* the ES_PASSWORD style.
*
* \code
* EM_SETPASSWORDCHAR
* char passwdChar;
*
* wParam = (WPARAM)passwdChar;
* lParam = 0;
* \endcode
*/
#define EM_SETPASSWORDCHAR 0xF0CC
/* Not use */
#define EM_EMPTYUNDOBUFFER 0xF0CD
/* Not use */
#define EM_GETFIRSTVISIBLELINE 0xF0CE
/**
* \def EM_SETREADONLY
* \brief Sets or removes the read-only style (ES_READONLY) in an edit control.
*
* \code
* EM_SETREADONLY
* int readonly;
*
* wParam = (WPARAM)readonly;
* lParam = 0;
* \endcode
*
* \param readonly Indicates whether the edit control is read-only:
* - Zero\n
* Not read-only.
* - Non zero\n
* Read-only.
*/
#define EM_SETREADONLY 0xF0CF
/**
* \var typedef int (*ED_DRAWSEL_FUNC) (HWND hWnd, HDC hdc, int startx, int starty, const char* content, int len, int selout)
* \brief Type of the edit control callback function on drawing selected strings.
*
* \param hWnd Handle of the edit control.
* \param startx x value of the beginning drawing position.
* \param starty y value of the beginning drawing position.
* \param content The string which will be drawed.
* \param len Length of the string which should be drawed by this callback.
* \param selout Length of the selected string that have been drawed before calling this callback function.
*
* \return Width of the outputed strings.
*/
typedef int (*ED_DRAWSEL_FUNC) (HWND, HDC, int, int, const char*, int, int);
/**
* \def EM_SETDRAWSELECTFUNC
* \brief Sets the callback function on drawing selected chars
*
* \code
* EM_SETDRAWSELECTFUNC
* ED_DRAWSEL_FUNC drawsel;
*
* wParam = 0;
* lParam = (LPARAM)drawsel;
* \endcode
*
* \param drawsel The callback function used to draw selected strings.
*/
#define EM_SETDRAWSELECTFUNC 0xF0D0
/**
* \def EM_SETGETCARETWIDTHFUNC
* \brief Sets the callback function on getting caret width
*
* \code
* EM_SETGETCARETWIDTHFUNC
* int (*get_caret_width) (HWND, int);
*
* wParam = 0;
* lParam = (LPARAM)get_caret_width;
* \endcode
*
* \param get_caret_width The callback function used to get caret width.
* The window handle and the maximum caret width are passed as arguments.
*
* \return The desired caret width.
*/
#define EM_SETGETCARETWIDTHFUNC 0xF0D1
/*
#define EM_SETWORDBREAKPROC 0xF0D0
#define EM_GETWORDBREAKPROC 0xF0D1
*/
/**
* \def EM_GETPASSWORDCHAR
* \brief Returns the character that edit controls uses in conjunction with
* the ES_PASSWORD style.
*
* \code
* EM_GETPASSWORDCHAR
*
* wParam = 0;
* lParam = 0;
* \endcode
*
* \return The currently used password character
*/
#define EM_GETPASSWORDCHAR 0xF0D2
/**
* \def EM_SETLIMITTEXT
* \sa EM_LIMITTEXT
*/
#define EM_SETLIMITTEXT EM_LIMITTEXT
/**
* \def ED_CARETSHAPE_LINE
* \brief Line-shaped caret
*/
#define ED_CARETSHAPE_LINE 0
/**
* \def ED_CARETSHAPE_BLOCK
* \brief Block-shaped caret
*/
#define ED_CARETSHAPE_BLOCK 1
/**
* \def EM_CHANGECARETSHAPE
* \brief Changes the shape of the caret
*
* \code
* EM_CHANGECARETSHAPE
*
* int caret_shape;
*
* wParam = (WPARAM)caret_shape;
* lParam = 0;
* \endcode
*
* \param caret_shape Shape index of the caret, can be ED_CARETSHAPE_LINE or ED_CARETSHAPE_BLOCK.
*
* \return The old create shape
*/
#define EM_CHANGECARETSHAPE 0xF0D3
/**
* \def EM_REFRESHCARET
* \brief Refresh caret of the edit control
*/
#define EM_REFRESHCARET 0xF0D4
/**
* \def EM_ENABLECARET
* \brief To enable or disable the input caret
*
* \code
* EM_ENABLECARET
*
* BOOL bEnable;
*
* wParam = (WPARAM)bEnable;
* lParam = 0;
* \endcode
*
* \param bEnable TRUE to enable caret.
*
* \return The previous caret enabled status.
*/
#define EM_ENABLECARET 0xF0D5
/**
* \def EM_GETLIMITTEXT
* \brief Get text limit value of the edit control.
*
* \return -1 when user doesn't set limit value, otherwise return current
* limit value.
*/
#define EM_GETLIMITTEXT 0xF0D6
/*
#define EM_SETMARGINS 0xF0D3
#define EM_GETMARGINS 0xF0D4
#define EM_POSFROMCHAR 0xF0D6
#define EM_CHARFROMPOS 0xF0D7
#define EM_SETIMESTATUS 0xF0D8
#define EM_GETIMESTATUS 0xF0D9
#define MEM_SCROLLCHANGE 0xF0DB
*/
/* Not use */
#define MED_STATE_YES 0x0
/* Not use */
#define MED_STATE_NOUP 0x1
/* Not use */
#define MED_STATE_NODN 0x2
/* Not use */
#define MED_STATE_NO 0x3
/**
* \def EM_SETTITLETEXT
* \brief Sets the title text displayed before content text.
*
* \code
* EM_SETTITLETEXT
* const char *title;
* int len;
*
* wParam = (WPARAM)len;
* lParam = (LPARAM)title;
* \endcode
*
* \note Implemented for TextEdit control.
*/
#define EM_SETTITLETEXT 0xF0DC
/**
* \def EM_GETTITLETEXT
* \brief Gets the title text displayed before content text.
*
* \code
* EM_GETTITLETEXT
* const char *buffer;
* int len;
*
* wParam = (WPARAM)len;
* lParam = (LPARAM)buffer;
* \endcode
*
* \param len Should be length of buffer minus 1, left space for '\\0'
* \param buffer String buffer
*
*
* \return Length of title
* \note Implemented for TextEdit control.
*/
#define EM_GETTITLETEXT 0xF0DD
/**
* \def EM_SETTIPTEXT
* \brief Sets the tip text displayed when content is empty.
*
* \code
* EM_SETTIPTEXT
* const char *buffer;
* int len;
*
* wParam = (WPARAM)len;
* lParam = (LPARAM)buffer;
* \endcode
*
*/
#define EM_SETTIPTEXT 0xF0DE
/**
* \def EM_GETTIPTEXT
* \brief Gets the tip text displayed when content is empty.
*
* \code
* EM_GETTIPTEXT
* const char *buffer;
* int len;
*
* wParam = (WPARAM)len;
* lParam = (LPARAM)buffer;
* \endcode
*
* \param len Should be length of buffer minus 1, left space for '\\0'
* \param buffer String buffer
*
* \return Length of tip text
*/
#define EM_GETTIPTEXT 0xF0DF
/**
* Structure defines text position information.
*/
typedef struct _TEXTPOSINFO {
/** The index of paragraph, if value is -1,
*it will take effect on the whole text.*/
int paragraph_index;
/** The beginning byte position can be copied to the buffer.*/
int start_pos;
/** The maximal number of bytes can be copied to the buffer.
* It includes terminate character '\0'.*/
int copy_len;
/** The pointer to a buffer receives the text.
*Please make sure buffer size is more than the value of copy_len.*/
char *buff;
}TEXTPOSINFO;
/**
* \def EM_GETNUMOFPARAGRAPHS
* \brief Gets the number of paragraphs in textedit control.
*
* \return The number of paragraphs.
*/
#define EM_GETNUMOFPARAGRAPHS 0xF0E0
/**
* \def EM_GETPARAGRAPHLENGTH
* \brief Gets the specified paragraph length in textedit control.
*
* \code
* EM_GETPARAGRAPHLENGTH
* wParam = (WPARAM) index;
* \endcode
*
* \return The length of text.
*/
#define EM_GETPARAGRAPHLENGTH 0xF0E1
/**
* \def EM_GETPARAGRAPHTEXT
* \brief Gets the specified paragraph text from textedit control.
*
* \code
* EM_GETPARAGRAPHTEXT
* const char buffer[BUF_SIZE];
* TEXTPOSINFO info;
*
* info.start_pos = 0;
* info.copy_len = BUF_SIZE;
* info.buff = buffer;
* info.paragraph_index = -1;
*
* wParam = (WPARAM)&info;
* \endcode
*
* \return The copied length of text which doesn't include terminate
* character '\0'.
*/
#define EM_GETPARAGRAPHTEXT 0xF0E2
#define EM_MSGMAX 0xF0EA
/** @} end of ctrl_edit_msgs */
/**
* \defgroup ctrl_edit_ncs Notification codes of edit control
* @{
*/
#define EN_ERRSPACE 255
/**
* \def EN_CLICKED
* \brief Notifies a click in an edit control.
*
* An edit control sends the EN_CLICKED notification code when the user clicks
* in an edit control.
*/
#define EN_CLICKED 0x0001
/**
* \def EN_DBLCLK
* \brief Notifies a double click in an edit control.
*
* An edit control sends the EN_CLICKED notification code when the user
* double clicks in an edit control.
*/
#define EN_DBLCLK 0x0002
/**
* \def EN_SETFOCUS
* \brief Notifies the receipt of the input focus.
*
* The EN_SETFOCUS notification code is sent when an edit control receives
* the input focus.
*/
#define EN_SETFOCUS 0x0100
/**
* \def EN_KILLFOCUS
* \brief Notifies the lost of the input focus.
*
* The EN_KILLFOCUS notification code is sent when an edit control loses
* the input focus.
*/
#define EN_KILLFOCUS 0x0200
/**
* \def EN_CHANGE
* \brief Notifies that the text is altered by the user.
*
* An edit control sends the EN_CHANGE notification code when the user takes
* an action that may have altered text in an edit control.
*/
#define EN_CHANGE 0x0300
/**
* \def EN_UPDATE
* \brief Notifies that the text is altered by sending MSG_SETTEXT
* TEM_RESETCONTENT, or EM_SETLINEHEIGHT message to it.
*
* An edit control sends the EN_UPDATE notification code when the control
* received MSG_SETTEXT, TEM_RESETCONTENT, or EM_SETLINEHEIGHT message.
*
* Note that this notification will occured when you call SetWindowText or
* SetDlgItemText function on the control.
*/
#define EN_UPDATE 0x0400
/**
* \def EN_MAXTEXT
* \brief Notifies reach of maximum text limitation.
*
* The EN_MAXTEXT notification message is sent when the current text
* insertion has exceeded the specified number of characters for the edit control.
*/
#define EN_MAXTEXT 0x0501
/* Not use */
#define EN_HSCROLL 0x0601
/* Not use */
#define EN_VSCROLL 0x0602
/**
* \def EN_SELCHANGED
* \brief Notifies that the current selection is changed in the text field.
*/
#define EN_SELCHANGED 0x0603
/**
* \def EN_CONTCHANGED
* \brief Notifies that the current content is changed in the text field
* when text edit losts focus.
*/
#define EN_CONTCHANGED 0x0604
/**
* \def EN_ENTER
* \brief Notifies the user has type the ENTER key in a single-line edit control.
*/
#define EN_ENTER 0x0700
/** @} end of ctrl_edit_ncs */
/* Edit control EM_SETMARGIN parameters */
/**
* \def EC_LEFTMARGIN
* \brief Value of wParam. Specifies the margins to set.
*/
#define EC_LEFTMARGIN 0x0001
/**
* \def EC_RIGHTMARGIN
* \brief Value of wParam. Specifies the margins to set.
*/
#define EC_RIGHTMARGIN 0x0002
/**
* \def EC_USEFONTINFO
* \brief Value of wParam. Specifies the margins to set.
*/
#define EC_USEFONTINFO 0xffff
/* wParam of EM_GET/SETIMESTATUS */
/**
* \def EMSIS_COMPOSITIONSTRING
* \brief Indicates the type of status to retrieve.
*/
#define EMSIS_COMPOSITIONSTRING 0x0001
/* lParam for EMSIS_COMPOSITIONSTRING */
/**
* \def EIMES_GETCOMPSTRATONCE
* \brief lParam for EMSIS_COMPOSITIONSTRING.
*/
#define EIMES_GETCOMPSTRATONCE 0x0001
/**
* \def EIMES_CANCELCOMPSTRINFOCUS
* \brief lParam for EMSIS_COMPOSITIONSTRING.
*/
#define EIMES_CANCELCOMPSTRINFOCUS 0x0002
/**
* \def EIMES_COMPLETECOMPSTRKILLFOCUS
* \brief lParam for EMSIS_COMPOSITIONSTRING.
*/
#define EIMES_COMPLETECOMPSTRKILLFOCUS 0x0004
/** @} end of ctrl_edit */
/** @} end of controls */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* _MGUI_CTRL_EDIT_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -