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

📄 ebmedit.h

📁 基于minigui开发的一套图形控件系统
💻 H
字号:
//
// $Id: ebmedit.h,v 1.2 2005/07/26 02:28:32 tangjb Exp $
//
// edit.h: the head file of Edit Control module.
//
// Copyright (c) 1999, Wei Yongming.
//
// Create date: 1999/8/26
//

#ifndef GUI_EBMEDIT_H_
#define GUI_EBMEDIT_H_

#ifdef  __cplusplus
extern  "C" {
#endif

#define WIDTH_MEDIT_BORDER       2
#define MARGIN_MEDIT_LEFT        1
#define MARGIN_MEDIT_TOP         1
#define MARGIN_MEDIT_RIGHT       2
#define MARGIN_MEDIT_BOTTOM      1

#define LEN_MLEDIT_BUFFER       1000
#define LEN_MLEDIT_UNDOBUFFER   1024
#define MAX_IMPOSSIBLE			10000

#define EST_FOCUSED     0x00000001L
#define EST_MODIFY      0x00000002L
#define EST_READONLY    0x00000004L
#define EST_REPLACE     0x00000008L

#define MEDIT_OP_NONE    0x00
#define MEDIT_OP_DELETE  0x01
#define MEDIT_OP_INSERT  0x02
#define MEDIT_OP_REPLACE 0x03

#define MAX_WRAP_NUM	100
		
typedef struct tagEBLINEDATA
{
	int     lineNO;	 	             	// 行号
	int     dataEnd; 
	struct  tagEBLINEDATA *previous;    	// 前一行
	struct  tagEBLINEDATA *next;        	// 后一行 
	char    buffer[LEN_MLEDIT_BUFFER+1];
	int		nwrapline;					// wrap line support, wrap line number in current line
	int  	wrapStartPos[MAX_WRAP_NUM];	// starting address of each wrap line in current line
}EBLINEDATA;
typedef EBLINEDATA* PEBLINEDATA;

typedef struct tagMLEDITDATA
{
    DWORD   status;         // status of box
	int     editLine;		// current eidt line
	int     dispPos;        // 开始显示的位置
	int     StartlineDisp;  // start line displayed
    int     EndlineDisp;    // end line displayed
    int     linesDisp;      // 需要显示的行数
	int     lines;		    // 总的行数`
	int     MaxlinesDisp;   // 最大显示的行数.
							
    int     selStartPos;    // selection start position
	int     selStartLine;   // selection start line
    int     selEndPos;      // selection end position
	int     selEndLine;     // selection end line
    
    int     passwdChar;     // password character
    
    int     leftMargin;     // left margin
    int     topMargin;      // top margin
    int     rightMargin;    // right margin
    int     bottomMargin;   // bottom margin
    
    int     lineHeight;     // height of line.
    int 	lineInterval;	// 行间距, 默认为5,
    int     totalLimit;    	// total text Len hard limit
	int		curtotalLen;	// current total text len
	int 	lineLimit;		// len limit per line

   	PEBLINEDATA   head;       // buffer
	PEBLINEDATA   tail;       // 可能不需要
						// added by leon for charset support
	int		fit_chars;		// number of valid units to display		在一定宽度中可输出的最大字符数
	int*	pos_chars;		// postion of each valid unit in buffer	每个字符所在的字节位置
	int*	dx_chars;		// display postion of each valid unit	每个字符的输出位置
	SIZE	sz;				// display rect size					输出高度和宽度
	int 	veditPos;		// editPos position of valid unit in both arrays
	int 	vdispPos;		// dispPos position of valid unit in both arrays
	int 	realeditLine;	// the 'real' line number that the cursor should be on if visible
	int 	realdispPos;	// the 'real' valid unit edit position that the cursor should be on if visible
	int 	realStartLine;	// the 'real' valid start line number
	int 	realEndLine;	// the 'real' valid end line number
	int		diff;			// 0: no difference; 1: difference
	int     bSCROLL;		// 0: not scroll; 1: scroll
							// add end 
	int 	wraplines;		// total wrapline number
	DWORD	textcolor;		// 文字颜色 add by tjb 2004-4-5
	DWORD   data;			// 附加数据
#if 0
    int     lastOp;         // last operation
    int     lastPos;        // last operation position
	int     lastLine;       // last operation line
    int     affectedLen;    // affected len of last operation
    int     undoBufferLen;  // undo buffer len
    char    undoBuffer [LEN_MLEDIT_UNDOBUFFER];
                            // Undo buffer;
    PLOGFONT logfont;
#endif
}EBMLEDITDATA;
typedef EBMLEDITDATA* PEBMLEDITDATA;

BOOL RegisterEbMLEditControl (void);
void EbMLEditControlCleanup (void);

#ifdef __cplusplus
}
#endif

#endif // GUI_EBMEDIT_H_

⌨️ 快捷键说明

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