wins.c

来自「rtCell 实时微内核-具有下列功能: 1. 完全抢占的实时微内核结构」· C语言 代码 · 共 98 行

C
98
字号
/*
 *******************************************************************************
 *                      The real-time kernel "rtCell"                          *
 *              Copyright 2005 taowentao, allrights reserved.                  *
 * File : Wins.c                                                               *
 * By   : taowentao     2006-09-02  2007-05-20                                 *
 *******************************************************************************
 */

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

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

void DrawUpRect(const RECT* pRect)
{
    RECT r = *pRect;

    if (IsValidRect(&r) == false) return;
    
    DrawHLine(r.top, r.left, r.right - 1, GD_LIGHTGRAY);
    DrawVLine(r.left, r.top, r.bottom - 1, GD_LIGHTGRAY);

    DrawHLine(r.bottom, r.left, r.right, GD_BLACK);
    DrawVLine(r.right, r.top, r.bottom, GD_BLACK);

    DrawHLine(r.top + 1, r.left + 1, r.right - 2, GD_WHITE);
    DrawVLine(r.left + 1, r.top + 1, r.bottom - 2, GD_WHITE);

    DrawHLine(r.bottom-1, r.left + 1, r.right - 1, GD_DARKGRAY);
    DrawVLine(r.right-1, r.top + 1, r.bottom - 2, GD_DARKGRAY);
}

void DrawUpBotton(const RECT* pRect)
{
    RECT r = *pRect;

    if (IsValidRect(&r) == false) return;
    DrawHLine(r.top, r.left, r.right - 1, GD_WHITE);
    DrawVLine(r.left, r.top, r.bottom - 1, GD_WHITE);
    DrawHLine(r.top + 1, r.left + 1, r.right - 2, GD_LIGHTGRAY);
    DrawVLine(r.left + 1, r.top + 1, r.bottom - 2, GD_LIGHTGRAY);
    
    DrawHLine(r.bottom, r.left, r.right, GD_BLACK);
    DrawVLine(r.right, r.top, r.bottom, GD_BLACK);
    DrawHLine(r.bottom-1, r.left + 1, r.right - 1, GD_DARKGRAY);
    DrawVLine(r.right-1, r.top + 1, r.bottom - 2, GD_DARKGRAY);
}

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

void DrawDownRect(const RECT* pRect)
{
    RECT r = *pRect;

    if (IsValidRect(&r) == false) return;
    DrawHLine(r.top, r.left, r.right - 1, GD_DARKGRAY);
    DrawVLine(r.left, r.top + 1, r.bottom - 1, GD_DARKGRAY);

    DrawHLine(r.top + 1, r.left + 1, r.right - 2, GD_BLACK);
    DrawVLine(r.left + 1, r.top + 1, r.bottom - 2, GD_BLACK);

    DrawHLine(r.bottom, r.left, r.right, GD_WHITE);
    DrawVLine(r.right, r.top, r.bottom, GD_WHITE);
  
    DrawHLine(r.bottom - 1, r. left + 1, r.right - 1, GD_LIGHTGRAY);
    DrawVLine(r.right - 1, r. top + 1, r.bottom - 1, GD_LIGHTGRAY);
}

void DrawDownBotton(const RECT* pRect)
{
    RECT r = *pRect;

    if (IsValidRect(&r) == false) return;
    DrawHLine(r.top, r.left, r.right - 1, GD_BLACK);
    DrawVLine(r.left, r.top + 1, r.bottom - 1, GD_BLACK);

    DrawHLine(r.top + 1, r.left + 1, r.right - 2, GD_DARKGRAY);
    DrawVLine(r.left + 1, r.top + 2, r.bottom - 2, GD_DARKGRAY);

    DrawHLine(r.bottom, r.left, r.right, GD_WHITE);
    DrawVLine(r.right, r.top, r.bottom, GD_WHITE);

    DrawHLine(r.bottom - 1, r. left + 1, r.right - 1, GD_LIGHTGRAY);
    DrawVLine(r.right - 1, r. top + 1, r.bottom - 1, GD_LIGHTGRAY);
}

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

⌨️ 快捷键说明

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