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

📄 ctrlmisc.c

📁 在ecos 下mingui 的移植开发
💻 C
字号:
//// ctrlmisc.c: the Control Misc module.//// Copyright (C) 1999, 2000, Wei Yongming.//// Current maintainer: Wei Yongming./***  This library is free software; you can redistribute it and/or**  modify it under the terms of the GNU Library General Public**  License as published by the Free Software Foundation; either**  version 2 of the License, or (at your option) any later version.****  This library is distributed in the hope that it will be useful,**  but WITHOUT ANY WARRANTY; without even the implied warranty of**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU**  Library General Public License for more details.****  You should have received a copy of the GNU Library General Public**  License along with this library; if not, write to the Free**  Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,**  MA 02111-1307, USA*//***  Alternatively, the contents of this file may be used under the terms **  of the Mozilla Public License (the "MPL License") in which case the**  provisions of the MPL License are applicable instead of those above.*///// Create date: 1999/8/23//// Modify records:////  Who             When        Where       For What                Status//-----------------------------------------------------------------------------//  WEI Yongming    2000/02/24  Tsinghua    Add MPL License         Finished//#include <pthread.h>#include <semaphore.h>#include "common.h"#include "gdi.h"#include "window.h"#include "ctrlmisc.h"#ifndef lintstatic char fileid[] = "$Id: ctrlmisc.c,v 1.3 2000/06/19 03:33:29 weiym Exp $";#endifvoid Draw3DControlFrame (HDC hdc, int x0, int y0, int x1, int y1,             int fillc, BOOL updown){    int left, top, right, bottom;    left = min (x0, x1);    top  = min (y0, y1);    right = max (x0, x1);    bottom = max (y0, y1);        if (updown) {        SetPenColor (hdc, PIXEL_lightwhite);        MoveTo (hdc, left, bottom);        LineTo (hdc, left, top);        LineTo (hdc, right, top);        SetPenColor (hdc, PIXEL_black);        LineTo (hdc, right, bottom);        LineTo (hdc, left, bottom);        left++; top++; right--; bottom--;        SetPenColor (hdc, PIXEL_darkgray);        MoveTo (hdc, left, bottom);        LineTo (hdc, left, top);        LineTo (hdc, right, top);        SetPenColor (hdc, PIXEL_darkgray);        LineTo (hdc, right, bottom);        LineTo (hdc, left, bottom);    }    else {        SetPenColor (hdc, PIXEL_darkgray);        MoveTo (hdc, left, bottom);        LineTo (hdc, left, top);        LineTo (hdc, right, top);        SetPenColor (hdc, PIXEL_lightwhite);        MoveTo (hdc, left, bottom);        LineTo (hdc, right, bottom);        LineTo (hdc, right, top);        left++; top++; right--; bottom--;        SetPenColor (hdc, PIXEL_black);        MoveTo (hdc, left, bottom);        LineTo (hdc, left, top);        LineTo (hdc, right, top);        SetPenColor (hdc, PIXEL_darkgray);        MoveTo (hdc, left, bottom);        LineTo (hdc, right, bottom);        LineTo (hdc, right, top);    }    if (fillc > 0) {        SetBrushColor (hdc, fillc);        FillBox (hdc, left + 1, top + 1, right - left - 1 , bottom - top - 1);     }}int NotifyParent (HWND hwnd, int id, int code){    return SendMessage (GetParent (hwnd), MSG_COMMAND,                  (WPARAM) MAKELONG (id, code), (LPARAM)hwnd);}

⌨️ 快捷键说明

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