-
-
Notifications
You must be signed in to change notification settings - Fork 49
/
ColorCopDlg.h
318 lines (275 loc) · 10.6 KB
/
ColorCopDlg.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
// ColorCopDlg.h : header file
//
#if !defined(AFX_HTMLCOPDLG_H__EC2A34E6_4FAA_11D3_81A0_A79013DBA62A__INCLUDED_)
#define AFX_HTMLCOPDLG_H__EC2A34E6_4FAA_11D3_81A0_A79013DBA62A__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
/////////////////////////////////////////////////////////////////////////////
// CColorCopDlg dialog
#define BMP_FILE "\\Color_Cop.bmp"
#define BMP_FILE_DIR "\\ColorCop"
//#include "WavTipCtrl.h" // used to add tooltips to the dialog :)
class CSystemTray;
class CColorCopDlg : public CDialog
{
// Construction
public:
CColorCopDlg(CWnd* pParent = NULL); // standard constructor
//CWavTipCtrl m_tooltip;
COLORREF ColorHistory[7];
COLORREF CustColorBank[16];
int m_Appflags;
int m_iSamplingOffset;
int WinLocX,WinLocY;
unsigned short m_MagLevel;
unsigned short m_FloatPrecision;
HBITMAP hBitmap, hBitmapClip, hZoomBitmap;
// Dialog Data
//{{AFX_DATA(CColorCopDlg)
enum { IDD = IDD_HTMLCOP_DIALOG };
CButton m_ColorPick;
CStatic m_Lbl4;
CStatic m_Lbl3;
CStatic m_Lbl2;
CStatic m_Lbl1;
CStatic m_Slide3;
CStatic m_Slide2;
CStatic m_Slide1;
CStatic m_MagPlus;
CStatic m_MagMinus;
CStatic m_ColorPalette;
CStatic m_MagWindow;
CStatic m_Q7;
CStatic m_Q6;
CStatic m_Q5;
CStatic m_Q4;
CStatic m_Q3;
CStatic m_Q2;
CStatic m_Q1;
CStatic m_ColorPreview;
CButton m_ExpandDialog;
CStatic m_Magnifier;
CStatic m_EyeLoc;
int m_Greendec;
int m_Bluedec;
int m_Reddec;
CString m_Hexcolor;
int m_Black;
int m_Cyan;
int m_Magenta;
int m_Yellow;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CColorCopDlg)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
bool m_bvisible;
HICON m_hIcon, m_hBlank, m_hEye;
HACCEL m_hAcceleratorTable; // Accelerator var
// Store for snapback from websafe, unsigned char only takes 1 byte, 0 - 255
unsigned char m_OldRed, m_OldBlue, m_OldGreen;
BOOL bOldClrExist;
BOOL m_isEyedropping;
BOOL m_isMagnifying;
BOOL bMinimized;
BOOL m_isMagPlusDown;
BOOL m_isMagMinusDown;
BOOL m_InitialMove;
BOOL m_bCalcColorPal;
BOOL bRelativePosition;
BOOL m_MagDrop;
CStatusBarCtrl m_StatBar;
CToolTipCtrl m_ToolTip;
int smHeight, smWidth, lgHeight, lgWidth;
unsigned int m_nwide, m_ntall;
// color palette stuff
double r,g,b;
double Hue, Sat, Light;
struct swatchStruct{
double A;
double B;
double C;
} Swatch[6];
swatchStruct OrigSwatch;
COLORREF ColorPal[6][7];
int palcol;
POINT RelativePoint;
POINT RelativePointEnd;
CMenu copmenu;
HDC hdc, hdcMem, hdcZoomMem;
CRect Q1rect, Q2rect, Q3rect, Q4rect, Q5rect, Q6rect, Q7rect;
CRect buttonrect; // color window rect
CRect magrect, colorpalrect; // magnifyer rect, based off color window rect
CRect testrect;
CRect magplus,magminus;
RECT CCopRect, CCopsmRect;
HCURSOR m_hEyeCursor;
HCURSOR m_hMagCursor;
HCURSOR m_hStandardCursor;
HCURSOR m_hMoveCursor;
HCURSOR m_hHandCursor;
//HCURSOR m_hEyeCursor_3x3, m_hEyeCursor_5x5;
//// systray Internal data
HICON hIcon_;
bool bMinimized_;
CSystemTray* pTrayIcon_;
int nTrayNotificationMsg_;
// end
void CColorCopDlg::FloatPrecisionUp();
void CColorCopDlg::FloatPrecisionDown();
//void CColorCopDlg::BlockMeasure(POINT ptBeg, POINT ptEnd);
void CColorCopDlg::GetScreenBitmap(CPoint point);
void CColorCopDlg::StopCapture(void);
void CColorCopDlg::DisplayColor();
void CColorCopDlg::ParseHTML(CString inst);
void CColorCopDlg::ParseDelphi(CString inst);
void CColorCopDlg::ParseClarion(CString inst);
void CColorCopDlg::FigurePound();
void CColorCopDlg::TestForExpand();
int CColorCopDlg::DecimaltoWebsafe(int originalDec);
void CColorCopDlg::TestForUpperHex();
void CColorCopDlg::OnconvertHEX();
void CColorCopDlg::OnconvertRGB();
void CColorCopDlg::OnInitMenuPopup(CMenu* pMenu, UINT nIndex, BOOL bSysMenu);
void CColorCopDlg::UpdateMenu(CMenu* pMenu);
void CColorCopDlg::ToggleOnTop(bool bSetStatusbartext);
void CColorCopDlg::TestForWebsafe();
void CColorCopDlg::SetupTaskBarButton();
void CColorCopDlg::SetupTrayIcon();
void CColorCopDlg::SetupSystemMenu();
void CColorCopDlg::SetupWindowRects();
bool CColorCopDlg::LoadPersistentVariables();
bool CColorCopDlg::AveragePixelArea(HDC hdc, int* m_Reddec, int* m_Greendec, int* m_Bluedec, CPoint point);
void CColorCopDlg::SetupStatusBar();
void CColorCopDlg::SetStatusBarText(LPCTSTR statusText);
int CColorCopDlg::RangeCheck(int icolorval);
void CColorCopDlg::AdvanceColorHistory();
void CColorCopDlg::GetHistoryColor(int Cindex);
HBITMAP CColorCopDlg::CopyBitmap (HBITMAP hBitmapSrc);
bool CColorCopDlg::isWebsafeColor(int R, int G, int B);
CString CColorCopDlg::GetTempFolder();
BOOL CColorCopDlg::GetShellFolderPath(char* pShellFolder, char* pShellPath);
void CColorCopDlg::SetStatusBarText(UINT strResource, int toggleVal);
void CColorCopDlg::CalcColorPal();
double CColorCopDlg::shiftHue(double hue);
void CColorCopDlg::setSeedColor();
void CColorCopDlg::RGBtoHSL(double R, double G, double B);
void CColorCopDlg::HSLtoRGB(double H, double S, double L);
void CColorCopDlg::setupSwatches();
void CColorCopDlg::handleShifts();
void CColorCopDlg::printSwatch();
double CColorCopDlg::plusValue(double num);
double CColorCopDlg::minusValue(double num);
void CColorCopDlg::RecalcZoom();
void CColorCopDlg::FireOptionMenu();
PBITMAPINFO CColorCopDlg::CreateBitmapInfoStruct(HWND hwnd, HBITMAP hBmp);
void CColorCopDlg::CreateBMPFile(HWND hwnd, LPTSTR pszFile, PBITMAPINFO pbi, HBITMAP hBMP, HDC hDC);
void CColorCopDlg::UpdateCMYKFromRGB(int red, int green, int blue);
void CColorCopDlg::ChangeColorSpace(bool bRGB) ;
// Generated message map functions
//{{AFX_MSG(CColorCopDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg void OnAbout();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnChangeGreen();
afx_msg void OnChangeBlue();
afx_msg void OnChangeRed();
afx_msg void OnColorPick();
afx_msg void OnCopytoclip();
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnChangeHexcolor();
afx_msg void OnDestroy();
afx_msg void OnFileExit();
afx_msg void OnColorReverse();
afx_msg void OnOptionsAlwaysontop();
afx_msg void OnUpdateOptionsAlwaysontop(CCmdUI* pCmdUI);
afx_msg void OnUpdateOptionsDelphimode(CCmdUI* pCmdUI);
afx_msg void OnOptionsDelphimode();
afx_msg void OnUpdateOptionsAutocopytoclipboard(CCmdUI* pCmdUI);
afx_msg void OnOptionsAutocopytoclipboard();
afx_msg void OnColorRandom();
afx_msg void OnUpdateViewHtmlhexmode(CCmdUI* pCmdUI);
afx_msg void OnExpandDialog();
afx_msg void OnViewHtmlhexmode();
afx_msg void OnFileAbout();
afx_msg void OnColorSnaptowebsafe();
afx_msg void OnOptionsOmitsymbol();
afx_msg void OnUpdateOptionsOmitsymbol(CCmdUI* pCmdUI);
afx_msg void OnUpdateColorSnaptowebsafe(CCmdUI* pCmdUI);
afx_msg void OnOptionsMinimizetosystray();
afx_msg void OnUpdateOptionsMinimizetosystray(CCmdUI* pCmdUI);
afx_msg void OnOptionsUppercasehex();
afx_msg void OnUpdateOptionsUppercasehex(CCmdUI* pCmdUI);
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
afx_msg void ChangeTo1pixelSampling();
afx_msg void OnUpdatePopupSampling1pixel(CCmdUI* pCmdUI);
afx_msg void ChangeTo3x3Sampling();
afx_msg void OnUpdatePopupSampling3by3average(CCmdUI* pCmdUI);
afx_msg void ChangeTo5x5Sampling();
afx_msg void OnUpdatePopupSampling5by5average(CCmdUI* pCmdUI);
afx_msg void OnPopupApplicationExpandeddialog();
afx_msg void OnUpdatePopupApplicationExpandeddialog(CCmdUI* pCmdUI);
afx_msg void OnPopupHexmodePowerbuilder();
afx_msg void OnUpdatePopupHexmodePowerbuilder(CCmdUI* pCmdUI);
afx_msg void OnPopupModeVisualbasichex();
afx_msg void OnUpdatePopupModeVisualbasichex(CCmdUI* pCmdUI);
afx_msg void OnPopupModeVisualchex();
afx_msg void OnUpdatePopupModeVisualchex(CCmdUI* pCmdUI);
afx_msg void OnPopupRestore();
afx_msg void OnPopupExit();
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnPopupApplicationHelp();
afx_msg void OnPopupApplicationEasymove();
afx_msg void OnUpdatePopupApplicationEasymove(CCmdUI* pCmdUI);
afx_msg void OnPopupApplicationMinimizetosystemtrayonstart();
afx_msg void OnUpdatePopupApplicationMinimizetosystemtrayonstart(CCmdUI* pCmdUI);
afx_msg void OnCaptureChanged(CWnd *pWnd);
afx_msg void OnPopupColorConverttograyscale();
afx_msg void OnPopupApplicationAllowmultipleinstances();
afx_msg void OnUpdatePopupApplicationAllowmultipleinstances(CCmdUI* pCmdUI);
afx_msg void OnPopupColorDetectwebsafe();
afx_msg void OnUpdatePopupColorDetectwebsafe(CCmdUI* pCmdUI);
afx_msg void OnPopupModeRgbfloat();
afx_msg void OnUpdatePopupModeRgbfloat(CCmdUI* pCmdUI);
afx_msg void OnUpdatePopupModeRgbint(CCmdUI* pCmdUI);
afx_msg void OnPopupModeRgbint();
afx_msg void OnPopupOptionsMagnifywhileeyedropping();
afx_msg void OnUpdatePopupOptionsMagnifywhileeyedropping(CCmdUI* pCmdUI);
afx_msg void OnPopupOptionsUsecrosshaircursor();
afx_msg void OnUpdatePopupOptionsUsecrosshaircursor(CCmdUI* pCmdUI);
afx_msg void OnUpdatePopupOptionsStartcursoroneyedropper(CCmdUI* pCmdUI);
afx_msg void OnPopupOptionsStartcursoroneyedropper();
afx_msg void OnWindowPosChanging(WINDOWPOS FAR* lpwndpos);
afx_msg void OnPopupSamplingDecreasemultipixelaverage();
afx_msg void OnPopupSamplingIncreasemultipixelaverage();
afx_msg void OnPopupSamplingMultipixel();
afx_msg void OnUpdatePopupSamplingMultipixel(CCmdUI* pCmdUI);
afx_msg void OnPopupSpaceRgb();
afx_msg void OnUpdatePopupSpaceRgb(CCmdUI* pCmdUI);
afx_msg void OnPopupSpaceCmyk();
afx_msg void OnUpdatePopupSpaceCmyk(CCmdUI* pCmdUI);
afx_msg void OnChangeBlack();
afx_msg void OnChangeCyan();
afx_msg void OnChangeMagenta();
afx_msg void OnChangeYellow();
afx_msg void OnPopupModeClarionhex();
afx_msg void OnUpdatePopupModeClarionhex(CCmdUI* pCmdUI);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_HTMLCOPDLG_H__EC2A34E6_4FAA_11D3_81A0_A79013DBA62A__INCLUDED_)