• 大小: 2.35MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-11-09
  • 语言: C/C++
  • 标签: cy  

资源简介

c++大学课程资料,上课老师叫做的作业,用c++画图,圆形,长方

资源截图

代码片段和文件信息

// MainFrm.cpp : implementation of the CMainframe class
//

#include “stdafx.h“
#include “MyDraw.h“

#include “MainFrm.h“

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMainframe

IMPLEMENT_DYNCREATE(CMainframe CframeWnd)

BEGIN_MESSAGE_MAP(CMainframe CframeWnd)
//{{AFX_MSG_MAP(CMainframe)
ON_WM_CREATE()
ON_WM_TIMER()
ON_WM_CLOSE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

static UINT indicators[] =
{
ID_SEPARATOR           // status line indicator
ID_INDICATOU_CLASS
ID_INDICATOU_NAME
ID_INDICATOU_NUM
ID_INDICATOR_CLOCK
};

/////////////////////////////////////////////////////////////////////////////
// CMainframe construction/destruction

CMainframe::CMainframe()
{
// TODO: add member initialization code here

}

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 toolbar\n“);
return -1;      // fail to create
}

if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators
  sizeof(indicators)/sizeof(UINT)))
{
TRACE0(“Failed to create status bar\n“);
return -1;      // fail to create
}

// TODO: Delete these three lines if you don‘t want the toolbar to
//  be dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
SetTimer(11000NULL); //安装定时器,并将其时间间隔设为1000毫秒
return 0;
}

BOOL CMainframe::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CframeWnd::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
//  the CREATESTRUCT cs

return TRUE;
}

/////////////////////////////////////////////////////////////////////////////
// CMainframe diagnostics

#ifdef _DEBUG
void CMainframe::AssertValid() const
{
CframeWnd::AssertValid();
}

void CMainframe::Dump(CDumpContext& dc) const
{
CframeWnd::Dump(dc);
}

#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CMainframe message handlers


void CMainframe::OnTimer(UINT nIDEvent) 
{
// TODO: Add your message handler code here and/or call default
CTime time;
time=CTime::GetCurrentTime();//得到当前时间
CString s=time.Format(“%H:%M:%S“);//转换时间格式
m_wndStatusBar.SetPaneText(m_wndStatusBar.CommandToIndex(ID_INDICATOR_CLOCK)s); //显示时钟
CframeWnd::OnTimer(nIDEvent);
}

void CMainframe::OnClose() 
{
// TODO: Add your message handler code here and/or call default
KillTimer(1);
CframeWnd::OnClose();
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-08-01 09:35  画图简单软件\
     目录           0  2018-08-01 09:35  画图简单软件\Debug\
     文件       22820  2016-01-06 14:00  画图简单软件\Debug\MainFrm.obj
     文件      122935  2016-01-06 14:25  画图简单软件\Debug\MyDraw.exe
     文件      344208  2016-01-06 14:25  画图简单软件\Debug\MyDraw.ilk
     文件       22806  2016-01-06 14:06  画图简单软件\Debug\MyDraw.obj
     文件     5488144  2016-01-05 22:07  画图简单软件\Debug\MyDraw.pch
     文件      500736  2016-01-06 14:25  画图简单软件\Debug\MyDraw.pdb
     文件        7476  2016-01-05 23:05  画图简单软件\Debug\MyDraw.res
     文件       14579  2016-01-05 22:07  画图简单软件\Debug\MyDrawDoc.obj
     文件       33915  2016-01-06 14:25  画图简单软件\Debug\MyDrawView.obj
     文件      105505  2016-01-05 22:07  画图简单软件\Debug\StdAfx.obj
     文件      222208  2018-05-24 18:13  画图简单软件\Debug\vc60.idb
     文件      372736  2016-01-06 14:25  画图简单软件\Debug\vc60.pdb
     文件        2984  2016-01-06 14:00  画图简单软件\MainFrm.cpp
     文件        3411  2018-05-24 18:13  画图简单软件\MainFrm.dsp
     文件         522  2018-05-24 18:14  画图简单软件\MainFrm.dsw
     文件        1508  2016-01-06 13:55  画图简单软件\MainFrm.h
     文件       33792  2018-05-24 18:14  画图简单软件\MainFrm.ncb
     文件       48640  2018-05-24 18:14  画图简单软件\MainFrm.opt
     文件         248  2018-05-24 18:13  画图简单软件\MainFrm.plg
     文件       29012  2016-05-17 22:08  画图简单软件\MyDraw.aps
     文件        2445  2016-05-17 22:09  画图简单软件\MyDraw.clw
     文件        4209  2016-01-05 19:59  画图简单软件\MyDraw.cpp
     文件        4555  2016-01-05 19:59  画图简单软件\MyDraw.dsp
     文件         537  2016-01-05 19:59  画图简单软件\MyDraw.dsw
     文件        1356  2016-01-05 19:59  画图简单软件\MyDraw.h
     文件       91136  2016-06-05 16:24  画图简单软件\MyDraw.ncb
     文件       49664  2016-06-05 16:24  画图简单软件\MyDraw.opt
     文件         246  2016-05-17 22:11  画图简单软件\MyDraw.plg
     文件       12088  2016-01-05 23:05  画图简单软件\MyDraw.rc
............此处省略13个文件信息

评论

共有 条评论