📄 edit.c
字号:
/*
*******************************************************************************
* 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -