You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mitlib.pub/MITLIB/Utility/messagebox.h

153 lines
4.3 KiB
C++

// Start =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// General information section.
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// $Author:yongkiang$ User who last changed the file
// $Date:1/2/2013 12:18:09 PM$ Date and time of last check in
// $Revision:1.0$ Visual SourceSafe version number
// $Workfile:: MessageBox.h $ Filename
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#if !defined(AFX_MESSAGEBOX_H__47616BB6_826E_11D6_A804_005004C029CA__INCLUDED_)
#define AFX_MESSAGEBOX_H__47616BB6_826E_11D6_A804_005004C029CA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifdef BUILD_UTILITYDLL
#define UTILITYDLL __declspec(dllexport)
#else
#define UTILITYDLL __declspec(dllimport)
#endif
#include "ShadeButtonST.h"
#include <afxcmn.h>
#include "utilityresource.h"
// MessageBox.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CMessageBox dialog
class UTILITYDLL CMessageBox : public CDialog
{
// Construction
public:
CMessageBox(bool bDisplayStatus, LPCTSTR lpszCaption, LPCTSTR lpszText, UINT nType = MB_ICONEXCLAMATION, bool EnableCounter = false, int *Count = NULL, bool *SingleRow = NULL, CWnd* pParent = NULL);
CMessageBox(LPCTSTR lpszText, UINT nType = MB_ICONEXCLAMATION, bool bDisplayStatus = false, bool EnableCounter = false, int *Count = NULL, bool *SingleRow = NULL, CWnd* pParent = NULL); // standard constructor
CMessageBox(LPCTSTR lpszText, LPCTSTR lpszDetails, UINT nType = MB_ICONEXCLAMATION, CWnd* pParent = NULL);
int *m_bcount;
bool *m_bSingleRow;
// Dialog Data
// {{AFX_DATA(CMessageBox)
enum {
IDD = IDD_MESSAGE_BOX_DLG
};
CEdit m_editCtrl;
CProgressCtrl m_progressBar;
CShadeButtonST m_cbOk;
CShadeButtonST m_cbCancel;
CStatic m_messageIcon;
// }}AFX_DATA
/*
static void CALLBACK EXPORT TimerProc(
HWND hWnd, // handle of CWnd that called SetTimer
UINT nMsg, // WM_TIMER
UINT nIDEvent, // timer identification
DWORD dwTime // system time
);
*/
void SetOkButtonLabel(const char *sOkButtonLabel);
void SetCancelButtonLabel(const char *sCancelButtonLabel);
// Overrides
// ClassWizard generated virtual function overrides
// {{AFX_VIRTUAL(CMessageBox)
public:
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
// }}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
// {{AFX_MSG(CMessageBox)
virtual BOOL OnInitDialog();
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
virtual void OnOK();
virtual void OnCancel();
#if _MSC_VER > 1200
afx_msg LRESULT OnCloseDisplay(WPARAM wp, LPARAM lp);
#else
afx_msg void OnCloseDisplay();
#endif
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnDetails();
afx_msg void OnClose();
// }}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
enum
{
MAX_STR_LEN = 50,
};
void SetProgressBar();
void SetMessageIcon();
void SetMessageText();
void InitDlgIcons();
void SetDlgItemFont();
void CreateDlgFont(CString Name = _T("MS Sans Serif"));
// set ok and cancel button placement
void SetButtonPlacement();
// word wrap message
// void WordWrapMessage();
bool m_bEnableCounter;
CFont m_fontLogo;
UINT m_nType;
#if _MSC_VER > 1200
char* m_lpszText;
#else
LPCTSTR m_lpszText;
#endif
LPCTSTR m_lpszCaption;
CString m_csText;
CString m_csCaption;
HICON hiconExclamation;
HICON hiconInformation;
HICON hiconQuestion;
HICON hiconStop;
char strButton1[MAX_STR_LEN];
char strButton2[MAX_STR_LEN];
bool m_bDisplayStatus;
bool m_bModeless;
CBrush m_brushBackground;
bool m_bExpand;
CString m_csItem;
static COLORREF m_colorBackground;
static bool m_bCustomizedColor;
static bool m_bCustomizedOptionLoaded;
};
// {{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MESSAGEBOX_H__47616BB6_826E_11D6_A804_005004C029CA__INCLUDED_)