📄 edit.h
字号:
/** * \file edit.h * \author Wei Yongming <ymwei@minigui.org> * \date 2001/12/29 * \verbatim Copyright (C) 2002-2005 Feynman Software. Copyright (C) 1998-2002 Wei Yongming. This file is part of MiniGUI, a compact cross-platform Graphics User Interface (GUI) support system for real-time embedded systems. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA If you are using MiniGUI for developing commercial, proprietary, or other software not covered by the GPL terms, you must have a commercial license for MiniGUI. Please see http://www.minigui.com/product/index.html for how to obtain this. If you are interested in the commercial MiniGUI licensing, please write to sales@minigui.com. \endverbatim *//* * $Id: edit.h,v 1.4 2005/02/15 05:00:08 weiym Exp $ * * MiniGUI for Linux/uClinux, eCos, uC/OS-II, VxWorks, * and ThreadX version 1.6.x * Copyright (C) 2002-2005 Feynman Software. * Copyright (C) 1999-2002 Wei Yongming. */#ifndef _MGUI_CTRL_EDIT_H#define _MGUI_CTRL_EDIT_H #ifdef __cplusplusextern "C" {#endif /* __cplusplus */ /** * \addtogroup controls * @{ */ /** * \defgroup ctrl_edit Edit/MEdit control * * \bug You can not pass caption argument for multi-line edit control * when you create it, just use null string: * * \code * CreateWindowEx (CTRL_MEDIT, ..., "", ...); * \endcode * * @{ *//** * \def CTRL_EDIT * \brief The class name of simple single-line editor box. * * This edit control uses the system default fixed logical font. */#define CTRL_EDIT ("edit")/** * \def CTRL_SLEDIT * \brief The class name of single-line editor box. * * This edit control uses the system logical font for control, * which may be variable-width font.. */#define CTRL_SLEDIT ("sledit")/** * \def CTRL_MLEDIT * \brief The class name of multiple-line editor box. * * This edit control uses the system logical font for control, * which may be variable-width font.. */#define CTRL_MLEDIT ("mledit")/** * \def CTRL_MEDIT * \brief Another class name of multiple-line editor box. * * This edit control uses the system logical font for control, * which may be variable-width font.. */#define CTRL_MEDIT ("medit")#define CTRL_OLDMEDIT ("oldmedit") /** * \defgroup ctrl_edit_styles Styles of edit control * @{ *//** * \def ES_LEFT * \brief Left-aligns text. */#define ES_LEFT 0x00000000L#define ES_CENTER 0x00000001L#define ES_RIGHT 0x00000002L#define ES_MULTILINE 0x00000004L/** * \def ES_UPPERCASE * \brief Converts all characters to uppercase as they are typed into the edit control. */#define ES_UPPERCASE 0x00000008L/** * \def ES_LOWERCASE * \brief Converts all characters to lowercase as they are typed into the edit control. */#define ES_LOWERCASE 0x00000010L/** * \def ES_PASSWORD * \brief Displays an asterisk (*) for each character typed into the edit control. */#define ES_PASSWORD 0x00000020L#define ES_AUTOVSCROLL 0x00000040L#define ES_AUTOHSCROLL 0x00000080L/** * \def ES_NOHIDESEL * \brief Edit control with this style will remain selected when focus is lost */#define ES_NOHIDESEL 0x00000100L/** * \def ES_AUTOSELECT * \brief Selects all text when getting focus */#define ES_AUTOSELECT 0x00000400L//#define ES_OEMCONVERT 0x00000400L/** * \def ES_READONLY * \brief Prevents the user from typing or editing text in the edit control. */#define ES_READONLY 0x00000800L/** * \def ES_BASELINE * \brief Draws base line under input area instead of frame border. */#define ES_BASELINE 0x00001000L/** * \def ES_AUTOWRAP * \brief Automatically wraps against border when inputting. */#define ES_AUTOWRAP 0x00002000L/** * \def ES_TITLE * \brief Shows specified title texts. */#define ES_TITLE 0x00004000L/** * \def ES_TIP * \brief Shows specified tip texts. */#define ES_TIP 0x00008000L /** @} end of ctrl_edit_styles */ /** * \defgroup ctrl_edit_msgs Messages of edit control * @{ *//** * \def EM_GETSEL * \brief Gets the selected string in the edit control. * * \code * EM_GETSEL * * char *buffer; * int len; * * wParam = len; * lParam = (LPARAM)buffer; * \endcode * * \param len Length of buffer. * \param buffer Pointer to the string buffer * * \return length of the selected string */#define EM_GETSEL 0xF0B0/** * \def EM_SETSEL * \brief 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. * * \code * EM_SETSEL * * int line_pos; * int char_pos; * * wParam = (WPARAM)line_pos; * lParam = (LPARAM)char_pos; * \endcode * * \param line_pos line 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. * \param char_pos character(wide character) position of the selection point. * * \return length of the selected string */#define EM_SETSEL 0xF0B1#define EM_SETSELECTION EM_SETSEL/** * \def EM_SELECTALL * \brief Selects all the texts, the same meaning as ctrl+a * * \code * EM_SELECTALL * * wParam = 0; * lParam = 0; * \endcode */#define EM_SELECTALL 0xF0B2/** * \def EM_GETSELPOS * \brief Gets the position of the selection point. * * \code * EM_GETSELPOS * int* line_pos; * int* char_pos; * * wParam = (WPARAM)line_pos; * lParam = (LPARAM)char_pos; * \endcode * * \param line_pos Pointer 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. * \param char_pos Pointer to a integer buffer to save the selection character position. * * \return The string length of the text from the beginning to the selection point. */#define EM_GETSELPOS 0xF0B3/** * \def EM_INSERTCBTEXT * \brief Inserts the text in the clipboard to the current caret position * * \code * EM_INSERTCBTEXT * int len; * const char *string; * * wParam = len; * lParam = (LPARAM)string; * \endcode * * \param len Length of string * \param string Pointer to the text string */#define EM_INSERTCBTEXT 0xF0B4/** * \def EM_COPYTOCB * \brief Copies the currently selected text to the clipboard * * \code * EM_COPYTOCB * * wParam = 0; * lParam = 0 * \endcode * * \return Length of the text which is really copied to clipboard. */#define EM_COPYTOCB 0xF0B5/** * \def EM_CUTTOCB * \brief Cuts the currently selected text to the clipboard * * \code * EM_CUTTOCB * * wParam = 0; * lParam = 0 * \endcode * * \return Length of the text which is really copied to clipboard. */#define EM_CUTTOCB 0xF0B6/** * \def EM_SETLFDISPCHAR * \brief 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. * * \code * EM_SETLFDISPCHAR * unsigned char ch; * * wParam = 0; * lParam = ch; * \endcode * * \param ch the char used to represent the line seperator */#define EM_SETLFDISPCHAR 0xF0B7/** * \def EM_SETLINESEP * \brief Sets the line seperator. * * In default case, the line sperator is '\n'. * * \code * EM_SETLINESEP * unsigned char ch; * * wParam = 0; * lParam = ch; * \endcode * * \param ch the new line seperator */#define EM_SETLINESEP 0xF0B8//#define EM_GETRECT 0xF0B2//#define EM_SETRECT 0xF0B3//#define EM_SETRECTNP 0xF0B4//#define EM_SCROLL 0xF0B5/** * \def EM_GETCARETPOS * \brief Gets the position of the caret. * * \code * EM_GETCARETPOS * int* line_pos; * int* char_pos; * * wParam = (WPARAM)line_pos; * lParam = (LPARAM)char_pos; * \endcode * * \param line_pos Pointer 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. * \param char_pos Pointer to a integer buffer to save the caret character position. * * \return The string length of the text from the beginning to the caret pos. */#define EM_GETCARETPOS 0xF0B9/** * \def EM_SETCARETPOS * \brief Sets the position of the caret. * * \code * EM_SETCARETPOS * int line_pos; * int char_pos; * * wParam = (WPARAM)line_pos; * lParam = (LPARAM)char_pos; * \endcode * * \param line_pos The 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. * \param char_pos The new caret character position. * * \return length of the string from the beginning to the caret position * on success, otherwise -1. */#define EM_SETCARETPOS 0xF0BA#define EM_SETINSERTION EM_SETCARETPOS//#define EM_SCROLLCARET 0xF0B9//#define EM_GETMODIFY 0xF0BA//#define EM_SETMODIFY 0xF0BB/** * \def EM_GETLINECOUNT * \brief Gets the line number. * * \code * EM_GETLINECOUNT * * wParam = 0; * lParam = 0; * \endcode * * \return Line number on success, otherwise -1. * \note Implemented for TextEdit control. */#define EM_GETLINECOUNT 0xF0BC/** * \def EM_GETLINEHEIGHT * \brief Gets the height of a line. * * \code * EM_GETLINEHEIGHT * * wParam = 0; * lParam = 0; * \endcode * * \return Height value. * \note Implemented for TextEdit control. */#define EM_GETLINEHEIGHT 0xF0BD/** * \def EM_SETLINEHEIGHT * \brief Sets the height of a line. * * \code * EM_SETLINEHEIGHT * * wParam = height; * lParam = 0; * \endcode * * \return the old height value. * \note Implemented for TextEdit control. */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -