CMessageBoxDLG Class Reference

#include <MessageBoxDLG.h>

List of all members.

Public Types

enum  { IDD = IDD_MESG_BOX }

Public Member Functions

 CMessageBoxDLG (LPCTSTR tn=NULL, CWnd *pParent=NULL)
 CMessageBoxDLG (UINT nIDTemplate, LPCTSTR tn=NULL, CWnd *pParent=NULL)
virtual ~CMessageBoxDLG ()
BOOL OnInitDialog ()
void Display (LPCTSTR mesg=NULL)
void Destory (void)
bool isCanceled ()
afx_msg void OnStnClickedMesgBoxText ()
virtual BOOL OnCommand (WPARAM wParam, LPARAM lParam)

Public Attributes

CWnd * pWnd
UINT dialogID
CString title
CStatic * message
bool cancel

Protected Member Functions

virtual void DoDataExchange (CDataExchange *pDX)

Detailed Description

Definition at line 17 of file MessageBoxDLG.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
IDD 

Definition at line 41 of file MessageBoxDLG.h.

00041 { IDD = IDD_MESG_BOX };


Constructor & Destructor Documentation

CMessageBoxDLG ( LPCTSTR  tn = NULL,
CWnd *  pParent = NULL 
)

Definition at line 22 of file MessageBoxDLG.cpp.

References CMessageBoxDLG::cancel, CMessageBoxDLG::dialogID, CMessageBoxDLG::IDD, CMessageBoxDLG::message, CMessageBoxDLG::pWnd, and CMessageBoxDLG::title.

00023     : CDialog(CMessageBoxDLG::IDD, pParent)
00024 {
00025     //{{AFX_DATA_INIT(CMessageBoxDLG)
00026     //}}AFX_DATA_INIT
00027 
00028     dialogID = CMessageBoxDLG::IDD;
00029     pWnd     = pParent;
00030     title    = tn;
00031     message  = NULL;
00032     cancel   = false;
00033     //
00034     Create(dialogID, pWnd);
00035 }

CMessageBoxDLG ( UINT  nIDTemplate,
LPCTSTR  tn = NULL,
CWnd *  pParent = NULL 
)

Definition at line 39 of file MessageBoxDLG.cpp.

References CMessageBoxDLG::cancel, CMessageBoxDLG::dialogID, CMessageBoxDLG::message, CMessageBoxDLG::pWnd, and CMessageBoxDLG::title.

00040         : CDialog(nIDTemplate, pParent)
00041 {
00042     dialogID = nIDTemplate;
00043     pWnd     = pParent;
00044     title    = tn;
00045     message  = NULL;
00046     cancel   = false;
00047     //
00048     Create(dialogID, pWnd);
00049 }

~CMessageBoxDLG (  )  [virtual]

Definition at line 53 of file MessageBoxDLG.cpp.

References CMessageBoxDLG::Destory().

00054 {
00055     Destory();
00056 }

Here is the call graph for this function:


Member Function Documentation

void Destory ( void   ) 

Definition at line 112 of file MessageBoxDLG.cpp.

Referenced by CMessageBoxDLG::~CMessageBoxDLG().

00113 {
00114     DestroyWindow();
00115 }

Here is the caller graph for this function:

void Display ( LPCTSTR  mesg = NULL  ) 

Definition at line 90 of file MessageBoxDLG.cpp.

References CMessageBoxDLG::message, CMessageBoxDLG::pWnd, and CMessageBoxDLG::title.

Referenced by jbxwl::MessageBoxDLG().

00091 {
00092     if (pWnd!=NULL) {
00093         RECT rect;
00094         pWnd->GetWindowRect(&rect);
00095         int sx = (rect.left+rect.right)/2;
00096         int sy = (rect.top+rect.bottom)/2;
00097         this->GetWindowRect(&rect);
00098         sx -= (rect.right-rect.left)/2;
00099         sy -= (rect.bottom-rect.top)/2;
00100         this->SetWindowPos(NULL, sx, sy, 0, 0, SWP_NOSIZE|SWP_NOZORDER);
00101     }
00102     ShowWindow(SW_SHOW);
00103 
00104     if (!title.IsEmpty()) SetWindowText(title);
00105     if (message!=NULL && mesg!=NULL) message->SetWindowText(mesg);
00106 }

Here is the caller graph for this function:

void DoDataExchange ( CDataExchange *  pDX  )  [protected, virtual]

Definition at line 60 of file MessageBoxDLG.cpp.

00061 {
00062     CDialog::DoDataExchange(pDX);
00063     //{{AFX_DATA_MAP(CMessageBoxDLG)
00064     //}}AFX_DATA_MAP
00065 }

bool isCanceled (  )  [inline]

Definition at line 37 of file MessageBoxDLG.h.

References CMessageBoxDLG::cancel.

00037 {return cancel;}

BOOL OnCommand ( WPARAM  wParam,
LPARAM  lParam 
) [virtual]

Definition at line 128 of file MessageBoxDLG.cpp.

References CMessageBoxDLG::cancel.

00129 {
00130     if (wParam==IDCANCEL) cancel = true;
00131 
00132     return CDialog::OnCommand(wParam, lParam);
00133 }

BOOL OnInitDialog (  ) 

Definition at line 80 of file MessageBoxDLG.cpp.

00081 {
00082     message = (CStatic*)GetDlgItem(IDC_MESG_BOX_TEXT);
00083     return TRUE;
00084 }

void OnStnClickedMesgBoxText (  ) 

Definition at line 119 of file MessageBoxDLG.cpp.

00120 {
00121     // TODO: ここにコントロール通知ハンドラー コードを追加します。
00122 }


Member Data Documentation

bool cancel
UINT dialogID

Definition at line 21 of file MessageBoxDLG.h.

Referenced by CMessageBoxDLG::CMessageBoxDLG().

CStatic* message

Definition at line 23 of file MessageBoxDLG.h.

Referenced by CMessageBoxDLG::CMessageBoxDLG(), and CMessageBoxDLG::Display().

CWnd* pWnd

Definition at line 20 of file MessageBoxDLG.h.

Referenced by CMessageBoxDLG::CMessageBoxDLG(), and CMessageBoxDLG::Display().

CString title

Definition at line 22 of file MessageBoxDLG.h.

Referenced by CMessageBoxDLG::CMessageBoxDLG(), and CMessageBoxDLG::Display().


The documentation for this class was generated from the following files:

Generated on 15 Nov 2023 for JunkBox_Win_Lib by  doxygen 1.6.1