CCheckableGroupBox Class Reference

Aktivierbare/Deaktivierbare Groupbox. More...

#include <CheckableGroupBox.h>

List of all members.

Public Member Functions

 CCheckableGroupBox ()
void SetTitleStyle (UINT style=BS_AUTOCHECKBOX)
int GetCheck () const
void SetCheck (int nCheck)
void SetGroupID (UINT nGroup)
UINT GetGroupID () const
virtual ~CCheckableGroupBox ()

Protected Member Functions

afx_msg void OnEnable (BOOL bEnable)
afx_msg void OnSetFocus (CWnd *pOldWnd)
afx_msg void OnClicked ()
afx_msg LRESULT OnGetCheck (WPARAM, LPARAM)
afx_msg LRESULT OnSetCheck (WPARAM, LPARAM)
void CheckGroupboxControls ()

Protected Attributes

CButton m_TitleBox
UINT m_nGroupID


Detailed Description

Aktivierbare/Deaktivierbare Groupbox.

Lots of time we want to disable a set of controls in our dialog. Group box is a good control to categorise a few controls together, but unfortunately it cannot enable/disable his controls. I extended CButton class and made it very simple to accomplish and it is encapsulated into one class.

So you can change the title of a group box into a check box or radio button ( then you need more group box of course).

I must confess I borrowed some idea of other talented programmers.

How to use it

1. Draw a group box in resource editor as usual. In resource editor, change the style property of group box to icon or bitmap, this prevents Overlapped text when tab is pressed. 2. Add a member variable for this added group box, but choose CCheckableGroupBox as control type. 3. In OnInitDialog(), call m_yourVariable.SetTitleStyle(BS_AUTOCHECKBOX); to change normal title to a check box, or use BS_AUTORADIOBUTTON for radio box. 4. If you want a group of group box toggle by radio box title, just create more Checkable group box as you already did, and call SetGroupID to give them a group! 5. In updated version of this control, I support DDX_Check, which means now you can use UpdateData to update and save the state of check box in an standard MFC fashion.

History Updated (21/11/03) - Supports windows WM_ENABLE message. Now you can call EnableWindow() to disable the whole group! Updated (24/11/03) - Supports DDX_Check for variable exchange. Please refer to demo project for details. Updated (28/11/03) - Support BN_CLICKED message when user click title box.


Constructor & Destructor Documentation

CCheckableGroupBox::CCheckableGroupBox  ) 
 

CCheckableGroupBox::~CCheckableGroupBox  )  [virtual]
 


Member Function Documentation

void CCheckableGroupBox::CheckGroupboxControls  )  [protected]
 

int CCheckableGroupBox::GetCheck  )  const
 

UINT CCheckableGroupBox::GetGroupID  )  const
 

void CCheckableGroupBox::OnClicked  )  [protected]
 

If current m_TitleBox is a radio button, search all controls in current parent window, uncheck all other radio buttons if they have the same group id

void CCheckableGroupBox::OnEnable BOOL  bEnable  )  [protected]
 

LRESULT CCheckableGroupBox::OnGetCheck WPARAM  ,
LPARAM 
[protected]
 

LRESULT CCheckableGroupBox::OnSetCheck WPARAM  ,
LPARAM 
[protected]
 

void CCheckableGroupBox::OnSetFocus CWnd *  pOldWnd  )  [protected]
 

void CCheckableGroupBox::SetCheck int  nCheck  ) 
 

void CCheckableGroupBox::SetGroupID UINT  nGroup  ) 
 

void CCheckableGroupBox::SetTitleStyle UINT  style = BS_AUTOCHECKBOX  ) 
 


Member Data Documentation

UINT CCheckableGroupBox::m_nGroupID [protected]
 

CButton CCheckableGroupBox::m_TitleBox [protected]
 


The documentation for this class was generated from the following files:
Generated on Wed Dec 7 00:31:16 2005 for Volviser by  doxygen 1.4.5