亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? colourpopup.cpp

?? 一個基于PXA255的水情遙測、遙控系統現場服務器軟件
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
// ColourPopup.cpp : implementation file
//
// Written by Chris Maunder (chrismaunder@codeguru.com)
// Extended by Alexander Bischofberger (bischofb@informatik.tu-muenchen.de)
// Copyright (c) 1998.
//
// Updated 30 May 1998 to allow any number of colours, and to
//                     make the appearance closer to Office 97. 
//                     Also added "Default" text area.         (CJM)
//
//         13 June 1998 Fixed change of focus bug (CJM)
//         30 June 1998 Fixed bug caused by focus bug fix (D'oh!!)
//                      Solution suggested by Paul Wilkerson.
//
// ColourPopup is a helper class for the colour picker control
// CColourPicker. Check out the header file or the accompanying 
// HTML doc file for details.
//
// This code may be used in compiled form in any way you desire. This
// file may be redistributed unmodified by any means PROVIDING it is 
// not sold for profit without the authors written consent, and 
// providing that this notice and the authors name is included. 
//
// This file is provided "as is" with no expressed or implied warranty.
// The author accepts no liability if it causes any damage to you or your
// computer whatsoever. It's free, so don't hassle me about it.
//
// Expect bugs.
// 
// Please use and enjoy. Please let me know of any bugs/mods/improvements 
// that you have found/implemented and I will fix/incorporate them into this
// file. 

#include "stdafx.h"
#include <math.h>
#include "ColourPicker.h"
#include "ColourPopup.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

#define DEFAULT_BOX_VALUE -3
#define CUSTOM_BOX_VALUE  -2
#define INVALID_COLOUR    -1

#define MAX_COLOURS      100


ColourTableEntry CColourPopup::m_crColours[] = 
{
    { RGB(0x00, 0x00, 0x00),    _T("Black")             },
    { RGB(0xA5, 0x2A, 0x00),    _T("Brown")             },
    { RGB(0x00, 0x40, 0x40),    _T("Dark Olive Green")  },
    { RGB(0x00, 0x55, 0x00),    _T("Dark Green")        },
    { RGB(0x00, 0x00, 0x5E),    _T("Dark Teal")         },
    { RGB(0x00, 0x00, 0x8B),    _T("Dark blue")         },
    { RGB(0x4B, 0x00, 0x82),    _T("Indigo")            },
    { RGB(0x28, 0x28, 0x28),    _T("Dark grey")         },

    { RGB(0x8B, 0x00, 0x00),    _T("Dark red")          },
    { RGB(0xFF, 0x68, 0x20),    _T("Orange")            },
    { RGB(0x8B, 0x8B, 0x00),    _T("Dark yellow")       },
    { RGB(0x00, 0x93, 0x00),    _T("Green")             },
    { RGB(0x38, 0x8E, 0x8E),    _T("Teal")              },
    { RGB(0x00, 0x00, 0xFF),    _T("Blue")              },
    { RGB(0x7B, 0x7B, 0xC0),    _T("Blue-grey")         },
    { RGB(0x66, 0x66, 0x66),    _T("Grey - 40")         },

    { RGB(0xFF, 0x00, 0x00),    _T("Red")               },
    { RGB(0xFF, 0xAD, 0x5B),    _T("Light orange")      },
    { RGB(0x32, 0xCD, 0x32),    _T("Lime")              }, 
    { RGB(0x3C, 0xB3, 0x71),    _T("Sea green")         },
    { RGB(0x7F, 0xFF, 0xD4),    _T("Aqua")              },
    { RGB(0x7D, 0x9E, 0xC0),    _T("Light blue")        },
    { RGB(0x80, 0x00, 0x80),    _T("Violet")            },
    { RGB(0x7F, 0x7F, 0x7F),    _T("Grey - 50")         },

    { RGB(0xFF, 0xC0, 0xCB),    _T("Pink")              },
    { RGB(0xFF, 0xD7, 0x00),    _T("Gold")              },
    { RGB(0xFF, 0xFF, 0x00),    _T("Yellow")            },    
    { RGB(0x00, 0xFF, 0x00),    _T("Bright green")      },
    { RGB(0x40, 0xE0, 0xD0),    _T("Turquoise")         },
    { RGB(0xC0, 0xFF, 0xFF),    _T("Skyblue")           },
    { RGB(0x48, 0x00, 0x48),    _T("Plum")              },
    { RGB(0xC0, 0xC0, 0xC0),    _T("Light grey")        },

    { RGB(0xFF, 0xE4, 0xE1),    _T("Rose")              },
    { RGB(0xD2, 0xB4, 0x8C),    _T("Tan")               },
    { RGB(0xFF, 0xFF, 0xE0),    _T("Light yellow")      },
    { RGB(0x98, 0xFB, 0x98),    _T("Pale green ")       },
    { RGB(0xAF, 0xEE, 0xEE),    _T("Pale turquoise")    },
    { RGB(0x68, 0x83, 0x8B),    _T("Pale blue")         },
    { RGB(0xE6, 0xE6, 0xFA),    _T("Lavender")          },
    { RGB(0xFF, 0xFF, 0xFF),    _T("White")             }
};

/////////////////////////////////////////////////////////////////////////////
// CColourPopup

CColourPopup::CColourPopup()
{
    Initialise();
}

CColourPopup::CColourPopup(CPoint p, COLORREF crColour, CWnd* pParentWnd,
                           LPCTSTR szDefaultText /* = NULL */,
                           LPCTSTR szCustomText  /* = NULL */)
{
    Initialise();

    m_crColour       = m_crInitialColour = crColour;
    m_pParent        = pParentWnd;
    m_strDefaultText = (szDefaultText)? szDefaultText : _T("");
    m_strCustomText  = (szCustomText)?  szCustomText  : _T("");

    CColourPopup::Create(p, crColour, pParentWnd, szDefaultText, szCustomText);
}

void CColourPopup::Initialise()
{
    m_nNumColours       = sizeof(m_crColours)/sizeof(ColourTableEntry);
    ASSERT(m_nNumColours <= MAX_COLOURS);
    if (m_nNumColours > MAX_COLOURS)
        m_nNumColours = MAX_COLOURS;

    m_nNumColumns       = 0;
    m_nNumRows          = 0;
    m_nBoxSize          = 18;
    m_nMargin           = ::GetSystemMetrics(SM_CXEDGE);
    m_nCurrentSel       = INVALID_COLOUR;
    m_nChosenColourSel  = INVALID_COLOUR;
    m_pParent           = NULL;
    m_crColour          = m_crInitialColour = RGB(0,0,0);

    m_bChildWindowVisible = FALSE;

    // Idiot check: Make sure the colour square is at least 5 x 5;
    if (m_nBoxSize - 2*m_nMargin - 2 < 5) m_nBoxSize = 5 + 2*m_nMargin + 2;

#ifdef _WIN32_WCE
	//
	// NONCLIENTMETRICS does not exist in CE
	// Use the Tahoma 8 font
	//
	LOGFONT	lf;
	long	nHeight;

	//
	// Create the option font
	//
	// Points  8 : -11
	//         9 : -12
	//		  10 : -13
	nHeight = -11;//(LONG)(-8 * pDC.GetDeviceCaps(LOGPIXELSY) / 72);

	lf.lfHeight			= nHeight;
	lf.lfWidth			= 0;
	lf.lfEscapement		= 0;
	lf.lfOrientation	= 0;
	lf.lfWeight			= FW_NORMAL;
	lf.lfItalic			= FALSE;
	lf.lfUnderline		= FALSE;
	lf.lfStrikeOut		= 0;
	lf.lfCharSet		= ANSI_CHARSET;
	lf.lfOutPrecision	= OUT_DEFAULT_PRECIS;
	lf.lfClipPrecision	= CLIP_DEFAULT_PRECIS;
	lf.lfQuality		= DEFAULT_QUALITY;
	lf.lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS;
	lstrcpy(lf.lfFaceName, TEXT("Tahoma"));
	m_Font.CreateFontIndirect(&lf);
#else
    // Create the font
    NONCLIENTMETRICS ncm;
    ncm.cbSize = sizeof(NONCLIENTMETRICS);
    VERIFY(SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, 0));
    m_Font.CreateFontIndirect(&(ncm.lfMessageFont));
#endif

    // Create the palette
    struct {
        LOGPALETTE    LogPalette;
        PALETTEENTRY  PalEntry[MAX_COLOURS];
    } pal;

    LOGPALETTE* pLogPalette = (LOGPALETTE*) &pal;
    pLogPalette->palVersion    = 0x300;
    pLogPalette->palNumEntries = (WORD) m_nNumColours; 

    for (int i = 0; i < m_nNumColours; i++)
    {
        pLogPalette->palPalEntry[i].peRed   = GetRValue(m_crColours[i].crColour);
        pLogPalette->palPalEntry[i].peGreen = GetGValue(m_crColours[i].crColour);
        pLogPalette->palPalEntry[i].peBlue  = GetBValue(m_crColours[i].crColour);
        pLogPalette->palPalEntry[i].peFlags = 0;
    }

    m_Palette.CreatePalette(pLogPalette);
}

CColourPopup::~CColourPopup()
{
    m_Font.DeleteObject();
    m_Palette.DeleteObject();
}

BOOL CColourPopup::Create(CPoint p, COLORREF crColour, CWnd* pParentWnd,
                          LPCTSTR szDefaultText /* = NULL */,
                          LPCTSTR szCustomText  /* = NULL */)
{
    ASSERT(pParentWnd && ::IsWindow(pParentWnd->GetSafeHwnd()));
    ASSERT(pParentWnd->IsKindOf(RUNTIME_CLASS(CColourPicker)));

    m_pParent  = pParentWnd;
    m_crColour = m_crInitialColour = crColour;

    // Get the class name and create the window
#ifdef _WIN32_WCE
	//
	// CS_CLASSDC does not exist in CE
	//
    CString szClassName = AfxRegisterWndClass(CS_SAVEBITS|CS_HREDRAW|CS_VREDRAW,
                                              0,
                                              (HBRUSH) (COLOR_BTNFACE+1), 
                                              0);
#else
    CString szClassName = AfxRegisterWndClass(CS_CLASSDC|CS_SAVEBITS|CS_HREDRAW|CS_VREDRAW,
                                              0,
                                              (HBRUSH) (COLOR_BTNFACE+1), 
                                              0);
#endif

    if (!CWnd::CreateEx(0, szClassName, _T(""), WS_VISIBLE|WS_POPUP, 
                        p.x, p.y, 100, 100, // size updated soon
                        pParentWnd->GetSafeHwnd(), 0, NULL))
        return FALSE;

    // Store the Custom text
    if (szCustomText != NULL) 
        m_strCustomText = szCustomText;

    // Store the Default Area text
    if (szDefaultText != NULL) 
        m_strDefaultText = szDefaultText;
        
    // Set the window size
    SetWindowSize();

#ifndef _WIN32_WCE
	//
    // Create the tooltips
	// Only for desktop versions
	//
    CreateToolTips();
#endif

    // Find which cell (if any) corresponds to the initial colour
    FindCellFromColour(crColour);

    // Capture all mouse events for the life of this window
    SetCapture();

    return TRUE;
}

BEGIN_MESSAGE_MAP(CColourPopup, CWnd)
#ifdef _WIN32_WCE
    ON_WM_LBUTTONDOWN()		// CE uses WM_LBUTTONDOWN instead of WM_MOUSEMOVE
#else
    ON_WM_NCDESTROY()
	ON_WM_ACTIVATEAPP()
    ON_WM_MOUSEMOVE()
#endif
    //{{AFX_MSG_MAP(CColourPopup)
    ON_WM_LBUTTONUP()
    ON_WM_PAINT()
    ON_WM_KEYDOWN()
    ON_WM_QUERYNEWPALETTE()
    ON_WM_PALETTECHANGED()
	ON_WM_KILLFOCUS()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CColourPopup message handlers

// For tooltips
BOOL CColourPopup::PreTranslateMessage(MSG* pMsg) 
{
#ifndef _WIN32_WCE
    m_ToolTip.RelayEvent(pMsg);
#endif

    // Fix (Adrian Roman): Sometimes if the picker loses focus it is never destroyed
    if (GetCapture()->GetSafeHwnd() != m_hWnd)
        SetCapture(); 

    return CWnd::PreTranslateMessage(pMsg);
}

// If an arrow key is pressed, then move the selection
void CColourPopup::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) 
{
    int row = GetRow(m_nCurrentSel),
        col = GetColumn(m_nCurrentSel);

    if (nChar == VK_DOWN) 
    {
        if (row == DEFAULT_BOX_VALUE) 
            row = col = 0; 
        else if (row == CUSTOM_BOX_VALUE)
        {
            if (m_strDefaultText.GetLength())
                row = col = DEFAULT_BOX_VALUE;
            else
                row = col = 0;
        }
        else
        {
            row++;
            if (GetIndex(row,col) < 0)
            {
                if (m_strCustomText.GetLength())
                    row = col = CUSTOM_BOX_VALUE;
                else if (m_strDefaultText.GetLength())
                    row = col = DEFAULT_BOX_VALUE;
                else
                    row = col = 0;
            }
        }
        ChangeSelection(GetIndex(row, col));
    }

    if (nChar == VK_UP) 
    {
        if (row == DEFAULT_BOX_VALUE)
        {
            if (m_strCustomText.GetLength())
                row = col = CUSTOM_BOX_VALUE;
            else
           { 
                row = GetRow(m_nNumColours-1); 
                col = GetColumn(m_nNumColours-1); 
            }
        }
        else if (row == CUSTOM_BOX_VALUE)
        { 
            row = GetRow(m_nNumColours-1); 
            col = GetColumn(m_nNumColours-1); 
        }
        else if (row > 0) row--;
        else /* row == 0 */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲日本成人在线观看| 国产高清成人在线| 麻豆国产精品一区二区三区| 不卡欧美aaaaa| 欧美精品成人一区二区三区四区| 国产午夜精品在线观看| 亚洲午夜一区二区三区| 成人黄色小视频在线观看| 欧美精选午夜久久久乱码6080| 中文字幕av一区二区三区高| 日本va欧美va精品| 在线观看91视频| 国产精品毛片久久久久久| 另类欧美日韩国产在线| 91福利视频久久久久| 国产精品美女久久久久高潮| 久久精品久久综合| 欧美高清视频不卡网| 一区二区不卡在线视频 午夜欧美不卡在 | 亚洲第一狼人社区| 91在线观看高清| 国产嫩草影院久久久久| 精品在线亚洲视频| 日韩一区二区在线观看视频播放| 亚洲永久精品国产| 色狠狠色噜噜噜综合网| 国产精品久久看| 懂色av中文字幕一区二区三区| 欧美成人精精品一区二区频| 美女视频黄频大全不卡视频在线播放| 欧美日韩一区不卡| 亚洲一区二区三区在线播放| 91麻豆精品在线观看| 亚洲色图色小说| 91蝌蚪porny成人天涯| 自拍偷拍亚洲激情| 成人高清av在线| 国产精品美女www爽爽爽| 成人中文字幕合集| 国产精品午夜在线| 91网上在线视频| 亚洲一区二区三区四区五区黄| 在线观看不卡一区| 丝瓜av网站精品一区二区| 欧美日产国产精品| 美女看a上一区| 精品国产免费视频| 国产69精品久久久久777| 中文字幕欧美国产| 91在线高清观看| 亚洲成年人网站在线观看| 欧美日韩黄色一区二区| 日韩高清欧美激情| 亚洲精品一区二区三区99| 粉嫩一区二区三区性色av| 中文字幕佐山爱一区二区免费| 99久久99精品久久久久久| 亚洲最大色网站| 欧美一级一区二区| 国产精品白丝av| 亚洲你懂的在线视频| 欧美日韩国产一二三| 极品美女销魂一区二区三区免费 | 国产美女视频一区| 综合欧美亚洲日本| 欧美乱妇15p| 国产麻豆日韩欧美久久| 亚洲黄色免费网站| 欧美va亚洲va国产综合| a亚洲天堂av| 日韩av不卡一区二区| 国产三级一区二区| 欧美乱妇一区二区三区不卡视频| 国精产品一区一区三区mba视频| 国产精品久久久久久久久动漫| 欧美日韩成人综合| 成人高清免费在线播放| 日本91福利区| 亚洲欧美日韩电影| 精品国产青草久久久久福利| 色婷婷av一区| 福利一区福利二区| 丝袜亚洲精品中文字幕一区| 中文欧美字幕免费| 日韩一区二区三区精品视频| 91麻豆国产精品久久| 久久99精品国产.久久久久久| 亚洲乱码国产乱码精品精的特点 | 91精品久久久久久蜜臀| 丁香网亚洲国际| 精品一区二区免费| 午夜视频一区二区| 自拍偷自拍亚洲精品播放| www国产成人| 欧美精品一卡二卡| 色婷婷av一区二区三区gif | 免费av成人在线| 亚洲精品国产视频| 国产精品美女久久久久高潮| xvideos.蜜桃一区二区| 717成人午夜免费福利电影| 99re8在线精品视频免费播放| 国产在线视频一区二区三区| 蜜桃视频在线观看一区| 亚洲图片欧美综合| 亚洲自拍另类综合| 亚洲一区二区三区不卡国产欧美| 中文字幕一区二区三区蜜月| 欧美激情综合五月色丁香小说| 日韩美女在线视频| 日韩欧美一区在线| 欧美大片一区二区| 日韩欧美精品三级| 欧美一区二区精品在线| 欧美一区二区三区在线观看| 欧美色精品天天在线观看视频| 91久久人澡人人添人人爽欧美| 99久久国产综合精品麻豆| 不卡一区在线观看| 一本大道久久a久久精二百| 91污片在线观看| 91麻豆国产香蕉久久精品| 91在线免费看| 在线视频中文字幕一区二区| 欧美系列日韩一区| 制服丝袜一区二区三区| 欧美一区二区视频免费观看| 日韩丝袜情趣美女图片| 精品少妇一区二区三区免费观看| 久久中文娱乐网| 中文字幕精品在线不卡| 亚洲人成在线观看一区二区| 亚洲天堂精品视频| 五月天国产精品| 精品一区二区三区在线播放 | 欧美综合欧美视频| 日韩免费高清av| 中文字幕的久久| 亚洲制服欧美中文字幕中文字幕| 视频在线观看一区二区三区| 美女视频第一区二区三区免费观看网站| 国产一区中文字幕| 91在线一区二区三区| 欧美在线免费播放| 精品国产乱码久久久久久浪潮| 国产精品久久影院| 日本特黄久久久高潮| 粉嫩欧美一区二区三区高清影视| 在线亚洲免费视频| 精品精品国产高清a毛片牛牛| 日本一区二区三区在线观看| 亚洲高清免费视频| 国产.欧美.日韩| 欧美人体做爰大胆视频| 欧美激情一二三区| 香蕉加勒比综合久久| 国产精品一区一区| 欧美亚洲一区二区在线| 久久久久久亚洲综合影院红桃| 亚洲另类在线视频| 久久狠狠亚洲综合| 在线观看日产精品| 久久久综合视频| 亚洲 欧美综合在线网络| 国产米奇在线777精品观看| 欧美三级一区二区| 国产亚洲综合色| 午夜欧美电影在线观看| 成人精品视频一区二区三区| 日韩欧美一二三区| 亚洲精品精品亚洲| 国产麻豆精品theporn| 欧美日韩久久一区| 亚洲视频图片小说| 国产一区二区三区免费观看| 欧美乱熟臀69xxxxxx| 一区av在线播放| 成人av片在线观看| 久久精品视频一区二区| 日韩电影在线看| 色嗨嗨av一区二区三区| 中文字幕巨乱亚洲| 国产激情一区二区三区四区| 欧美一级片在线| 亚洲一区二区3| 色综合天天综合网天天狠天天| 国产视频一区二区在线观看| 黄网站免费久久| 日韩欧美国产一区二区在线播放| 亚洲成人自拍偷拍| 在线观看视频一区二区欧美日韩 | 久久久www免费人成精品| 日韩**一区毛片| 678五月天丁香亚洲综合网| 亚洲免费av观看| 色婷婷av一区二区三区软件 | 国产日韩av一区二区| 久久99精品国产麻豆不卡| 日韩午夜三级在线| 毛片一区二区三区|