-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMyBands.h
142 lines (116 loc) · 3.4 KB
/
MyBands.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
//---------------------------------------------------------------------------
// (c) 2006-2020 12noon, Stefan K. S. Tucker
//---------------------------------------------------------------------------
#pragma once
#include "Shared/ToolTipCtrl.h"
#include "COMtoys/BandObj.h"
#include "Shared/StaticColor.h"
#include "Calendar.h"
#include "ConfigureDlg.h"
#include "Resource.h"
/*
Use this to add a Logo on the left/top.
*/
//#define _LOGO
/*
It can be either an icon or a bitmap.
*/
//#define _LOGO_ICON
#if defined(_LOGO)
//#if defined(_LOGO_ICON)
// #pragma message("LOGO ICON enabled")
//#else
// #pragma message("LOGO BITMAP enabled")
//#endif
#pragma message("LOGO enabled")
#endif
//////////////////
// Application class: derive from CBandObjApp
//
class CMyBandsDll : public CBandObjDll
{
public:
CMyBandsDll()
{
#if defined(_DEBUG)
# if 1
CBandObj::bTRACE = FALSE;
ComToys::bTRACE = FALSE;
# endif
#endif
}
virtual ~CMyBandsDll() {}
virtual BOOL InitInstance();
protected:
DECLARE_MESSAGE_MAP()
};
//////////////////
// Desk band lives in task bar
//
class CMyDeskBand : public CBandObj
{
protected:
skst::MyToolTipCtrl _tips;
#if defined(_LOGO)
CStatic _ctlAbout;
CSize _sizeAbout;
#endif
UINT_PTR _idTimerUpdateDisplay;
// clock support
MyMFC::StaticColor _ctlClock;
CSize _sizeClockText;
// text properties (from Registry)
ConfigureDlg _dlgConfiguration;
CFont _fontClock;
// calendar support
CalendarWindow _cal;
public:
CMyDeskBand();
virtual ~CMyDeskBand() {}
protected:
void BuildContextMenu();
// override
virtual BOOL PreCreateWindow(CREATESTRUCT& cs) override;
virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo) override;
virtual void IPersistStreamGetSizeMax(ULARGE_INTEGER *pcbSize) override;
virtual HRESULT IPersistStreamSave(IStream *pStream) override;
virtual HRESULT IPersistStreamLoad(IStream *pStream) override;
virtual STDMETHODIMP SetCompositionState(BOOL fCompositionEnabled) override
{
if (fCompositionEnabled != m_bCompositionEnabled)
{
__super::SetCompositionState(fCompositionEnabled);
FormatClock();
UpdateClockText();
}
return S_OK;
}
virtual void DoSize(UINT nType, int cx, int cy);
void SetBandSizes();
void UpdateClockText();
void FormatClock();
afx_msg void OnSetFocus(CWnd* pOldWnd);
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnDestroy();
afx_msg void OnTimer(UINT_PTR idEvent);
afx_msg BOOL OnToolTipNotify(UINT id, NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnProducts();
afx_msg void OnHelp();
afx_msg void OnAbout();
afx_msg void OnClockOptions();
afx_msg void OnCalendar();
afx_msg void OnUpdateCalendarShowToday(CCmdUI *pCmdUI);
afx_msg void OnCalendarShowToday();
afx_msg void OnUpdateCalShowWeekNums(CCmdUI *pCmdUI);
afx_msg void OnCalShowWeekNums();
afx_msg void OnUpdateCalSaveLastPos(CCmdUI *pCmdUI);
afx_msg void OnCalSaveLastPos();
afx_msg void OnUpdateCalSaveLastSize(CCmdUI *pCmdUI);
afx_msg void OnCalSaveLastSize();
afx_msg void OnCalSelectFont();
DECLARE_MESSAGE_MAP();
DECLARE_DYNCREATE(CMyDeskBand)
public:
afx_msg void OnAdjustDateTime();
afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection);
};