mrDarker
2025-07-24 98d66db6f691dcffd21f77130c138f710704b14c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#if !defined(AFX_WKBUTTON_H__99FB32BE_6D54_4845_BD51_1BC64E774CC6__INCLUDED_)
#define AFX_WKBUTTON_H__99FB32BE_6D54_4845_BD51_1BC64E774CC6__INCLUDED_
 
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// WKButton.h : header file
/******************************< ÇÁ·Î±×·¥ Á¤º¸ >****************************/
/*   Å¬ ·¡ ½º ¸í : WKButton                                                */ 
/*   ¹ö       Àü :                                                         */
/*   ÃÖÁ¾ ¼öÁ¤ÀÏ : 2006. 05. 28                                            */
/***************************************************************************/
 
/////////////////////////////////< Á¤  ÀÇ >//////////////////////////////////
 
// ¹öư ÇüÅÂ
#define        WK_BUTTON_SHPAE_RECTANGLE                0x0001
#define        WK_BUTTON_SHAPE_CIRCLE                    0x0002
#define        WK_BUTTON_SHAPE_ROUNDRECT                0x0004
 
// ¹öư »ö»ó
#define        WK_BUTTON_COLOR_ONE                        0x0001
#define        WK_BUTTON_COLOR_TWO                        0x0002
#define        WK_BUTTON_COLOR_GRADATION_UP            0x0011
#define        WK_BUTTON_COLOR_GRADATION_RIGHT            0x0012
#define        WK_BUTTON_COLOR_GRADATION_DOWN            0x0014
#define        WK_BUTTON_COLOR_GRADATION_LEFT            0x0018
 
// ¹öư »óÅÂ
#define        WK_BUTTON_STATUS_MOUSEOVER                0x0001
#define        WK_BUTTON_STATUS_MOUSELEAVE                0x0002
#define        WK_BUTTON_STATUS_MOUSECLICK                0x0004
 
 
///////////////////////////////< Å¬·¡½º ±¸Á¶ >///////////////////////////////
class AFX_EXT_CLASS CWKButton : public CButton
{
public://<<<<<<<<<<<<<<<<<<<<<< ¿ÜºÎ Á¢±Ù ÇÔ¼ö >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    CWKButton();
    virtual ~CWKButton();
 
    // ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CWKButton)
    public:
    virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
    virtual BOOL Create(LPCTSTR lpszCaption, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
    virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
    virtual BOOL PreTranslateMessage(MSG* pMsg);
    virtual BOOL DestroyWindow();
    protected:
    virtual void PreSubclassWindow();
    //}}AFX_VIRTUAL
public:    
/*****************************< ¹öư ¼³Á¤ ÇÔ¼ö >****************************/
    /* ÅؽºÆ® ¸ð¾ç ¹× ³»¿ë ÁöÁ¤ */
    BOOL SetButtonText(CString strCaption);
    BOOL SetButtonText(CString strCaption, COLORREF rgbText);
    BOOL SetButtonText(CString strCaption, CFont *font, COLORREF rgbText);
    
    /* ¹öư ÇüÅ ¹× »ö»ó ÁöÁ¤ */
    BOOL SetButtonStyle(DWORD dShape, COLORREF rgbColor1);
    BOOL SetButtonStyle(DWORD dShape, DWORD dStyle,    COLORREF rgbColor1,    COLORREF rgbColor2);
    /***************************************************************************/
 
protected://<<<<<<<<<<<<<<<< ³»ºÎ Ã³¸® ÇÔ¼ö ¹× º¯¼ö >>>>>>>>>>>>>>>>>>>>>>>>>
    /* »óź° ¹öư À̹ÌÁö */
    CBitmap m_bmpImage1;    //Æò»ó½Ã
    CBitmap m_bmpImage2;    //¸¶¿ì½º ¿À¹ö
    CBitmap m_bmpImage3;    //Ŭ¸¯
    
    /* »óź° ¹öư À̹ÌÁö »ý¼º */
    BOOL CreateButtonImage();
 
    /* ¹öư ÇüÅ »ý¼º */
    BOOL DrawFormRectangle();    // »ç°¢
    BOOL DrawFormCircle();        // ¿ø
    BOOL DrawFormRoundRect();    // µÕ±Ù»ç°¢
 
    /* À̹ÌÁö Ã³¸® */
    COLORREF LightValueControl(COLORREF rgb, int nValue);                        // »ö»ó ¹à±â Á¶Àý
    void DrawGradation(CBitmap* bmpImage, COLORREF color1, COLORREF color2);    // ±×¶óµ¥À̼ǠÀ̹ÌÁö »ý¼º
    BOOL DrawBorder(CBitmap* pbmpImage, COLORREF color1, COLORREF color2, int nWidth = 2);        // ¹öư Å׵θ® ±×¸®±â
    BOOL DrawText(CBitmap* pBitmap, int nStatus);                                // ¹öư¿¡ ±Û¾¾ ³Ö±â
 
    /* ¹öư À̹ÌÁö Á¤º¸ */
    DWORD m_dShape;            // ¹öư ÇüÅÂ
    DWORD m_dStyle;            // Ä÷¯ ½ºÅ¸ÀÏ
    COLORREF m_rgbColor1;    // Ã¹¹øÂ° Ä÷¯
    COLORREF m_rgbColor2;    // µÎ¹øÂ° Ä÷¯
    CRect m_rtButton;        // ¹öưũ±â
    int m_nWidth;            // ¹öư ³Êºñ
    int m_nHeight;            // ¹öư ³ôÀÌ
 
    /* ÅؽºÆ® Á¤º¸ */
    CString m_strCaption;    // Ä¸¼Ç ³»¿ë
    CFont m_Font;            // Ä¸¼Ç ±Û²Ã
    COLORREF m_rgbText;        // Ä¸¼Ç »ö»ó
    BOOL m_bValueChange;    // Ä¸¼Ç º¯°æ
    
    /* ¹öư »óÅ Á¤º¸ */
    DWORD m_dButtonStatus;
    
    //{{AFX_MSG(CWKButton)
    afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
    afx_msg void OnPaint();
    afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
    afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
    afx_msg void OnMouseMove(UINT nFlags, CPoint point);
    //}}AFX_MSG
 
    DECLARE_MESSAGE_MAP()
};
 
/////////////////////////////////////////////////////////////////////////////
 
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
 
#endif // !defined(AFX_WKBUTTON_H__99FB32BE_6D54_4845_BD51_1BC64E774CC6__INCLUDED_)