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

CDlg Class Reference

#include <dlg.h>

Inheritance diagram for CDlg:

CResizeDlg CScaleDlg List of all members.

Public Member Functions

void SetInstance (HINSTANCE hInst)
void SetDlgID (UINT id)
void Destroy ()
 CDlg (int DlgID, HWND hWndParent, HINSTANCE hInst)
 ~CDlg ()
HWND GetWindow () const
HWND GetParent () const
HWND GetDlgItem (int iD) const
HINSTANCE GetInstance () const
BOOL EndDialog (int iRet)
int Do ()
virtual BOOL CALLBACK DlgProc (HWND hDlg, UINT uMessage, WPARAM wParam, LPARAM lParam)
virtual int DoCommand (WORD wCmdID, WORD hHow)
virtual void OnInit ()
virtual int DoNotify (NMHDR *pHdr)
HWND CreateModeless ()

Protected Member Functions

void SetWindow (HWND hDlg)

Static Protected Member Functions

BOOL CALLBACK BaseDlgProc (HWND hDlg, UINT uMessage, WPARAM wParam, LPARAM lParam)

Private Attributes

BOOL m_bCreatedModeless
int m_DlgID
HWND m_hDlg
HWND m_hParent
HINSTANCE m_Inst

Constructor & Destructor Documentation

CDlg::CDlg int  DlgID,
HWND  hWndParent,
HINSTANCE  hInst
 

Definition at line 87 of file dlg.cpp.

References CDlg(), FALSE, hInst, and hWnd.

Referenced by CDlg().

00088 : m_DlgID(DlgID), 00089 m_hParent(hWnd), 00090 m_Inst(hInst), 00091 m_bCreatedModeless(FALSE), 00092 m_hDlg(0) 00093 { 00094 }

CDlg::~CDlg  ) 
 

Definition at line 130 of file dlg.cpp.

References DestroyWindow, and m_hDlg.

00131 { 00132 if(m_hDlg) 00133 DestroyWindow(m_hDlg); 00134 }


Member Function Documentation

BOOL CALLBACK CDlg::BaseDlgProc HWND  hDlg,
UINT  uMessage,
WPARAM  wParam,
LPARAM  lParam
[static, protected]
 

Definition at line 20 of file dlg.cpp.

References BaseDlgProc(), BOOL, Destroy(), DlgProc(), DoCommand(), DoNotify(), FALSE, FAR, SetWindow(), and UINT.

Referenced by BaseDlgProc(), CreateModeless(), and Do().

00021 { 00022 CDlg * pSV = (CDlg*)GetWindowLong(hDlg,DWL_USER); 00023 00024 switch (uMessage) 00025 { 00026 case WM_INITDIALOG: 00027 { 00028 pSV=(CDlg*)lParam; 00029 pSV->SetWindow(hDlg); 00030 SetWindowLong(hDlg,DWL_USER,(LPARAM)pSV); 00031 pSV->OnInit(); 00032 } 00033 break; 00034 00035 // Override the Do Command to get a nice wrapped up feeling. 00036 case WM_COMMAND: 00037 if(pSV) 00038 return pSV->DoCommand(LOWORD(wParam),HIWORD(wParam)); 00039 break; 00040 00041 case WM_NOTIFY: 00042 if(pSV) 00043 return pSV->DoNotify((NMHDR FAR *)lParam); 00044 break; 00045 00046 case WM_DESTROY: 00047 if(pSV) 00048 pSV->Destroy(); 00049 break; 00050 } 00051 00052 if(pSV) 00053 return pSV->DlgProc(hDlg,uMessage,wParam,lParam); 00054 else 00055 return FALSE; 00056 }

HWND CDlg::CreateModeless  ) 
 

Definition at line 105 of file dlg.cpp.

References BaseDlgProc(), hWnd, m_bCreatedModeless, m_DlgID, m_hDlg, m_hParent, m_Inst, and TRUE.

00106 { 00107 if(m_hDlg) 00108 return m_hDlg; 00109 00110 HWND hWnd=CreateDialogParam(m_Inst, MAKEINTRESOURCE(m_DlgID), m_hParent, (DLGPROC)BaseDlgProc, (LPARAM)this); 00111 if(hWnd) 00112 m_bCreatedModeless=TRUE; 00113 return hWnd; 00114 }

void CDlg::Destroy  ) 
 

Definition at line 121 of file dlg.cpp.

References m_bCreatedModeless, m_hDlg, and NULL.

Referenced by BaseDlgProc().

00122 { 00123 if(m_bCreatedModeless) 00124 { 00125 if(m_hDlg) 00126 m_hDlg=NULL; 00127 } 00128 }

BOOL CALLBACK CDlg::DlgProc HWND  hDlg,
UINT  uMessage,
WPARAM  wParam,
LPARAM  lParam
[virtual]
 

Reimplemented in CResizeDlg.

Definition at line 62 of file dlg.cpp.

References BOOL, DlgProc(), and FALSE.

Referenced by BaseDlgProc(), and DlgProc().

00063 { 00064 return FALSE; 00065 }

int CDlg::Do  ) 
 

Definition at line 99 of file dlg.cpp.

References BaseDlgProc(), FALSE, m_bCreatedModeless, m_DlgID, m_hParent, and m_Inst.

00100 { 00101 m_bCreatedModeless=FALSE; 00102 return DialogBoxParam( m_Inst, MAKEINTRESOURCE(m_DlgID), m_hParent, (DLGPROC)BaseDlgProc, (LPARAM)this); 00103 }

int CDlg::DoCommand WORD  wCmdID,
WORD  hHow
[virtual]
 

Definition at line 71 of file dlg.cpp.

References DoCommand(), and EndDialog().

Referenced by BaseDlgProc(), and DoCommand().

00072 { 00073 switch( wCmdID ) 00074 { 00075 case IDOK: 00076 case IDCANCEL: 00077 EndDialog(wCmdID); 00078 break; 00079 } 00080 return 1; // not handled, just did Apply work. 00081 }

int CDlg::DoNotify NMHDR *  pHdr  )  [virtual]
 

Definition at line 116 of file dlg.cpp.

References DoNotify(), and FALSE.

Referenced by BaseDlgProc(), and DoNotify().

00117 { 00118 return FALSE; 00119 }

BOOL CDlg::EndDialog int  iRet  )  [inline]
 

Definition at line 25 of file dlg.h.

References BOOL, EndDialog(), and m_hDlg.

00025 { return ::EndDialog(m_hDlg,iRet); }

HWND CDlg::GetDlgItem int  iD  )  const [inline]
 

Definition at line 23 of file dlg.h.

References GetDlgItem(), and m_hDlg.

00023 { return ::GetDlgItem(m_hDlg,iD); }

HINSTANCE CDlg::GetInstance  )  const [inline]
 

Definition at line 24 of file dlg.h.

References m_Inst.

00024 { return m_Inst;}

HWND CDlg::GetParent  )  const [inline]
 

Definition at line 22 of file dlg.h.

References GetParent(), and m_hDlg.

00022 { return ::GetParent(m_hDlg); }

HWND CDlg::GetWindow  )  const [inline]
 

Definition at line 21 of file dlg.h.

References m_hDlg.

Referenced by CResizeDlg::AddGripper(), CResizeDlg::Annotate(), CResizeDlg::DeterminNumberOfControls(), CScaleDlg::DeterminWeights(), CResizeDlg::DoChangePos(), CResizeDlg::FindControls(), CScaleDlg::ResizeControls(), CResizeDlg::SetGripperPos(), and CResizeDlg::WalkControls().

00021 { return m_hDlg; }

void CDlg::OnInit  )  [virtual]
 

Definition at line 83 of file dlg.cpp.

00084 { 00085 }

void CDlg::SetDlgID UINT  id  ) 
 

Definition at line 136 of file dlg.cpp.

References m_DlgID, and SetDlgID().

Referenced by SetDlgID().

00137 { 00138 m_DlgID=id; 00139 }

void CDlg::SetInstance HINSTANCE  hInst  ) 
 

Definition at line 141 of file dlg.cpp.

References hInst, m_Inst, and SetInstance().

Referenced by SetInstance().

00142 { 00143 m_Inst=hInst; 00144 }

void CDlg::SetWindow HWND  hDlg  )  [inline, protected]
 

Definition at line 43 of file dlg.h.

References m_hDlg, and SetWindow().

Referenced by BaseDlgProc(), and SetWindow().

00043 { m_hDlg=hDlg; }


Member Data Documentation

BOOL CDlg::m_bCreatedModeless [private]
 

Definition at line 36 of file dlg.h.

Referenced by CreateModeless(), Destroy(), and Do().

int CDlg::m_DlgID [private]
 

Definition at line 37 of file dlg.h.

Referenced by CreateModeless(), Do(), and SetDlgID().

HWND CDlg::m_hDlg [private]
 

Definition at line 38 of file dlg.h.

Referenced by CreateModeless(), Destroy(), EndDialog(), GetDlgItem(), GetParent(), GetWindow(), SetWindow(), and ~CDlg().

HWND CDlg::m_hParent [private]
 

Definition at line 39 of file dlg.h.

Referenced by CreateModeless(), and Do().

HINSTANCE CDlg::m_Inst [private]
 

Definition at line 40 of file dlg.h.

Referenced by CreateModeless(), Do(), GetInstance(), and SetInstance().


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