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

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

?? colourpicker.cpp

?? 一個基于PXA255的水情遙測、遙控系統現場服務器軟件
?? CPP
字號:
// ColourPicker.cpp : implementation file
//
// ColourPicker is a drop-in colour picker control. Check out the 
// header file or the accompanying HTML doc file for details.
//
// Written by Chris Maunder (chrismaunder@codeguru.com)
// Extended by Alexander Bischofberger (bischofb@informatik.tu-muenchen.de)
// Copyright (c) 1998.
//
// 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. If 
// the source code in  this file is used in any commercial application 
// then a simple email would be nice.
//
// This file is provided "as is" with no expressed or implied warranty.
// The author accepts no liability if it causes any damage to your
// computer, causes your pet cat to fall ill, increases baldness or
// makes you car start emitting strange noises when you start it up.
//
// 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. 
//
// Updated 16 May 1998
//         31 May 1998 - added Default text (CJM)
//          9 Jan 1999 - minor vis update

#include "stdafx.h"
#include "ColourPopup.h"
#include "ColourPicker.h"

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

void AFXAPI DDX_ColourPicker(CDataExchange *pDX, int nIDC, COLORREF& crColour)
{
    HWND hWndCtrl = pDX->PrepareCtrl(nIDC);
    ASSERT (hWndCtrl != NULL);                
    
    CColourPicker* pColourPicker = (CColourPicker*) CWnd::FromHandle(hWndCtrl);
    if (pDX->m_bSaveAndValidate)
    {
        crColour = pColourPicker->GetColour();
    }
    else // initializing
    {
        pColourPicker->SetColour(crColour);
    }
}

/////////////////////////////////////////////////////////////////////////////
// CColourPicker

CColourPicker::CColourPicker()
{
    SetBkColour(GetSysColor(COLOR_3DFACE));
    SetTextColour(GetSysColor(COLOR_BTNTEXT));

    m_bTrackSelection = FALSE;
    m_nSelectionMode = CP_MODE_BK;
    m_bActive = FALSE;

    m_strDefaultText = _T("Automatic");
#ifdef _WIN32_WCE
	//
	// The Custom text is not used in CE. You can use it
	// to cancel the selection
	//
    m_strCustomText  = _T("Cancel");
#else
    m_strCustomText  = _T("More Colours...");
#endif
}

CColourPicker::~CColourPicker()
{
}

IMPLEMENT_DYNCREATE(CColourPicker, CButton)

BEGIN_MESSAGE_MAP(CColourPicker, CButton)
    //{{AFX_MSG_MAP(CColourPicker)
    ON_CONTROL_REFLECT_EX(BN_CLICKED, OnClicked)
    ON_WM_CREATE()
    //}}AFX_MSG_MAP
    ON_MESSAGE(CPN_SELENDOK,     OnSelEndOK)
    ON_MESSAGE(CPN_SELENDCANCEL, OnSelEndCancel)
    ON_MESSAGE(CPN_SELCHANGE,    OnSelChange)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CColourPicker message handlers

LONG CColourPicker::OnSelEndOK(UINT lParam, LONG /*wParam*/)
{
    COLORREF crNewColour = (COLORREF) lParam;
    m_bActive = FALSE;
    SetColour(crNewColour);

    CWnd *pParent = GetParent();
    if (pParent) {
        pParent->SendMessage(CPN_CLOSEUP, lParam, (WPARAM) GetDlgCtrlID());
        pParent->SendMessage(CPN_SELENDOK, lParam, (WPARAM) GetDlgCtrlID());
    }

    if (crNewColour != GetColour())
        if (pParent) pParent->SendMessage(CPN_SELCHANGE, lParam, (WPARAM) GetDlgCtrlID());

    return TRUE;
}


LONG CColourPicker::OnSelEndCancel(UINT lParam, LONG /*wParam*/)
{
    m_bActive = FALSE;
    SetColour((COLORREF) lParam);

    CWnd *pParent = GetParent();
    if (pParent) {
        pParent->SendMessage(CPN_CLOSEUP, lParam, (WPARAM) GetDlgCtrlID());
        pParent->SendMessage(CPN_SELENDCANCEL, lParam, (WPARAM) GetDlgCtrlID());
    }

    return TRUE;
}


LONG CColourPicker::OnSelChange(UINT lParam, LONG /*wParam*/)
{
    if (m_bTrackSelection) SetColour((COLORREF) lParam);

    CWnd *pParent = GetParent();
    if (pParent) pParent->SendMessage(CPN_SELCHANGE, lParam, (WPARAM) GetDlgCtrlID());

    return TRUE;
}


int CColourPicker::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
    if (CButton::OnCreate(lpCreateStruct) == -1)
        return -1;
    
    SetWindowSize();    // resize appropriately
    return 0;
}


// CColourPicker::OnClicked
//
//		On mouse click, create and show a CColourPopup window for colour selection
//		CE differences:
//		- By clicking a second time in the button, the popup is dismissed
//		- The popup is statically allocated, so a different creation method is used
//
BOOL CColourPicker::OnClicked()
{
#ifdef _WIN32_WCE
	//
	// Is the popup on?
	//
	if(IsWindow(m_wndPopup.GetSafeHwnd()))
	{
		m_wndPopup.DestroyWindow();				// Destroy the popup
		OnSelEndCancel((UINT)m_crBuf, 0);		// Notify a cancelled selection
		return TRUE;
	}
#endif

    m_bActive = TRUE;
    CRect rect;
    GetWindowRect(rect);

#ifdef _WIN32_WCE
	m_crBuf = GetColour();
	m_wndPopup.SetDefaultText	(m_strDefaultText);
	m_wndPopup.SetCustomText	(m_strCustomText);
	m_wndPopup.SetParentWindow	(this);
	m_wndPopup.SetColour		(m_crBuf);
	m_wndPopup.Create(CPoint(rect.left, rect.bottom), GetColour(), this, m_strDefaultText, m_strCustomText);
#else
    new CColourPopup(CPoint(rect.left, rect.bottom),    // Point to display popup
                     GetColour(),                       // Selected colour
                     this,                              // parent
                     m_strDefaultText,                  // "Default" text area
                     m_strCustomText);                  // Custom Text
#endif

    CWnd *pParent = GetParent();
    if (pParent)
        pParent->SendMessage(CPN_DROPDOWN, (LPARAM)GetColour(), (WPARAM) GetDlgCtrlID());

    // Docs say I should return FALSE to stop the parent also getting the message.
    // HA! What a joke.

    return TRUE;
}


// CColourPicker::DrawItem
//
//		Draws the button
//
void CColourPicker::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) 
{
    ASSERT(lpDrawItemStruct);
    
    CDC*    pDC     = CDC::FromHandle(lpDrawItemStruct->hDC);
    CRect   rect    = lpDrawItemStruct->rcItem;
    UINT    state   = lpDrawItemStruct->itemState;
    CString m_strText;

    CSize Margins(::GetSystemMetrics(SM_CXEDGE), ::GetSystemMetrics(SM_CYEDGE));

    // Draw arrow
    if (m_bActive) state |= ODS_SELECTED;
    pDC->DrawFrameControl(&m_ArrowRect, DFC_SCROLL, DFCS_SCROLLDOWN  | 
                          ((state & ODS_SELECTED) ? DFCS_PUSHED : 0) |
                          ((state & ODS_DISABLED) ? DFCS_INACTIVE : 0));

#ifdef _WIN32_WCE
    pDC->DrawEdge(rect, EDGE_SUNKEN, BF_RECT | BF_FLAT);		// Draw a flat frame in CE
#else
    pDC->DrawEdge(rect, EDGE_SUNKEN, BF_RECT);
#endif

    // Must reduce the size of the "client" area of the button due to edge thickness.
    rect.DeflateRect(Margins.cx, Margins.cy);

    // Fill remaining area with colour
    rect.right -= m_ArrowRect.Width();

    CBrush brush( ((state & ODS_DISABLED) || m_crColourBk == CLR_DEFAULT)? 
                  ::GetSysColor(COLOR_3DFACE) : m_crColourBk);
    CBrush* pOldBrush = (CBrush*) pDC->SelectObject(&brush);
	pDC->SelectStockObject(NULL_PEN);
    pDC->Rectangle(rect);
    pDC->SelectObject(pOldBrush);

    // Draw the window text (if any)
    GetWindowText(m_strText);
    if (m_strText.GetLength())
    {
        pDC->SetBkMode(TRANSPARENT);
        if (state & ODS_DISABLED)
        {
            rect.OffsetRect(1,1);
            pDC->SetTextColor(::GetSysColor(COLOR_3DHILIGHT));
            pDC->DrawText(m_strText, rect, DT_CENTER|DT_SINGLELINE|DT_VCENTER);
            rect.OffsetRect(-1,-1);
            pDC->SetTextColor(::GetSysColor(COLOR_3DSHADOW));
            pDC->DrawText(m_strText, rect, DT_CENTER|DT_SINGLELINE|DT_VCENTER);
        }
        else
        {
            pDC->SetTextColor((m_crColourText == CLR_DEFAULT)? 0 : m_crColourText);
            pDC->DrawText(m_strText, rect, DT_CENTER|DT_SINGLELINE|DT_VCENTER);
        }
    }

    // Draw focus rect
    if (state & ODS_FOCUS) 
    {
        rect.DeflateRect(1,1);
        pDC->DrawFocusRect(rect);
    }
}

/////////////////////////////////////////////////////////////////////////////
// CColourPicker overrides

void CColourPicker::PreSubclassWindow() 
{
    ModifyStyle(0, BS_OWNERDRAW);        // Make it owner drawn
    CButton::PreSubclassWindow();
    SetWindowSize();                     // resize appropriately
}

/////////////////////////////////////////////////////////////////////////////
// CColourPicker attributes

COLORREF CColourPicker::GetColour()
{ 
    return (m_nSelectionMode == CP_MODE_TEXT)? 
        GetTextColour(): GetBkColour(); 
}

void CColourPicker::SetColour(COLORREF crColour)
{ 
    (m_nSelectionMode == CP_MODE_TEXT)? 
        SetTextColour(crColour): SetBkColour(crColour); 
}

void CColourPicker::SetBkColour(COLORREF crColourBk)
{
    m_crColourBk = crColourBk;
    if (IsWindow(m_hWnd))
        RedrawWindow();
}

void CColourPicker::SetTextColour(COLORREF crColourText)
{
    m_crColourText = crColourText;
    if (IsWindow(m_hWnd)) 
        RedrawWindow();
}

void CColourPicker::SetDefaultText(LPCTSTR szDefaultText)
{
    m_strDefaultText = (szDefaultText)? szDefaultText : _T("");
}

void CColourPicker::SetCustomText(LPCTSTR szCustomText)
{
    m_strCustomText = (szCustomText)? szCustomText : _T("");
}

/////////////////////////////////////////////////////////////////////////////
// CColourPicker implementation

void CColourPicker::SetWindowSize()
{
    // Get size dimensions of edges
    CSize MarginSize(::GetSystemMetrics(SM_CXEDGE), ::GetSystemMetrics(SM_CYEDGE));

    // Get size of dropdown arrow
#ifdef _WIN32_WCE
    int nArrowWidth = max(16, 5*MarginSize.cx);		// Sorry: had to resort to magic numbers...
    int nArrowHeight = max(16, 5*MarginSize.cy);	// CE doesn't support most SM_* constants
#else
    int nArrowWidth = max(::GetSystemMetrics(SM_CXHTHUMB), 5*MarginSize.cx);
    int nArrowHeight = max(::GetSystemMetrics(SM_CYVTHUMB), 5*MarginSize.cy);
#endif
    CSize ArrowSize(max(nArrowWidth, nArrowHeight), max(nArrowWidth, nArrowHeight));

    // Get window size
    CRect rect;
    GetWindowRect(rect);

    CWnd* pParent = GetParent();
    if (pParent)
        pParent->ScreenToClient(rect);

    // Set window size at least as wide as 2 arrows, and as high as arrow + margins
    int nWidth = max(rect.Width(), 2*ArrowSize.cx + 2*MarginSize.cx);
    MoveWindow(rect.left, rect.top, nWidth, ArrowSize.cy+2*MarginSize.cy, TRUE);

    // Get the new coords of this window
    GetWindowRect(rect);
    ScreenToClient(rect);

    // Get the rect where the arrow goes, and convert to client coords.
    m_ArrowRect.SetRect(rect.right - ArrowSize.cx - MarginSize.cx, 
                        rect.top + MarginSize.cy, rect.right - MarginSize.cx,
                        rect.bottom - MarginSize.cy);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩视频在线观看一区二区三区| 亚洲人成网站在线| 麻豆高清免费国产一区| 欧美精品自拍偷拍动漫精品| 一区二区国产视频| 欧美中文字幕一二三区视频| 亚洲国产精品久久艾草纯爱| 欧美日韩二区三区| 久久精品久久99精品久久| 日韩欧美一二三四区| 国产自产v一区二区三区c| 久久久精品天堂| 国产成人精品一区二区三区四区| 国产日韩精品久久久| 色综合久久久久久久久| 亚洲一二三四久久| 欧美一区二区三区四区在线观看| 国产最新精品免费| 中文字幕中文乱码欧美一区二区| 成人国产精品免费观看| 亚洲免费观看在线观看| 欧美肥妇bbw| 国产乱对白刺激视频不卡| 《视频一区视频二区| 欧美日韩不卡一区| 国产成人一区在线| 亚洲综合在线观看视频| 欧美一区二区性放荡片| 国产91在线看| 天天亚洲美女在线视频| 国产午夜一区二区三区| 欧美午夜精品理论片a级按摩| 日本午夜精品一区二区三区电影| 日本一区二区视频在线| 欧美色男人天堂| 国产一区二区在线影院| 奇米色一区二区三区四区| 国产欧美一区二区精品婷婷 | 美腿丝袜一区二区三区| 欧美韩国日本综合| 7777精品伊人久久久大香线蕉| 国产九色sp调教91| 亚洲大尺度视频在线观看| 国产欧美日韩在线看| 欧美日韩情趣电影| 成人网在线免费视频| 亚洲成人高清在线| 国产精品第五页| 欧美精品一区男女天堂| 欧美日韩mp4| 91麻豆文化传媒在线观看| 国产精品影视网| 亚洲高清免费一级二级三级| 国产精品免费久久久久| 日韩欧美不卡一区| 777奇米成人网| 欧美性色黄大片| 国产91精品一区二区| 美女网站视频久久| 视频在线观看国产精品| 一区二区三区在线观看网站| 国产色91在线| 精品粉嫩aⅴ一区二区三区四区| 欧美日韩高清一区二区不卡| 欧美自拍丝袜亚洲| 色综合久久天天| 91在线你懂得| www.欧美.com| 成人sese在线| 成人免费高清视频在线观看| 综合中文字幕亚洲| 国产精品卡一卡二| 99re66热这里只有精品3直播| 久久成人免费电影| 日韩二区在线观看| 亚洲chinese男男1069| 亚洲资源在线观看| 亚洲免费在线视频一区 二区| 中文字幕一区二区三区在线播放 | 成人午夜电影久久影院| 国产一二精品视频| 国模套图日韩精品一区二区| 国产一区二区三区综合| 国内不卡的二区三区中文字幕| 国产一区二区视频在线播放| 国产一区二区在线影院| 懂色av一区二区在线播放| 国产福利视频一区二区三区| 精一区二区三区| 精品一区二区三区免费| 国产一区二区三区电影在线观看| 日本伊人午夜精品| 久久精品噜噜噜成人av农村| 国产老妇另类xxxxx| 国产不卡视频一区二区三区| 成人免费高清在线观看| 色综合久久久久网| 91精品国产综合久久久久久| 日韩情涩欧美日韩视频| 久久久久成人黄色影片| 中文字幕一区二区三区av | 亚洲一区在线看| 日韩精品一区第一页| 久久99国产精品尤物| 国产成人av影院| 日本黄色一区二区| 777久久久精品| 国产亲近乱来精品视频| 亚洲精品国产a久久久久久| 亚洲va中文字幕| 国产又粗又猛又爽又黄91精品| 成人av网址在线观看| 欧美系列日韩一区| 精品奇米国产一区二区三区| 亚洲国产成人午夜在线一区| 艳妇臀荡乳欲伦亚洲一区| 久久精品国产77777蜜臀| 成人精品电影在线观看| 欧美三级蜜桃2在线观看| 精品久久久久久久一区二区蜜臀| 国产精品视频一区二区三区不卡| 亚洲综合清纯丝袜自拍| 久草在线在线精品观看| 972aa.com艺术欧美| 日韩美女一区二区三区| 亚洲天堂a在线| 精品一区二区三区在线观看国产 | 国产成a人无v码亚洲福利| 日本福利一区二区| 久久久国产一区二区三区四区小说 | 精品亚洲aⅴ乱码一区二区三区| 成人av电影免费观看| 欧美乱熟臀69xxxxxx| 欧美国产禁国产网站cc| 日韩不卡一区二区| 不卡的电视剧免费网站有什么| 91精品国产麻豆| 亚洲猫色日本管| 国产精品主播直播| 56国语精品自产拍在线观看| 国产精品久久久久久久久果冻传媒 | 日韩精品一区二区三区视频| 亚洲欧美偷拍卡通变态| 国产一区二区三区av电影| 91精品中文字幕一区二区三区| 成人免费一区二区三区视频| 韩国av一区二区三区| 欧美成人福利视频| 天天做天天摸天天爽国产一区| 成人精品免费看| 26uuu色噜噜精品一区| 日韩国产在线观看一区| 在线观看免费成人| 国产精品卡一卡二| 福利一区在线观看| 国产亚洲精品久| 久久国产剧场电影| 日韩精品中文字幕一区| 日本vs亚洲vs韩国一区三区二区 | 欧美不卡视频一区| 日韩1区2区3区| 欧美视频在线一区二区三区| 国产精品国产三级国产普通话99 | 成av人片一区二区| 久久精品夜夜夜夜久久| 国产在线精品免费av| 精品成人免费观看| 精品一区二区在线视频| 精品国产不卡一区二区三区| 久久成人久久鬼色| 久久综合成人精品亚洲另类欧美| 精品在线一区二区| 337p粉嫩大胆噜噜噜噜噜91av| 久久精品999| 久久在线免费观看| 国产成人在线影院| 一色屋精品亚洲香蕉网站| 99久久精品国产观看| 亚洲女与黑人做爰| 欧美性做爰猛烈叫床潮| 视频一区视频二区中文字幕| 欧美视频中文一区二区三区在线观看| 亚洲va欧美va国产va天堂影院| 欧美三级中文字幕在线观看| 天天综合天天综合色| 欧美电影免费提供在线观看| 国产精品中文字幕欧美| 中文一区二区完整视频在线观看 | 国产一区二区三区久久悠悠色av| 26uuu另类欧美| 99视频一区二区三区| 18欧美亚洲精品| 欧美日韩国产欧美日美国产精品| 日韩国产高清在线| 国产欧美一区在线| 91丨国产丨九色丨pron| 三级影片在线观看欧美日韩一区二区| 日韩欧美电影一二三| 国产成人亚洲综合a∨猫咪| 最新国产成人在线观看|