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

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

?? colourpopup.cpp

?? wince color picker 顏色拾取控件
?? 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一区二区三区免费野_久草精品视频
国产成人免费视| 色88888久久久久久影院按摩| 欧美激情综合在线| 欧美私模裸体表演在线观看| 国产a视频精品免费观看| 亚洲成a人片在线观看中文| 国产日韩欧美电影| 91精品国产品国语在线不卡| 91在线视频免费91| 国产精品自在欧美一区| 日本欧美在线看| 亚洲美女在线一区| 国产女同互慰高潮91漫画| 日韩一区二区三| 欧美性感一类影片在线播放| av不卡免费电影| 国产精品一二三区| 久久精品国产久精国产爱| 亚洲精品国产一区二区精华液 | 3d动漫精品啪啪1区2区免费| www.亚洲激情.com| 高清视频一区二区| 久草热8精品视频在线观看| 亚瑟在线精品视频| 亚洲一区在线视频观看| 中文字幕在线观看一区| 国产日本欧美一区二区| 久久免费美女视频| 欧美精品一区二区三区很污很色的| 欧美三级三级三级| 67194成人在线观看| 在线观看视频一区二区欧美日韩| 成人av免费网站| www.66久久| 99久久伊人精品| av一区二区不卡| 不卡大黄网站免费看| a亚洲天堂av| 成人丝袜视频网| www.欧美.com| 91小视频在线免费看| 91麻豆6部合集magnet| 91久久一区二区| 欧美性一二三区| 欧美色精品在线视频| 欧美日韩高清一区| 91麻豆精品91久久久久同性| 欧美一区二区三区在线看| 日韩精品一区二| 久久久亚洲国产美女国产盗摄| 国产亚洲欧美中文| 亚洲色图一区二区| 亚洲va欧美va天堂v国产综合| 舔着乳尖日韩一区| 久久99精品国产91久久来源| 国产美女av一区二区三区| 国产69精品久久99不卡| 97se亚洲国产综合自在线观| 色偷偷88欧美精品久久久| 欧美亚洲国产一区二区三区va | 欧美成人一区二区三区| 久久综合精品国产一区二区三区| 久久久亚洲精华液精华液精华液 | 欧美久久久久久久久久| 日韩一二三区不卡| 欧美国产精品久久| 亚洲资源中文字幕| 久久国内精品视频| 不卡的av网站| 欧美二区三区的天堂| 日韩欧美不卡一区| 欧美国产精品专区| 五月综合激情网| 国产精品一二三四五| 色av一区二区| 精品国产网站在线观看| 国产精品美女久久久久av爽李琼| 亚洲一二三四在线观看| 国产在线播放一区三区四| 91亚洲精品一区二区乱码| 91超碰这里只有精品国产| 久久色.com| 亚洲一区国产视频| 国产一区二区三区精品欧美日韩一区二区三区| 国产99久久久国产精品| 欧美日韩在线播| 久久久一区二区三区| 一区二区高清视频在线观看| 精品一区二区三区不卡| 色婷婷亚洲精品| 久久久亚洲国产美女国产盗摄| 一区二区三区自拍| 国内精品久久久久影院色 | 久久久噜噜噜久噜久久综合| 亚洲精品自拍动漫在线| 韩国v欧美v日本v亚洲v| 欧美三级电影在线看| 国产精品乱码一区二三区小蝌蚪| 日韩黄色在线观看| 91福利精品第一导航| 久久免费看少妇高潮| 日韩精品欧美精品| 一本一本大道香蕉久在线精品 | 亚洲成年人网站在线观看| 高清在线成人网| 欧美α欧美αv大片| 午夜欧美一区二区三区在线播放| 99精品欧美一区二区三区小说 | 日韩国产欧美视频| 91小视频免费观看| 国产日韩欧美综合一区| 日产国产欧美视频一区精品| 91福利视频在线| 国产精品传媒在线| 国产suv一区二区三区88区| 日韩欧美国产三级电影视频| 亚洲国产精品一区二区久久恐怖片| 99久久99精品久久久久久| 国产欧美日韩在线| 国内精品写真在线观看| 欧美电视剧免费全集观看| 午夜久久久影院| 欧美区一区二区三区| 亚洲国产视频a| 欧美在线免费播放| 亚洲男人天堂av| 91女厕偷拍女厕偷拍高清| 国产精品盗摄一区二区三区| 成人开心网精品视频| 国产嫩草影院久久久久| 国产suv精品一区二区三区| 久久婷婷国产综合精品青草 | 国产不卡视频在线播放| 久久久精品蜜桃| 国产成人自拍在线| 日本一区二区三区视频视频| 国产高清在线精品| 久久精品一区蜜桃臀影院| 国产精品91一区二区| 国产日韩精品视频一区| 国产99一区视频免费| 一区视频在线播放| 在线精品视频一区二区| 无吗不卡中文字幕| 日韩女优av电影| 国产精品456| 中文无字幕一区二区三区| www.亚洲激情.com| 亚洲一卡二卡三卡四卡无卡久久| 欧美久久久久免费| 狠狠色丁香久久婷婷综合_中| 精品国产99国产精品| 国产精品亚洲第一区在线暖暖韩国| 中文字幕欧美激情| 一本色道久久综合亚洲精品按摩 | 国产主播一区二区| 欧美激情综合五月色丁香小说| 972aa.com艺术欧美| 亚洲在线视频网站| 欧美一级一级性生活免费录像| 狠狠狠色丁香婷婷综合激情| 国产精品福利一区| 欧美另类一区二区三区| 精品影院一区二区久久久| 国产三级欧美三级日产三级99| 99久久精品免费| 日韩中文字幕区一区有砖一区 | 丁香六月久久综合狠狠色| 国产精品免费丝袜| 欧美性一二三区| 国产毛片精品视频| 一区二区在线免费观看| 91麻豆精品国产自产在线| 成熟亚洲日本毛茸茸凸凹| 亚洲午夜视频在线| 精品国产乱码久久| 91免费观看在线| 久久国产精品99久久人人澡| 国产精品对白交换视频| 欧美一级免费大片| www.激情成人| 久久狠狠亚洲综合| 亚洲综合一二三区| 国产亚洲女人久久久久毛片| 欧美午夜片在线观看| 国产另类ts人妖一区二区| 亚洲美女视频一区| 国产亚洲一二三区| 欧美日韩美少妇| 成人av电影免费在线播放| 美腿丝袜亚洲三区| 亚洲欧美色一区| 久久久国产一区二区三区四区小说 | 捆绑变态av一区二区三区| 一区免费观看视频| 久久天堂av综合合色蜜桃网| 欧美精品久久久久久久多人混战| 成人sese在线| 黄色日韩三级电影| 天天av天天翘天天综合网色鬼国产 |