收藏 分享(赏)

一个原创地仪表控件.doc

上传人:11xg27ws 文档编号:6282246 上传时间:2019-04-04 格式:DOC 页数:4 大小:53KB
下载 相关 举报
一个原创地仪表控件.doc_第1页
第1页 / 共4页
一个原创地仪表控件.doc_第2页
第2页 / 共4页
一个原创地仪表控件.doc_第3页
第3页 / 共4页
一个原创地仪表控件.doc_第4页
第4页 / 共4页
亲,该文档总共4页,全部预览完了,如果喜欢就下载吧!
资源描述

1、一个原创地仪表控件路过世纪飞扬的网站发现好些个仪表控件,可惜都要付费,这对于很多用户来说不得不说是一件憾事。最近两天导师项目不忙,就抽空做了一个仪表控件,是对照别人的仪表外观做的,在此公布出来大家讨论讨论,最好大家都写些免费的控件放在网上,好资源共享。如果有兄弟觉得好用的话,请在使用处留下俺的名号,这就够给我面子了。1效果图2CMeter 类的使用方法(1) Meter.cpp 和 Meter.h 以及 MemDC.h 加入到你的工程中。 (2) 在你的工程中放入一个图片框控件,并通过类向导声明一个 CStatic 类的对象,例如叫 m_myMeter。 (3) 用 CMeter 替换 m_m

2、yMeter 的 CStatic。 (4) 利用 CMeter 类的接口函数初始化。 (5) 更新数值 UpdateNeedle(double dValue),显示指针变化。 3接口函数介绍 SetNeedleColor(COLORREF colorNeedle) 设置指针颜色SetRange(double dMin, double dMax) 设置仪表最大值最小值SetScaleDecimals(int nDecimals) 设置刻度显示精度(小数点后位数)SetValueDecimals(int nDecimals) 设置数值显示精度(小数点后位数)SetUnits(CString &st

3、rUnits) 设置单位SetColorTick(BOOL bColorTick) 是否显示彩色刻度SetTicks(int nTicks) 设置主刻度(分几大格)SetSubTicks(int nSubTicks) 设置子刻度(每大格分为几小格)SetAngleRange(int nStartAngleDeg, int nEndAngleDeg) 表盘圆弧起始终止角度=MICROSOFT FOUNDATION CLASS LIBRARY : MyMeter=AppWizard has created this MyMeter application for you. This applica

4、tionnot only demonstrates the basics of using the Microsoft Foundation classesbut is also a starting point for writing your application.This file contains a summary of what you will find in each of the files thatmake up your MyMeter application.MyMeter.dspThis file (the project file) contains inform

5、ation at the project level andis used to build a single project or subproject. Other users can share theproject (.dsp) file, but they should export the makefiles locally.MyMeter.hThis is the main header file for the application. It includes otherproject specific headers (including Resource.h) and de

6、clares theCMyMeterApp application class.MyMeter.cppThis is the main application source file that contains the applicationclass CMyMeterApp.MyMeter.rcThis is a listing of all of the Microsoft Windows resources that theprogram uses. It includes the icons, bitmaps, and cursors that are storedin the RES

7、 subdirectory. This file can be directly edited in MicrosoftVisual C+.MyMeter.clwThis file contains information used by ClassWizard to edit existingclasses or add new classes. ClassWizard also uses this file to storeinformation needed to create and edit message maps and dialog datamaps and to create

8、 prototype member functions.resMyMeter.icoThis is an icon file, which is used as the applications icon. Thisicon is included by the main resource file MyMeter.rc.resMyMeter.rc2This file contains resources that are not edited by Microsoft Visual C+. You should place all resources not editable bythe r

9、esource editor in this file./AppWizard creates one dialog class:MyMeterDlg.h, MyMeterDlg.cpp - the dialogThese files contain your CMyMeterDlg class. This class definesthe behavior of your applications main dialog. The dialogstemplate is in MyMeter.rc, which can be edited in MicrosoftVisual C+./Other

10、 standard files:StdAfx.h, StdAfx.cppThese files are used to build a precompiled header (PCH) filenamed MyMeter.pch and a precompiled types file named StdAfx.obj.Resource.hThis is the standard header file, which defines new resource IDs.Microsoft Visual C+ reads and updates this file./Other notes:App

11、Wizard uses “TODO:“ to indicate parts of the source code youshould add to or customize.If your application uses MFC in a shared DLL, and your application is in a language other than the operating systems current language, youwill need to copy the corresponding localized resources MFC42XXX.DLLfrom th

12、e Microsoft Visual C+ CD-ROM onto the system or system32 directory,and rename it to be MFCLOC.DLL. (“XXX“ stands for the language abbreviation.For example, MFC42DEU.DLL contains resources translated to German.) If youdont do this, some of the UI elements of your application will remain in thelanguage of the operating system./

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 实用文档 > 统计图表

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报