Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // bool to button state
- #ifndef BOOL2BST
- #define BOOL2BST(iState,bSet) (iState =( bSet ? BST_CHECKED : BST_UNCHECKED ) )
- #endif
- #ifndef BST2BOOL
- #define BST2BOOL(iState,bSet) ( bSet = ( iState == BST_CHECKED ) )
- #endif
- class COptionsDlgPage: public CPropertyPageImpl<COptionsDlgPage>,
- public CWinDataExchange<COptionsDlgPage>
- {
- typedef CPropertyPageImpl<COptionsDlgPage> _baseClass;
- public:
- //DECLARE_WND_CLASS(_T("NO5OptionsDlg"));
- bool m_bAllowCTCP;
- int m_iAllowCTCP;
- public:
- COptionsDlgPage():_baseClass(_T("General"))
- {
- m_bAllowCTCP = false;
- m_iAllowCTCP = BST_UNCHECKED;
- //BOOL2BST(m_iAllowCTCP,m_bAllowCTCP);
- }
- enum { IDD = IDD_PROPPAGE_SMALL };
- BEGIN_DDX_MAP(COptionsDlgPage)
- DDX_CHECK(IDC_CHECK1,m_iAllowCTCP)
- END_DDX_MAP()
- BEGIN_MSG_MAP(COptionsDlg)
- MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
- COMMAND_ID_HANDLER(IDC_CHECK1, OnCheck)
- //FORWARD_NOTIFICATIONS();
- CHAIN_MSG_MAP(_baseClass)
- //CHAIN_MSG_MAP(CWinDataExchange<COptionsDlgPage>)
- END_MSG_MAP()
- LRESULT OnInitDialog(UINT, WPARAM, LPARAM, BOOL& bHandled)
- {
- BOOL2BST(m_iAllowCTCP, m_bAllowCTCP);
- DoDataExchange(DDX_LOAD);
- bHandled = FALSE;
- return 0;
- }
- int OnApply()
- {
- DoDataExchange(DDX_SAVE);
- BST2BOOL(m_iAllowCTCP, m_bAllowCTCP);
- return PSNRET_NOERROR;
- }
- LRESULT OnCheck(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
- {
- SetModified();
- return 0;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement