Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

CAdvancedPage Class Reference

#include <propdlg.h>

Inheritance diagram for CAdvancedPage:

CDialog List of all members.

Public Member Functions

 CAdvancedPage (CProfilePropertySheet *pcppsBoss)
 ~CAdvancedPage ()
virtual BOOL OnInit ()
virtual BOOL OnCommand (WORD wNotifyCode, WORD wid, HWND hwndCtl)

Private Member Functions

void Update ()

Private Attributes

CProfilePropertySheetm_cppsBoss

Constructor & Destructor Documentation

CAdvancedPage::CAdvancedPage CProfilePropertySheet pcppsBoss  ) 
 

Definition at line 73 of file propdlg.cpp.

References CAdvancedPage().

Referenced by CAdvancedPage().

00073 : 00074 CDialog(pcpps -> Instance(), AdvancedPage, pcpps -> Window()), 00075 m_cppsBoss(*pcpps){ }

CAdvancedPage::~CAdvancedPage  ) 
 

Definition at line 79 of file propdlg.cpp.

00079 {}


Member Function Documentation

BOOL CAdvancedPage::OnCommand WORD  wNotifyCode,
WORD  wid,
HWND  hwndCtl
[virtual]
 

Reimplemented from CDialog.

Definition at line 124 of file propdlg.cpp.

References AddDeviceButton, BOOL, DeviceListControl, CProfilePropertySheet::Dissociate(), EnableWindow(), FALSE, GetDlgItem(), m_cppsBoss, OnCommand(), RemoveDeviceButton, SendDlgItemMessage(), SendMessage(), TRUE, and Update().

Referenced by OnCommand().

00124 { 00125 00126 switch (wid) { 00127 00128 case AddDeviceButton: 00129 00130 if (wNotifyCode == BN_CLICKED) { 00131 CAddDeviceDialog cadd(m_cppsBoss, m_hwnd); 00132 Update(); 00133 return TRUE; 00134 } 00135 break; 00136 00137 case RemoveDeviceButton: 00138 00139 if (wNotifyCode == BN_CLICKED) { 00140 00141 int i = SendDlgItemMessage(m_hwnd, DeviceListControl, 00142 LB_GETCURSEL, 0, 0); 00143 00144 if (i == -1) 00145 return TRUE; 00146 00147 unsigned uItem = SendDlgItemMessage(m_hwnd, DeviceListControl, 00148 LB_GETITEMDATA, i, 0); 00149 m_cppsBoss.Dissociate(uItem); 00150 Update(); 00151 return TRUE; 00152 } 00153 break; 00154 00155 case DeviceListControl: 00156 switch (wNotifyCode) { 00157 00158 case LBN_SELCHANGE: 00159 EnableWindow(GetDlgItem(m_hwnd, RemoveDeviceButton), 00160 -1 != SendMessage(hwndCtl, LB_GETCURSEL, 0, 0)); 00161 return TRUE; 00162 } 00163 break; 00164 } 00165 00166 return FALSE; 00167 }

BOOL CAdvancedPage::OnInit  )  [virtual]
 

Reimplemented from CDialog.

Definition at line 112 of file propdlg.cpp.

References BOOL, CProfile::GetName(), m_cppsBoss, CProfilePropertySheet::Profile(), SetDlgItemText(), TRUE, and Update().

00112 { 00113 00114 SetDlgItemText(m_hwnd, ProfileNameControl, m_cppsBoss.Profile().GetName()); 00115 00116 // Add the associations to the list, etc. 00117 00118 Update(); 00119 return TRUE; 00120 }

void CAdvancedPage::Update  )  [private]
 

Definition at line 84 of file propdlg.cpp.

References AddDeviceButton, CProfilePropertySheet::Association(), CProfile::AssociationCount(), CProfilePropertySheet::AssociationCount(), CProfile::DeviceCount(), DeviceListControl, CProfilePropertySheet::DisplayName(), EnableWindow(), GetDlgItem(), m_cppsBoss, CProfilePropertySheet::Profile(), RemoveDeviceButton, and SendDlgItemMessage().

Referenced by OnCommand(), and OnInit().

00084 { 00085 00086 // Add the associations to the list 00087 00088 SendDlgItemMessage(m_hwnd, DeviceListControl, LB_RESETCONTENT, 0, 0); 00089 00090 for (unsigned u = m_cppsBoss.AssociationCount(); u--; ) { 00091 int iItem = SendDlgItemMessage(m_hwnd, DeviceListControl, LB_ADDSTRING, 00092 0, (LPARAM) m_cppsBoss.DisplayName(u)); 00093 SendDlgItemMessage(m_hwnd, DeviceListControl, LB_SETITEMDATA, iItem, 00094 (LPARAM) m_cppsBoss.Association(u)); 00095 } 00096 00097 // If there are no associations, disable the Remove Devices button 00098 00099 EnableWindow(GetDlgItem(m_hwnd, RemoveDeviceButton), 00100 m_cppsBoss.Profile().AssociationCount()); 00101 00102 // If there are no devices, or all are associated, disable the Add 00103 // Devices button. 00104 00105 EnableWindow(GetDlgItem(m_hwnd, AddDeviceButton), 00106 m_cppsBoss.Profile().DeviceCount() && 00107 m_cppsBoss.Profile().DeviceCount() > m_cppsBoss.AssociationCount()); 00108 }


Member Data Documentation

CProfilePropertySheet& CAdvancedPage::m_cppsBoss [private]
 

Definition at line 62 of file propdlg.h.

Referenced by OnCommand(), OnInit(), and Update().


The documentation for this class was generated from the following files:
Generated on Sat May 15 19:46:26 2004 for test by doxygen 1.3.7