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

📄 control.h

📁 rtCell 实时微内核-具有下列功能: 1. 完全抢占的实时微内核结构
💻 H
字号:
/*
 *******************************************************************************
 *                      The real-time kernel "rtCell"                          *
 *              Copyright 2005 taowentao, allrights reserved.                  *
 * File : Control.h                                                            *
 * By   : taowentao     2006-09-02, 2007-05-12                                 *
 *******************************************************************************
 */

#if !defined(CONTROL_H)
#define CONTROL_H

#if !defined(WINS_H)
#include "giCell\Wins\include\Wins.h"
#endif

#include <mem.h>
#include <string.h> 

/*
 *******************************************************************************
 *                                                                             *
 *******************************************************************************
 */

struct _cll {
    void  *pNext;
};
typedef struct _cll CLL;

/******************************************************************************/

struct _lst {
    void  *pFirst;
    void  *pLast;  
};
typedef struct _lst LST;

/******************************************************************************/

/* control's status */
#define CTRL_FOCUSSED     (0x0001)
#define CTRL_MOUSE_ENTER  (0x0002)
#define CTRL_MOUSE_CATCH  (0x0004)
#define CTRL_CATCH_MOVE   (0x0008)
#define CTRL_CATCH_RESIZE (0x0010)
#define CTRL_MAX_SIZE     (0x0020)
#define CTRL_MIN_SIZE     (0x0040)
#define CTRL_CLIENT_RECT  (0x0080)
#define CTRL_RESIZABLE    (0x0100)

/* control's text or caption alignment */
#define CTRL_ALIGN_LEFT    (0x01)
#define CTRL_ALIGN_HCENTER (0x02)
#define CTRL_ALIGN_RIGHT   (0x03)

#define CTRL_ALIGN_TOP     (0x01 << 4)
#define CTRL_ALIGN_VCENTER (0x02 << 4)
#define CTRL_ALIGN_BOTTOM  (0x03 << 4)

#define CTRL_ALIGN_HMASK   (0x000f)
#define CTRL_ALIGN_VMASK   (0x00f0)
#define GET_ALIGN_H(a)     ((a) & 0x000f)
#define GET_ALIGN_V(a)     ((a) >> 0x004)

#define CTRL_BORDER        (02)
#define CTRL_PAGE          (16)

#define MOUSEENTERCOLOR    (GD_LIGHTBLUE)

/*
 *******************************************************************************
 *                                                                             *
 *******************************************************************************
 */ 

typedef void (*PPAINT)(VIEW *pView);
typedef void (_cdecl_ *PCLICK)(int x, int y, MOUSE_INF mi);
typedef void (_cdecl_ *PKEYDOWN)(KEY_INF ki);
typedef void (_cdecl_ *PCHECK)(const CBOOL checked);
typedef void (_cdecl_ *PSLIDER)(const int value, const int min, const int max);
typedef void (_cdecl_ *PSCROLL)(VIEW *pSBview, const int Off);
typedef void (_cdecl_ *PLISTBOXSEL)(void *pList);
typedef void (_cdecl_ *PTREESEL)(void *pTree);

CBOOL CtrlViewProc(VMSG *pMsg, PPAINT pPaintFun, CWORD *pStatus);
void DrawFocusRect(const RECT *pRect, const int off, COLOR clr);
void DrawDotHLine(int y, int left, int right, COLOR clr);
void DrawDotVLine(int x, int top, int bottom, COLOR clr);

void GetOrgFromAlign(int xSize, int ySize, const RECT *pRect, CWORD Align, POINT *pPt);
void CtrlDrawText(const BYTE *pStr, const RECT *pRect, CWORD Align, COLOR clr);
void InformView(VIEW *pView, const VMSG *pMsg);
void SetFocussedView(VIEW *pView);
void *GetParentWin(VIEW *pView);
VIEW *CreateControl(int left, int top, int width, int height, VIEW *pParent,
                    WORD Style, PVIEWFUN pViewFun, CWORD extrBytes);

int GetRectXSize(const RECT *pRect);
int GetRectYSize(const RECT *pRect);
void DrawTriangle(CWORD Align, int x, int y, int Size, int Inc, COLOR clr);
int GetCharX(int orgX, int chIndex, const BYTE *s);
int GetItemByY(const int orgY, const int ItemH, const int Max, const int yCursor);
void SetScrollBars(VIEW *pView, void *pScrolbar, int xMax, int yMax, int off);
void _cdecl_ OnControlScroll(VIEW *pSBview, const int Off);

/*
 *******************************************************************************
 *                                                                             *
 *******************************************************************************
 */
#endif /* end of Control.h */

⌨️ 快捷键说明

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