⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 edit.h

📁 minigui 开源代码 非常实用 对学习嵌入式GUI开发有一定的实用的参考价值
💻 H
📖 第 1 页 / 共 2 页
字号:
/**
 * \file edit.h
 * \author Wei Yongming <ymwei@minigui.org>
 * \date 2001/12/29
 * 
 \verbatim

    Copyright (C) 2002-2007 Feynman Software.
    Copyright (C) 1998-2002 Wei Yongming.

    All rights reserved by Feynman Software.

    This file is part of MiniGUI, a compact cross-platform Graphics 
    User Interface (GUI) support system for real-time embedded systems.

 \endverbatim
 */

/*
 * $Id: edit.h 7941 2007-10-24 05:13:29Z xwyan $
 *
 *             MiniGUI for Linux/uClinux, eCos, uC/OS-II, VxWorks, 
 *                     pSOS, ThreadX, NuCleus, OSE, and Win32.
 *
 *             Copyright (C) 2002-2007 Feynman Software.
 *             Copyright (C) 1999-2002 Wei Yongming.
 */

#ifndef _MGUI_CTRL_EDIT_H
#define _MGUI_CTRL_EDIT_H
 
#ifdef __cplusplus
extern "C" {
#endif  /* __cplusplus */

    /**
     * \addtogroup controls
     * @{
     */

    /**
     * \defgroup ctrl_edit Edit/MEdit control
     *
     * @{
     */

/**
 * \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")

    /**
     * \defgroup ctrl_edit_styles Styles of edit control
     * @{
     */

/**
 * \def ES_LEFT
 * \brief Left-aligned text.
 */
#define ES_LEFT             0x00000000L

/**
 * \def ES_CENTER
 * \brief Center-aligned text.
 */
#define ES_CENTER           0x00000001L

/**
 * \def ES_RIGHT
 * \brief Right-aligned text.
 */
#define ES_RIGHT            0x00000002L

/**
 * \def ES_MULTILINE
 * \brief Multi-line text.
 */
#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

/* Not use */
#define ES_AUTOVSCROLL      0x00000040L
/* Not use */
#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 = (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

/**
 * \def EM_SETSELECTION
 * \sa EM_SETSEL
 */
#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 = (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

/**
 * \def EM_SETINSERTION
 * \sa EM_SETCARETPOS
 */
#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 = (WPARAM)height;
 * lParam = 0;
 * \endcode
 *
 * \return The old height value.
 * \note Implemented for TextEdit control.
 */
#define EM_SETLINEHEIGHT        0xF0BE


/*#define EM_LINEINDEX            0xF0BD */
/*#define EM_GETTHUMB             0xF0BE */

/* internal used now */
#define EM_LINESCROLL           0xF0BF
 
/**
 * \def EM_INSERTTEXT
 * \brief Inserts the specified text to the current caret position
 *
 * Normally used to input a long string.
 *
 * \code
 * EM_INSERTTEXT
 * int len;
 * const char *string;
 *
 * wParam = (WPARAM)len;
 * lParam = (LPARAM)string;
 * \endcode
 *
 * \param len Length of string
 * \param string Pointer to the text string
 */
#define EM_INSERTTEXT           0xF0C0

/* Not use */
#define EM_LINELENGTH           0xF0C1
/* Not use */
#define EM_REPLACESEL           0xF0C2

/**
 * \def EM_GETMAXLIMIT
 * \brief Get text limit of a single-line edit control.
 */
#define EM_GETMAXLIMIT            0xF0C3

/* Not use */
#define EM_GETLINE              0xF0C4

/**
 * \def EM_LIMITTEXT
 * \brief Set text limit of an edit control.
 *
 * \code
 * EM_LIMITTEXT
 * int newLimit;
 *
 * wParam = (WPARAM)newLimit;
 * lParam = 0;
 * \endcode
 *
 * \param newLimit The new text limit of an edit control.
 */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -