OSDN Git Service

Change Dir Structure to be same as TortoiseSVN'
[tortoisegit/TortoiseGitJp.git] / src / Utils / MiscUI / OddButton.h
1 /*\r
2  * Copyright (c) 2001-2002 Paolo Messina and Jerzy Kaczorowski\r
3  * \r
4  * The contents of this file are subject to the Artistic License (the "License").\r
5  * You may not use this file except in compliance with the License. \r
6  * You may obtain a copy of the License at:\r
7  * http://www.opensource.org/licenses/artistic-license.html\r
8  * \r
9  * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED \r
10  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF \r
11  * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.\r
12  * \r
13  */\r
14 \r
15 #if !defined(AFX_ODDBUTTON_H__4CA1E42E_E3C3_4FEA_99A1_E865DEB500DA__INCLUDED_)\r
16 #define AFX_ODDBUTTON_H__4CA1E42E_E3C3_4FEA_99A1_E865DEB500DA__INCLUDED_\r
17 \r
18 #if _MSC_VER > 1000\r
19 #pragma once\r
20 #endif // _MSC_VER > 1000\r
21 // OddButton.h : header file\r
22 //\r
23 \r
24 /// Control's type mask\r
25 #define ODDBTN_BS_TYPEMASK 0x0000000FL\r
26 \r
27 /////////////////////////////////////////////////////////////////////////////\r
28 // COddButton window\r
29 \r
30 /*!\r
31         \brief Owner-Draw Default Button is a base class for owner-draw buttons that provides basic \r
32         support for default state handling.\r
33 \r
34         Derived class can indicate the default state when appropriate simply by calling \r
35         COddButton::IsDefault method to determine the default state and using \r
36         any visual effect (e.g. a thin black frame around the button) when it becomes default.\r
37 \r
38         \note A special static method COddButton::SetDefID can be used to set the default button \r
39         for the dialog to work around the problems with using a CDialog::SetDefID described in MS kb Q67655 \r
40         (<A HREF="http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q67655&">\r
41         HOWTO: Change or Set the Default Push Button in a Dialog Box\r
42         </A>)\r
43 */\r
44 class COddButton : public CButton\r
45 {\r
46 // Construction\r
47 public:\r
48         COddButton();\r
49 \r
50 // Attributes\r
51 public:\r
52 \r
53 // Operations\r
54 public:\r
55 \r
56 // Overrides\r
57         // ClassWizard generated virtual function overrides\r
58         //{{AFX_VIRTUAL(COddButton)\r
59         protected:\r
60         virtual void PreSubclassWindow();\r
61         //}}AFX_VIRTUAL\r
62 \r
63 // Implementation\r
64 public:\r
65         virtual ~COddButton();\r
66 \r
67 // Generated message map functions\r
68 protected:\r
69         //{{AFX_MSG(COddButton)\r
70         afx_msg UINT OnGetDlgCode();\r
71         //}}AFX_MSG\r
72         afx_msg LRESULT OnSetStyle(WPARAM wParam, LPARAM lParam);\r
73         \r
74         DECLARE_MESSAGE_MAP()\r
75 \r
76 private:\r
77         // Data members\r
78         BOOL m_bCanBeDefault;   /*!< TRUE to enable default state handling */\r
79         BOOL m_bDefault;                /*!< Set to TRUE when control has default state */\r
80         UINT m_nTypeStyle;              /*!< Type of control */\r
81 \r
82 protected:\r
83 // Interface\r
84         \r
85         /// Use to enable or disable default state handling     \r
86         void EnableDefault(BOOL bEnable);\r
87 \r
88         /// Use to know whether the control has a default state\r
89         BOOL IsDefault() const;\r
90 \r
91         /// Use to know the type of control to draw\r
92         UINT GetControlType() const;\r
93 \r
94 public:\r
95         /// Use to set the dialog's default pushbutton\r
96         static void SetDefID(CDialog* pDialog, const UINT nID);\r
97 };\r
98 \r
99 /////////////////////////////////////////////////////////////////////////////\r
100 \r
101 //{{AFX_INSERT_LOCATION}}\r
102 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.\r
103 \r
104 #endif // !defined(AFX_ODDBUTTON_H__4CA1E42E_E3C3_4FEA_99A1_E865DEB500DA__INCLUDED_)\r