undodlg.cpp
资源名称:44757463.rar [点击查看]
上传用户:lj3531212
上传日期:2007-06-18
资源大小:346k
文件大小:2k
源码类别:
绘图程序
开发平台:
Visual C++
- // UndoDlg.cpp :
- //
- #include "stdafx.h"
- #include "GraphSoft.h"
- #include "UndoDlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- static UINT indicators[] =
- {
- ID_SEPARATOR,
- ID_SEPARATOR,
- ID_SEPARATOR,
- ID_INDICATOR_KANA,
- ID_INDICATOR_CAPS,
- ID_INDICATOR_NUM,
- ID_INDICATOR_SCRL,
- };
- /////////////////////////////////////////////////////////////////////////////
- // CUndoDlg
- CUndoDlg::CUndoDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CUndoDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CUndoDlg)
- //}}AFX_DATA_INIT
- m_winPos.x = 0;
- m_winPos.y = 0;
- }
- void CUndoDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CUndoDlg)
- DDX_Control(pDX, IDC_UNDOLIST, m_list);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CUndoDlg, CDialog)
- //{{AFX_MSG_MAP(CUndoDlg)
- ON_WM_NCACTIVATE()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CUndoDlg
- BOOL CUndoDlg::OnNcActivate(BOOL bActive)
- {
- if (! bActive) {
- PostMessage(WM_CLOSE);
- }
- return CDialog::OnNcActivate(bActive);
- }
- BOOL CUndoDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
- #if 0 //
- //
- SetWindowPos(NULL, m_winPos.x, m_winPos.y, 0, 0, SWP_NOSIZE|SWP_NOZORDER);
- //
- m_list.m_pParentDlg = this;
- m_list.SetContents();
- //
- switch (m_list.m_nID) {
- case ID_EDIT_UNDO:
- m_statusFormatString.LoadString(IDS_EDIT_UNDO_TIMES);
- break;
- case ID_EDIT_REDO:
- m_statusFormatString.LoadString(IDS_EDIT_REDO_TIMES);
- break;
- }
- #endif
- return TRUE;
- }
- void CUndoDlg::SetStatus(long nTimes)
- {
- CString text;
- if (nTimes > 0) {
- text.Format(m_statusFormatString, nTimes);
- }
- CWnd* pWnd = GetDlgItem(IDC_STATUS);
- pWnd->SetWindowText(text);
- }
- void CUndoDlg::OnOK()
- {
- m_list.OnUndo();
- CDialog::OnOK();
- }