edit.c
来自「rtCell 实时微内核-具有下列功能: 1. 完全抢占的实时微内核结构」· C语言 代码 · 共 84 行
C
84 行
/*
*******************************************************************************
* The real-time kernel "rtCell" *
* Copyright 2005 taowentao, allrights reserved. *
* File : Edit.c *
* By : taowentao 2006-09-02 2007-05-20 *
*******************************************************************************
*/
#if !defined(EDIT_H)
#include "giCell\Wins\include\Edit.h"
#endif
/*
*******************************************************************************
* *
*******************************************************************************
*/
static void EditPaint(VIEW *pView)
{
DrawDownRect(&(pView->viewRect));
}
static CBOOL _cdecl_ EditViewProc(VMSG *pMsg)
{
EDIT *pEdit = OBJ_FROM_VIEW(pMsg->pView);
switch (pMsg->MsgID) {
case VMSG_PAINT:
EditPaint(pMsg->pView);
return (true);
default:
InformView(pEdit->pPEdit->pView, pMsg);
return (true);
}
}
EDIT* CreateEdit(int left, int top, int width, int height, VIEW* pParent,
BYTE *pText, PKEYDOWN pKeyDown, CWORD Align, CWORD textLen)
{
VIEW *pView;
EDIT *pEdit;
if (pParent == NULL) return (NULL);
pView = CreateControl(left, top, width, height, pParent, 0, EditViewProc,
sizeof(EDIT));
if (pView == NULL) return (NULL);
pEdit = OBJ_FROM_VIEW(pView);
pEdit->pView = pView;
pEdit->pPEdit = CreatePureEdit(2, 2, width-4, height-4, pView, pText,
pKeyDown, Align, textLen);
if (pEdit->pPEdit == NULL) {
GUIFree(pEdit);
return (NULL);
}
ShowView(pEdit->pView);
ShowView(pEdit->pPEdit->pView);
return (pEdit);
}
void DeleteEdit(EDIT *pEdit)
{
if (pEdit == NULL) return;
DeleteView(pEdit->pView);
}
const BYTE * GetEditText(EDIT *pEdit)
{
if (pEdit != NULL)
return (GetPureEditText(pEdit->pPEdit));
else
return (NULL);
}
/*
*******************************************************************************
* *
*******************************************************************************
*/
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?