- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
MainFrm.cpp
资源名称:qzoomview.zip [点击查看]
上传用户:xp9161
上传日期:2009-12-21
资源大小:70k
文件大小:2k
源码类别:
Windows编程
开发平台:
Visual C++
- // MainFrm.cpp : implementation of the CMainFrame class
- //
- #include "stdafx.h"
- #include "QZoomViewDemo.h"
- #include "MainFrm.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #endif
- const int TimerID = 3;
- const int TimerPeriod = 4000;
- const int FirstMessage = 1000;
- IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
- BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
- ON_WM_CREATE()
- ON_WM_TIMER()
- ON_WM_DESTROY()
- END_MESSAGE_MAP()
- static UINT indicators[] =
- {
- ID_SEPARATOR, // status line indicator
- //++++++++++++++++++++++++++++++++++
- // One indicator ID added.
- // It is handled in class QZVDemoView.
- ID_INDICATOR_ZOOM,
- //
- //
- //+++++++++++++++++++++++++++++++++
- ID_INDICATOR_CAPS,
- ID_INDICATOR_NUM,
- ID_INDICATOR_SCRL,
- };
- CMainFrame::CMainFrame()
- : m_iMessage(FirstMessage)
- {
- }
- CMainFrame::~CMainFrame()
- {
- }
- int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
- {
- if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
- return -1;
- if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
- | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
- !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
- {
- TRACE0("Failed to create toolbarn");
- return -1;
- }
- if (!m_wndStatusBar.Create(this) ||
- !m_wndStatusBar.SetIndicators(indicators,
- sizeof(indicators)/sizeof(UINT)))
- {
- TRACE0("Failed to create status barn");
- return -1;
- }
- m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
- EnableDocking(CBRS_ALIGN_ANY);
- DockControlBar(&m_wndToolBar);
- SetTimer(TimerID, TimerPeriod, NULL);
- return 0;
- }
- void CMainFrame::OnTimer(UINT nIDEvent)
- {
- if (nIDEvent == TimerID)
- {
- CString s;
- if (! s.LoadString(m_iMessage++))
- {
- m_iMessage = FirstMessage;
- s.LoadString(m_iMessage++);
- }
- SetMessageText(s);
- }
- CFrameWnd::OnTimer(nIDEvent);
- }
- void CMainFrame::OnDestroy()
- {
- CFrameWnd::OnDestroy();
- KillTimer(TimerPeriod);
- }