MainFrm.cpp
资源名称:CMarkup.rar [点击查看]
上传用户:hawkcdm
上传日期:2013-02-10
资源大小:411k
文件大小:3k
源码类别:
xml/soap/webservice
开发平台:
Visual C++
- // MainFrm.cpp : implementation of the CMainFrame class
- //
- // Markup Release 6.1 Lite
- // Copyright (C) 1999-2001 First Objective Software, Inc. All rights reserved
- // This entire notice must be retained in this source code
- // Redistributing this source code requires written permission
- // This software is provided "as is", with no warranty.
- // Latest fixes enhancements and documentation at www.firstobject.com
- #include "stdafx.h"
- #include "MarkupApp.h"
- #include "MainFrm.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CMainFrame
- IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
- BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
- //{{AFX_MSG_MAP(CMainFrame)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- // DO NOT EDIT what you see in these blocks of generated code !
- ON_WM_CREATE()
- //}}AFX_MSG_MAP
- ON_UPDATE_COMMAND_UI(ID_STATUSBAR_TEXT, OnUpdateStatus)
- ON_MESSAGE(WM_SETTEXT, OnSetText)
- END_MESSAGE_MAP()
- static UINT indicators[] =
- {
- ID_STATUSBAR_TEXT,
- ID_INDICATOR_CAPS,
- ID_INDICATOR_NUM,
- ID_INDICATOR_SCRL,
- };
- /////////////////////////////////////////////////////////////////////////////
- // CMainFrame construction/destruction
- CMainFrame::CMainFrame()
- {
- m_csStatus = _T("Ready");
- }
- CMainFrame::~CMainFrame()
- {
- }
- void CMainFrame::SetStatus( CString csStatus )
- {
- m_wndStatusBar.SetPaneText( 0, csStatus ); // immediate
- m_csStatus = csStatus; // on idle
- }
- void CMainFrame::OnUpdateStatus(CCmdUI *pCmdUI)
- {
- pCmdUI->Enable();
- pCmdUI->SetText( m_csStatus );
- }
- LRESULT CMainFrame::OnSetText(WPARAM, LPARAM)
- {
- CString csTitle = ((CMarkupApp*)AfxGetApp())->m_csTitle;
- return DefWindowProc( WM_SETTEXT, 0, (long)(LPCTSTR)csTitle );
- }
- int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
- {
- if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
- return -1;
- if (!m_wndStatusBar.Create(this) ||
- !m_wndStatusBar.SetIndicators(indicators,
- sizeof(indicators)/sizeof(UINT)))
- {
- return -1; // fail to create
- }
- m_wndStatusBar.SetPaneStyle(0,SBPS_NOBORDERS|SBPS_STRETCH);
- return 0;
- }
- BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
- {
- if( !CMDIFrameWnd::PreCreateWindow(cs) )
- return FALSE;
- return TRUE;
- }
- /////////////////////////////////////////////////////////////////////////////
- // CMainFrame diagnostics
- #ifdef _DEBUG
- void CMainFrame::AssertValid() const
- {
- CMDIFrameWnd::AssertValid();
- }
- void CMainFrame::Dump(CDumpContext& dc) const
- {
- CMDIFrameWnd::Dump(dc);
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // CMainFrame message handlers