• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

             1 // Color.h
             2 // Colorref's to use with your Programs
             3 
             4 #define RED        RGB(127,  0,  0)
             5 #define GREEN      RGB(  0,127,  0)
             6 #define BLUE       RGB(  0,  0,127)
             7 #define LIGHTRED   RGB(255,  0,  0)
             8 #define LIGHTGREEN RGB(  0,255,  0)
             9 #define LIGHTBLUE  RGB(  0,  0,255)
            10 #define BLACK      RGB(  0,  0,  0)
            11 #define WHITE      RGB(255,255,255)
            12 #define GRAY       RGB(192,192,192)
            13 
            14 ///////////////////////////////////////////
            15 
            16 
            17 #include "color.h"
            18 /////////////////////////////////////////////////////////////////////////////
            19 // CColorStatic window
            20 class CColorStatic : public CStatic
            21 {
            22 // Construction
            23 public:
            24     void SetTextColor(COLORREF crColor); // This Function is to set the Color for the Text.
            25     void SetBkColor(COLORREF crColor); // This Function is to set the BackGround Color for the Text.
            26     CColorStatic();
            27 
            28 // Overrides
            29     // ClassWizard generated virtual function overrides
            30     //{{AFX_VIRTUAL(CColorStatic)
            31     //}}AFX_VIRTUAL
            32 
            33     virtual ~CColorStatic();
            34 
            35     // Generated message map functions
            36 protected:
            37     //{{AFX_MSG(CColorStatic)
            38 
            39     CBrush m_brBkgnd; // Holds Brush Color for the Static Text
            40     COLORREF m_crBkColor; // Holds the Background Color for the Text
            41     COLORREF m_crTextColor; // Holds the Color for the Text
            42 
            43     afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor);
            44     //}}AFX_MSG
            45 
            46     DECLARE_MESSAGE_MAP()
            47 };
            48 
            49 



             1 // ColorEdit.cpp : implementation file
             2 //
             3 
             4 #include "stdafx.h"
             5 #include "ColorEdit.h"
             6 #include "Color.h" // File Holding (#define)'s for COLORREF Values
             7 
             8 #ifdef _DEBUG
             9 #define new DEBUG_NEW
            10 #undef THIS_FILE
            11 static char THIS_FILE[] = __FILE__;
            12 #endif
            13 
            14 /////////////////////////////////////////////////////////////////////////////
            15 // CColorEdit
            16 
            17 CColorEdit::CColorEdit()
            18 {
            19     m_crBkColor = ::GetSysColor(COLOR_3DFACE); // Initializing background color to the system face color.
            20     m_crTextColor = BLACK; // Initializing text color to black
            21     m_brBkgnd.CreateSolidBrush(m_crBkColor); // Creating the Brush Color For the Edit Box Background
            22 }
            23 
            24 CColorEdit::~CColorEdit()
            25 {
            26 }
            27 
            28 
            29 BEGIN_MESSAGE_MAP(CColorEdit, CEdit)
            30     //{{AFX_MSG_MAP(CColorEdit)
            31     ON_WM_CTLCOLOR_REFLECT()
            32     //}}AFX_MSG_MAP
            33 END_MESSAGE_MAP()
            34 
            35 /////////////////////////////////////////////////////////////////////////////
            36 // CColorEdit message handlers
            37 
            38 void CColorEdit::SetTextColor(COLORREF crColor)
            39 {
            40     m_crTextColor = crColor; // Passing the value passed by the dialog to the member varaible for Text Color
            41     RedrawWindow();
            42 }
            43 
            44 void CColorEdit::SetBkColor(COLORREF crColor)
            45 {
            46     m_crBkColor = crColor; // Passing the value passed by the dialog to the member varaible for Backgound Color
            47     m_brBkgnd.DeleteObject(); // Deleting any Previous Brush Colors if any existed.
            48     m_brBkgnd.CreateSolidBrush(crColor); // Creating the Brush Color For the Edit Box Background
            49     RedrawWindow();
            50 }
            51 
            52 
            53 
            54 HBRUSH CColorEdit::CtlColor(CDC* pDC, UINT nCtlColor)
            55 {
            56     HBRUSH hbr;
            57     hbr = (HBRUSH)m_brBkgnd; // Passing a Handle to the Brush
            58     pDC->SetBkColor(m_crBkColor); // Setting the Color of the Text Background to the one passed by the Dialog
            59     pDC->SetTextColor(m_crTextColor); // Setting the Text Color to the one Passed by the Dialog
            60 
            61     if (nCtlColor)       // To get rid of compiler warning
            62       nCtlColor += 0;
            63 
            64     return hbr;
            65 }
            66 
            67 BOOL CColorEdit::SetReadOnly(BOOL flag)
            68 {
            69    if (flag == TRUE)
            70       SetBkColor(m_crBkColor);
            71    else
            72       SetBkColor(WHITE);
            73 
            74    return CEdit::SetReadOnly(flag);
            75 }
            76 
            77 
            Posted on 2007-04-13 16:50 艾凡赫 閱讀(3307) 評(píng)論(0)  編輯 收藏 引用 所屬分類(lèi): MFC技術(shù)
            国产产无码乱码精品久久鸭| 亚洲中文久久精品无码| 精品免费久久久久久久| 伊人久久大香线焦综合四虎| 久久久久亚洲av毛片大| 久久国产AVJUST麻豆| 日产精品久久久久久久性色| 久久国产精品偷99| 久久久久久久女国产乱让韩| 久久久91精品国产一区二区三区| 久久国产高清一区二区三区| 亚洲AV日韩精品久久久久久| 99久久99久久精品国产片果冻 | 久久久久久久99精品免费观看| 亚洲午夜久久影院| av色综合久久天堂av色综合在| 久久婷婷国产麻豆91天堂| 无码乱码观看精品久久| 蜜桃麻豆www久久| 久久亚洲中文字幕精品有坂深雪| 久久99精品国产麻豆蜜芽| 久久精品九九亚洲精品| 人人妻久久人人澡人人爽人人精品| 久久精品国内一区二区三区 | 久久狠狠色狠狠色综合| 久久久久久国产精品美女| 人人狠狠综合久久亚洲高清| 国产精品久久久久无码av| 久久人人爽爽爽人久久久| 久久久久亚洲av成人无码电影| 久久久青草久久久青草| 国产成人久久精品激情| 狠狠色婷婷久久一区二区三区| 久久AV高潮AV无码AV| 久久www免费人成看片| 久久亚洲精品成人无码网站| 久久经典免费视频| 精品熟女少妇AV免费久久| 亚洲AV成人无码久久精品老人| 99久久这里只精品国产免费| 精品久久久久久无码不卡|