📄 mydraw.h
字号:
//File Name: MyDraw.h
//Project Name: 中央控制系统
//Author: lijunfeng
//Date: 2004-12-1
//Last mod:
//Description:
//
//////////////////////////////////////////////////////////////////////
#pragma once
#include "..\comm\DllPath.h"
#include "pmhead_c.h"
enum _WarnMsgType
{
_mtDeviceErr = 1,//设备故障通知
_mtWarnNotify = 2,//报警通知
_mtSystemPower = 3,//系统电源不足
_mtDoorPower = 4,//门禁电源不足
_mtWebConnection = 8,//互联网连接状态
//bState=1表示网络连接正常,否则表示网络连接出现故障
_mtNewEmail = 9,//最新邮件
_mtNewBulletion = 10,//最新社区公告
_mtNewCommityReply = 11,//未读社区预约回复
_mtVersonUpdate = 12,//版本升级信息
_mtNewClientCenterReply = 13,//未读的客服中心回复
_mtNewVoiceMemo = 14,//最新语音留言
_mtNewVedio = 15,//可视对讲
_mtNewVedioCall = 16,//可视电话
_mtIME = 20, //输入法
_mtClockDetail = 21, //闹钟
_mtMemoryDetail = 22, //备忘录
_mtClockAll = 23, //闹钟
_mtMemoryAll = 24, //备忘录
_mtNewVisiblePhone = 25, //可视电话(来电界面)
_mtPartSafe = 26, //局部设防
_mtShortMessage = 30, //短信
_mtVolumeSet = 40, //声音设置
_mtMouseAdjustSet = 41, //表笔校准
_mtTemperature = 50, //温度
_mtRefreshIcon = 99,
};
struct WarnNotifyMsg
{
byte bType; //消息通知类型
byte bState; //状态
WarnNotifyMsg* pNext;
//char Reserve[6]; //保留字节
};
const int ICONDATA_COUNT = 19;
const int TITILE_ICON_COUNT = 12;
static _WarnMsgType iconData1[ICONDATA_COUNT] = {_mtNewEmail,_mtNewBulletion,_mtNewCommityReply,_mtNewVoiceMemo,_mtNewVedio,_mtClockAll,
_mtMemoryAll,_mtVersonUpdate,_mtDeviceErr,_mtNewClientCenterReply,_mtShortMessage,
_mtPartSafe, //11
_mtNewVedioCall,_mtIME,_mtWebConnection,_mtWarnNotify,_mtVolumeSet,_mtTemperature,_mtMouseAdjustSet}; //7
//报警通知/
//最新邮件/最新社区公告/未读社区预约回复/最新语音留言/未接的对讲/
//本日已有闹钟/备忘录今日有内容/版本升级信息/设备损坏情况/未读的客服中心回复
//局部设防
//电话来电/输入法/互联网连接状态
const int STATUSBAR_LEFT_POS = 430;
const int STATUSBAR_IMG_SIZE = 30;
const int MAX_RUNUP_TEXT_COUNT = 10;
const int MAX_RUNUP_TEXT_SIZE = 100;
class CMyDraw
{
public:
CMyDraw();
virtual ~CMyDraw();
protected:
LRESULT IconDrawItem(int ResourceID);
LRESULT ImgDrawItem(HDC hdc,int ResourceID,RECT rc);
LRESULT ImgDrawItem(HDC hdc,int ResourceID,int xpos,int ypos);
LRESULT ImgDrawItem(int ResourceID,short type=0,int posx=10);
LRESULT ImgDrawObject(int ResourceID,int posx=10);
LRESULT ImgDrawHintObject();
LRESULT ImgDrawHintObject(int id);
LRESULT TextOut();
protected:
HDC m_hdc;
//HDC m_Memhdc;
short states[20];
int GetNoByMsgType(long ty);
protected:
void DrawTimeString(HDC hdc);
void GetTimeRect(RECT& rc);
void GetTempRect(RECT& rc);
public:
short m_dt;
//long m_status;
TCHAR m_title[200];
DWORD m_szRunUpText[MAX_RUNUP_TEXT_COUNT];
RECT m_trct;
RECT m_rct;
int m_nRunUpTextId;
int m_nRunUpTextCount;
HWND m_hwnd;
short m_nTempValue;
short GetClickObjID(int xpos,int ypos);
bool SetDT(short dt);
long SetHintStatus(long hStatus);
void DrawTimeString();
void ResetHintStatus(long hStatus);
void RefreshTemperature(HDC hdc);
public:
void OnMyDraw(HDC hdc,RECT rc);
protected:
int m_pos;
int m_iRunTextOff;
void GetTitleRect(RECT& rc);
void MyTextOut(HDC hdc,RECT rc,LPTSTR bText,DWORD style=DT_LEFT|DT_VCENTER,COLORREF clr=RGB(255,255,255));
void SetRectColor(COLORREF clr,HDC hdc,RECT rc);
void SetRectColor(COLORREF clr,COLORREF Penclr,HDC hdc,RECT rc,int PenWidth=0);
void RunExe(int index);
protected:
void SetWindowTopMost();
void RunKsdh();
void RunKsdj();
void RunNewsLink();
void RunSyste_mtempSet();
void RunVolumeSet(short nShow);
void RunNetWorkSet();
void RunMouseAdjust();
void RunSyste_mtimeSet();
void DrawStatusIcon(HDC hdc);
public:
void RunUpText();
void ShowOneLineText(char* szInfo,char* szLastInfo);
void ShowOneLineText(HDC hdc,char* szInfo,char* szLastInfo);
void HideOneLineText(HDC hdc,char* szInfo);
void RefreshTitleText();
void RefreshTitleText(HDC hdc);
void ReadRunUpText();
};
extern HINSTANCE g_hinst;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -