2 * Copyright (c) 2001-2002 Paolo Messina and Jerzy Kaczorowski
\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
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
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
20 #endif // _MSC_VER > 1000
\r
21 // OddButton.h : header file
\r
24 /// Control's type mask
\r
25 #define ODDBTN_BS_TYPEMASK 0x0000000FL
\r
27 /////////////////////////////////////////////////////////////////////////////
\r
28 // COddButton window
\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
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
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
44 class COddButton : public CButton
\r
57 // ClassWizard generated virtual function overrides
\r
58 //{{AFX_VIRTUAL(COddButton)
\r
60 virtual void PreSubclassWindow();
\r
65 virtual ~COddButton();
\r
67 // Generated message map functions
\r
69 //{{AFX_MSG(COddButton)
\r
70 afx_msg UINT OnGetDlgCode();
\r
72 afx_msg LRESULT OnSetStyle(WPARAM wParam, LPARAM lParam);
\r
74 DECLARE_MESSAGE_MAP()
\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
85 /// Use to enable or disable default state handling
\r
86 void EnableDefault(BOOL bEnable);
\r
88 /// Use to know whether the control has a default state
\r
89 BOOL IsDefault() const;
\r
91 /// Use to know the type of control to draw
\r
92 UINT GetControlType() const;
\r
95 /// Use to set the dialog's default pushbutton
\r
96 static void SetDefID(CDialog* pDialog, const UINT nID);
\r
99 /////////////////////////////////////////////////////////////////////////////
\r
101 //{{AFX_INSERT_LOCATION}}
\r
102 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
\r
104 #endif // !defined(AFX_ODDBUTTON_H__4CA1E42E_E3C3_4FEA_99A1_E865DEB500DA__INCLUDED_)
\r