ReactOS 0.4.15-dev-5895-g2687c1b
mouse.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: PAINT for ReactOS
3 * LICENSE: LGPL
4 * FILE: base/applications/mspaint/mouse.cpp
5 * PURPOSE: Things which should not be in the mouse event handler itself
6 * PROGRAMMERS: Benedikt Freisen
7 * Katayama Hirofumi MZ
8 */
9
10/* INCLUDES *********************************************************/
11
12#include "precomp.h"
13
15POINT ToolBase::pointStack[256] = { { 0 } };
16
17/* FUNCTIONS ********************************************************/
18
19void
21{
22 CRect rc;
28 selectionWindow.MoveWindow(rc.left, rc.top, rc.Width(), rc.Height(), TRUE);
29 selectionWindow.BringWindowToTop();
30 imageArea.InvalidateRect(NULL, FALSE);
31}
32
33void
35{
36 if (abs(x1 - x0) >= abs(y1 - y0))
37 y1 = y0 + (y1 > y0 ? abs(x1 - x0) : -abs(x1 - x0));
38 else
39 x1 = x0 + (x1 > x0 ? abs(y1 - y0) : -abs(y1 - y0));
40}
41
42void
44{
45 if (abs(x1 - x0) >= abs(y1 - y0))
46 {
47 if (abs(y1 - y0) * 5 < abs(x1 - x0) * 2)
48 y1 = y0;
49 else
50 y1 = y0 + (y1 > y0 ? abs(x1 - x0) : -abs(x1 - x0));
51 }
52 else
53 {
54 if (abs(x1 - x0) * 5 < abs(y1 - y0) * 2)
55 x1 = x0;
56 else
57 x1 = x0 + (x1 > x0 ? abs(y1 - y0) : -abs(y1 - y0));
58 }
59}
60
62{
65 return (abs(x1 - x0) <= cxThreshold) && (abs(y1 - y0) <= cyThreshold);
66}
67
69{
70 start.x = last.x = x;
71 start.y = last.y = y;
72}
73
75{
76 last.x = x;
77 last.y = y;
78}
79
81{
82 pointSP = 0;
83 start.x = start.y = last.x = last.y = -1;
85 if (selectionWindow.IsWindow())
86 selectionWindow.ShowWindow(SW_HIDE);
87}
88
90{
91 reset();
92}
93
95{
96 reset();
97}
98
100{
104}
105
107{
108 m_hdc = NULL;
109}
110
111/* TOOLS ********************************************************/
112
113// TOOL_FREESEL
115{
117
119 {
120 }
121
122 void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick)
123 {
124 if (bLeftButton)
125 {
127 selectionWindow.ShowWindow(SW_HIDE);
130 }
131 m_bLeftButton = bLeftButton;
132 }
133
134 void OnMouseMove(BOOL bLeftButton, LONG x, LONG y)
135 {
136 if (bLeftButton)
137 {
138 POINT pt = { x, y };
143 }
144 }
145
146 void OnButtonUp(BOOL bLeftButton, LONG x, LONG y)
147 {
148 if (bLeftButton)
149 {
151 if (selectionModel.PtStackSize() > 2)
152 {
154 placeSelWin();
157 }
158 else
159 {
163 selectionWindow.ShowWindow(SW_HIDE);
164 }
165 }
166 }
167
169 {
170 if (m_bLeftButton)
171 {
174 }
177 }
178
180 {
181 if (m_bLeftButton)
186 }
187};
188
189// TOOL_RECTSEL
191{
193
195 {
196 }
197
198 void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick)
199 {
200 if (bLeftButton)
201 {
203 selectionWindow.ShowWindow(SW_HIDE);
205 }
206 m_bLeftButton = bLeftButton;
207 }
208
209 void OnMouseMove(BOOL bLeftButton, LONG x, LONG y)
210 {
211 if (bLeftButton)
212 {
214 POINT pt = { x, y };
217 RectSel(m_hdc, start.x, start.y, pt.x, pt.y);
218 }
219 }
220
221 void OnButtonUp(BOOL bLeftButton, LONG x, LONG y)
222 {
223 if (bLeftButton)
224 {
226 if (start.x == x && start.y == y)
229 placeSelWin();
233 else
234 selectionWindow.ShowWindow(SW_HIDE);
235 }
236 }
237
239 {
240 if (m_bLeftButton)
241 {
244 }
247 }
248
250 {
251 if (m_bLeftButton)
256 }
257};
258
260{
262 {
263 }
264
265 virtual void draw(BOOL bLeftButton, LONG x, LONG y) = 0;
266
267 void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick)
268 {
270 draw(bLeftButton, x, y);
271 }
272
273 void OnMouseMove(BOOL bLeftButton, LONG x, LONG y)
274 {
275 draw(bLeftButton, x, y);
276 }
277
278 void OnButtonUp(BOOL bLeftButton, LONG x, LONG y)
279 {
280 draw(bLeftButton, x, y);
281 }
282
284 {
285 OnButtonUp(FALSE, 0, 0);
288 }
289};
290
291// TOOL_RUBBER
293{
295 {
296 }
297
298 virtual void draw(BOOL bLeftButton, LONG x, LONG y)
299 {
300 if (bLeftButton)
302 else
304 }
305};
306
307// TOOL_FILL
309{
311 {
312 }
313
314 void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick)
315 {
317 Fill(m_hdc, x, y, bLeftButton ? m_fg : m_bg);
318 }
319};
320
321// TOOL_COLOR
323{
325 {
326 }
327
328 void fetchColor(BOOL bLeftButton, LONG x, LONG y)
329 {
330 COLORREF rgbColor;
331
332 if (0 <= x && x < imageModel.GetWidth() && 0 <= y && y < imageModel.GetHeight())
333 rgbColor = GetPixel(m_hdc, x, y);
334 else
335 rgbColor = RGB(255, 255, 255); // Outside is white
336
337 if (bLeftButton)
338 paletteModel.SetFgColor(rgbColor);
339 else
340 paletteModel.SetBgColor(rgbColor);
341 }
342
343 void OnMouseMove(BOOL bLeftButton, LONG x, LONG y)
344 {
345 fetchColor(bLeftButton, x, y);
346 }
347
348 void OnButtonUp(BOOL bLeftButton, LONG x, LONG y)
349 {
350 fetchColor(bLeftButton, x, y);
352 }
353};
354
355// TOOL_ZOOM
357{
359 {
360 }
361
362 void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick)
363 {
365 if (bLeftButton)
366 {
368 zoomTo(toolsModel.GetZoom() * 2, x, y);
369 }
370 else
371 {
373 zoomTo(toolsModel.GetZoom() / 2, x, y);
374 }
375 }
376};
377
378// TOOL_PEN
380{
382 {
383 }
384
385 virtual void draw(BOOL bLeftButton, LONG x, LONG y)
386 {
387 COLORREF rgb = bLeftButton ? m_fg : m_bg;
388 Line(m_hdc, last.x, last.y, x, y, rgb, 1);
389 SetPixel(m_hdc, x, y, rgb);
390 }
391};
392
393// TOOL_BRUSH
395{
397 {
398 }
399
400 virtual void draw(BOOL bLeftButton, LONG x, LONG y)
401 {
402 COLORREF rgb = bLeftButton ? m_fg : m_bg;
404 }
405};
406
407// TOOL_AIRBRUSH
409{
411 {
412 }
413
414 virtual void draw(BOOL bLeftButton, LONG x, LONG y)
415 {
416 COLORREF rgb = bLeftButton ? m_fg : m_bg;
418 }
419};
420
421// TOOL_TEXT
423{
425 {
426 }
427
429 {
431 POINT pt = { x, y };
434 RectSel(m_hdc, start.x, start.y, pt.x, pt.y);
435 }
436
437 void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick)
438 {
439 if (!textEditWindow.IsWindow())
441
443 UpdatePoint(x, y);
444 }
445
446 void OnMouseMove(BOOL bLeftButton, LONG x, LONG y)
447 {
448 UpdatePoint(x, y);
449 }
450
451 void OnButtonUp(BOOL bLeftButton, LONG x, LONG y)
452 {
454
455 BOOL bTextBoxShown = ::IsWindowVisible(textEditWindow);
456 if (bTextBoxShown && textEditWindow.GetWindowTextLength() > 0)
457 {
458 CString szText;
459 textEditWindow.GetWindowText(szText);
460
461 RECT rc;
464
467 Text(m_hdc, rc.left, rc.top, rc.right, rc.bottom, m_fg, m_bg, szText,
469 }
470
472 {
473 if (!fontsDialog.IsWindow())
474 fontsDialog.Create(mainWindow);
475
476 fontsDialog.ShowWindow(SW_SHOWNOACTIVATE);
477 }
478
479 if (!bTextBoxShown || selectionModel.IsSrcRectSizeNonzero())
480 {
481 RECT rc;
483
484 // Enlarge if tool small
487 {
488 if (rc.right - rc.left < cxMin)
489 rc.right = rc.left + cxMin;
490 if (rc.bottom - rc.top < cyMin)
491 rc.bottom = rc.top + cyMin;
492 }
493 else
494 {
495 SetRect(&rc, x, y, x + cxMin, y + cyMin);
496 }
497
498 if (!textEditWindow.IsWindow())
500
501 textEditWindow.SetWindowText(NULL);
504 textEditWindow.SetFocus();
505 }
506 else
507 {
508 textEditWindow.ShowWindow(SW_HIDE);
509 textEditWindow.SetWindowText(NULL);
510 }
511 }
512
514 {
516 toolsModel.OnButtonUp(TRUE, -1, -1);
519 }
520};
521
522// TOOL_LINE
524{
526 {
527 }
528
529 virtual void draw(BOOL bLeftButton, LONG x, LONG y)
530 {
532 if (GetAsyncKeyState(VK_SHIFT) < 0)
534 COLORREF rgb = bLeftButton ? m_fg : m_bg;
536 }
537};
538
539// TOOL_BEZIER
541{
543
545 {
546 }
547
548 void draw(BOOL bLeftButton)
549 {
550 COLORREF rgb = (bLeftButton ? m_fg : m_bg);
551 switch (pointSP)
552 {
553 case 1:
556 break;
557 case 2:
559 break;
560 case 3:
562 break;
563 }
564 m_bLeftButton = bLeftButton;
565 }
566
567 void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick)
568 {
571
572 if (pointSP == 0)
573 {
575 pointSP++;
576 }
577 }
578
579 void OnMouseMove(BOOL bLeftButton, LONG x, LONG y)
580 {
584 draw(bLeftButton);
585 }
586
587 void OnButtonUp(BOOL bLeftButton, LONG x, LONG y)
588 {
590 draw(bLeftButton);
591 pointSP++;
592 if (pointSP == 4)
593 pointSP = 0;
594 }
595
597 {
598 OnButtonUp(FALSE, 0, 0);
601 }
602
604 {
605 if (pointSP)
606 {
608 --pointSP;
610 }
612 }
613};
614
615// TOOL_RECT
617{
619 {
620 }
621
622 virtual void draw(BOOL bLeftButton, LONG x, LONG y)
623 {
625 if (GetAsyncKeyState(VK_SHIFT) < 0)
626 regularize(start.x, start.y, x, y);
627 if (bLeftButton)
629 else
631 }
632};
633
634// TOOL_SHAPE
636{
638
640 {
641 }
642
643 void draw(BOOL bLeftButton, LONG x, LONG y, BOOL bClosed = FALSE)
644 {
645 if (pointSP + 1 >= 2)
646 {
647 if (bLeftButton)
649 else
651 }
652 m_bLeftButton = bLeftButton;
653 }
654
655 void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick)
656 {
659
660 if (pointSP == 0 && !bDoubleClick)
661 {
663 draw(bLeftButton, x, y);
664 pointSP++;
665 }
666 else
667 {
668 draw(bLeftButton, x, y, bDoubleClick);
669 }
670 }
671
672 void OnMouseMove(BOOL bLeftButton, LONG x, LONG y)
673 {
677 if ((pointSP > 0) && (GetAsyncKeyState(VK_SHIFT) < 0))
679 draw(bLeftButton, x, y, FALSE);
680 }
681
682 void OnButtonUp(BOOL bLeftButton, LONG x, LONG y)
683 {
685 if ((pointSP > 0) && (GetAsyncKeyState(VK_SHIFT) < 0))
687
689 {
690 pointSP--;
691 draw(bLeftButton, x, y, TRUE);
692 pointSP = 0;
693 }
694 else
695 {
696 pointSP++;
699 draw(bLeftButton, x, y, FALSE);
700 }
701
703 pointSP--;
704 }
705
707 {
710 }
711
713 {
714 if (pointSP)
715 {
717 --pointSP;
718 draw(m_bLeftButton, -1, -1, TRUE);
719 }
721 }
722};
723
724// TOOL_ELLIPSE
726{
728 {
729 }
730
731 virtual void draw(BOOL bLeftButton, LONG x, LONG y)
732 {
734 if (GetAsyncKeyState(VK_SHIFT) < 0)
735 regularize(start.x, start.y, x, y);
736 if (bLeftButton)
738 else
740 }
741};
742
743// TOOL_RRECT
745{
747 {
748 }
749
750 virtual void draw(BOOL bLeftButton, LONG x, LONG y)
751 {
753 if (GetAsyncKeyState(VK_SHIFT) < 0)
754 regularize(start.x, start.y, x, y);
755 if (bLeftButton)
757 else
759 }
760};
761
762/*static*/ ToolBase*
764{
765 switch (type)
766 {
767 case TOOL_FREESEL: return new FreeSelTool();
768 case TOOL_RECTSEL: return new RectSelTool();
769 case TOOL_RUBBER: return new RubberTool();
770 case TOOL_FILL: return new FillTool();
771 case TOOL_COLOR: return new ColorTool();
772 case TOOL_ZOOM: return new ZoomTool();
773 case TOOL_PEN: return new PenTool();
774 case TOOL_BRUSH: return new BrushTool();
775 case TOOL_AIRBRUSH: return new AirBrushTool();
776 case TOOL_TEXT: return new TextTool();
777 case TOOL_LINE: return new LineTool();
778 case TOOL_BEZIER: return new BezierTool();
779 case TOOL_RECT: return new RectTool();
780 case TOOL_SHAPE: return new ShapeTool();
781 case TOOL_ELLIPSE: return new EllipseTool();
782 case TOOL_RRECT: return new RRectTool();
783 }
785 return NULL;
786}
Arabic default style
Definition: afstyles.h:94
FORCEINLINE VOID SetPixel(_In_ ULONG Left, _In_ ULONG Top, _In_ UCHAR Color)
Definition: arm.h:50
#define GRIP_SIZE
Definition: common.h:13
#define MAX_ZOOM
Definition: common.h:15
#define MIN_ZOOM
Definition: common.h:14
BOOL zoomTo(int newZoom, int mouseX, int mouseY)
Definition: winproc.cpp:46
CFontsDialog fontsDialog
Definition: dialogs.cpp:22
void updateLast(LONG x, LONG y)
Definition: mouse.cpp:74
BOOL nearlyEqualPoints(INT x0, INT y0, INT x1, INT y1)
Definition: mouse.cpp:61
void regularize(LONG x0, LONG y0, LONG &x1, LONG &y1)
Definition: mouse.cpp:34
void placeSelWin()
Definition: mouse.cpp:20
void roundTo8Directions(LONG x0, LONG y0, LONG &x1, LONG &y1)
Definition: mouse.cpp:43
void updateStartAndLast(LONG x, LONG y)
Definition: mouse.cpp:68
DWORD GetPixel(LPDIRECTDRAWSURFACE7 Surface, UINT x, UINT y)
Definition: blt.cpp:2
int Width() const
Definition: atltypes.h:407
int Height() const
Definition: atltypes.h:318
void ForceRefreshSelectionContents()
Definition: selection.cpp:24
BOOL IsMoved() const
Definition: selection.h:19
BOOL GetEditRect(LPRECT prc) const
Definition: textedit.cpp:387
void InvalidateEditRect()
Definition: textedit.cpp:288
HWND Create(HWND hwndParent)
Definition: textedit.cpp:231
HFONT GetFont() const
Definition: textedit.h:26
void ValidateEditRect(LPCRECT prc OPTIONAL)
Definition: textedit.cpp:393
void ResetToPrevious(void)
Definition: history.cpp:100
int GetWidth() const
Definition: history.cpp:215
void CopyPrevious(void)
Definition: history.cpp:47
void Undo(BOOL bClearRedo=FALSE)
Definition: history.cpp:60
int GetHeight() const
Definition: history.cpp:220
void Bound(POINT &pt)
Definition: history.cpp:305
HDC GetDC()
Definition: history.cpp:239
COLORREF GetBgColor() const
void SetFgColor(COLORREF newColor)
void SetBgColor(COLORREF newColor)
COLORREF GetFgColor() const
DWORD ShowTextTool
Definition: registry.h:42
LONG GetDestRectTop() const
void PushToPtStack(LONG x, LONG y)
void CalculateBoundingBoxAndContents(HDC hDCImage)
LONG GetDestRectHeight() const
int PtStackSize() const
LONG GetDestRectLeft() const
void CalculateContents(HDC hDCImage)
void SetSrcRectSizeToZero()
LONG GetDestRectWidth() const
void DrawFramePoly(HDC hDCImage)
void SetSrcAndDestRectFromPoints(const POINT &ptFrom, const POINT &ptTo)
void GetRect(LPRECT prc) const
BOOL IsSrcRectSizeNonzero() const
int GetZoom() const
Definition: toolsmodel.cpp:148
int GetAirBrushWidth() const
Definition: toolsmodel.cpp:113
int GetLineWidth() const
Definition: toolsmodel.cpp:43
int GetShapeStyle() const
Definition: toolsmodel.cpp:54
TOOLTYPE GetOldActiveTool() const
Definition: toolsmodel.cpp:81
void SetActiveTool(TOOLTYPE nActiveTool)
Definition: toolsmodel.cpp:86
int GetBrushStyle() const
Definition: toolsmodel.cpp:65
void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick)
Definition: toolsmodel.cpp:191
BOOL IsBackgroundTransparent() const
Definition: toolsmodel.cpp:135
int GetRubberRadius() const
Definition: toolsmodel.cpp:124
void OnButtonUp(BOOL bLeftButton, LONG x, LONG y)
Definition: toolsmodel.cpp:207
char * Text
Definition: combotst.c:136
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define pt(x, y)
Definition: drawing.c:79
void RectSel(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2)
Definition: drawing.cpp:236
void Bezier(HDC hdc, POINT p1, POINT p2, POINT p3, POINT p4, COLORREF color, int thickness)
Definition: drawing.cpp:95
void Ellp(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF fg, COLORREF bg, int thickness, int style)
Definition: drawing.cpp:40
void Poly(HDC hdc, POINT *lpPoints, int nCount, COLORREF fg, COLORREF bg, int thickness, int style, BOOL closed, BOOL inverted)
Definition: drawing.cpp:70
void RRect(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF fg, COLORREF bg, int thickness, int style)
Definition: drawing.cpp:55
void Replace(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF fg, COLORREF bg, LONG radius)
Definition: drawing.cpp:136
void Erase(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF color, LONG radius)
Definition: drawing.cpp:117
void Airbrush(HDC hdc, LONG x, LONG y, COLORREF color, LONG r)
Definition: drawing.cpp:151
void Fill(HDC hdc, LONG x, LONG y, COLORREF color)
Definition: drawing.cpp:109
#define RGB(r, g, b)
Definition: precomp.h:62
static INT cxMin
Definition: eventvwr.c:4314
static INT cyMin
Definition: eventvwr.c:4314
#define abs(i)
Definition: fconv.c:206
unsigned int BOOL
Definition: ntddk_ex.h:94
GLuint start
Definition: gl.h:1545
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
ToolsModel toolsModel
Definition: toolsmodel.cpp:11
CSelectionWindow selectionWindow
Definition: selection.cpp:12
ImageModel imageModel
Definition: history.cpp:11
RegistrySettings registrySettings
Definition: registry.cpp:15
SelectionModel selectionModel
CImgAreaWindow imageArea
Definition: imgarea.cpp:13
POINT last
Definition: font.c:46
CMainWindow mainWindow
Definition: main.cpp:21
CTextEditWindow textEditWindow
Definition: textedit.cpp:13
PaletteModel paletteModel
GLint y0
Definition: linetemp.h:96
GLint x0
Definition: linetemp.h:95
#define UNREACHABLE
long LONG
Definition: pedump.c:60
#define _countof(array)
Definition: sndvol32.h:68
virtual void draw(BOOL bLeftButton, LONG x, LONG y)
Definition: mouse.cpp:414
AirBrushTool()
Definition: mouse.cpp:410
void OnCancelDraw()
Definition: mouse.cpp:596
void OnFinishDraw()
Definition: mouse.cpp:603
BezierTool()
Definition: mouse.cpp:544
void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick)
Definition: mouse.cpp:567
void OnMouseMove(BOOL bLeftButton, LONG x, LONG y)
Definition: mouse.cpp:579
BOOL m_bLeftButton
Definition: mouse.cpp:542
void draw(BOOL bLeftButton)
Definition: mouse.cpp:548
void OnButtonUp(BOOL bLeftButton, LONG x, LONG y)
Definition: mouse.cpp:587
virtual void draw(BOOL bLeftButton, LONG x, LONG y)
Definition: mouse.cpp:400
BrushTool()
Definition: mouse.cpp:396
void OnMouseMove(BOOL bLeftButton, LONG x, LONG y)
Definition: mouse.cpp:343
void fetchColor(BOOL bLeftButton, LONG x, LONG y)
Definition: mouse.cpp:328
void OnButtonUp(BOOL bLeftButton, LONG x, LONG y)
Definition: mouse.cpp:348
ColorTool()
Definition: mouse.cpp:324
virtual void draw(BOOL bLeftButton, LONG x, LONG y)
Definition: mouse.cpp:731
EllipseTool()
Definition: mouse.cpp:727
FillTool()
Definition: mouse.cpp:310
void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick)
Definition: mouse.cpp:314
void OnCancelDraw()
Definition: mouse.cpp:179
void OnFinishDraw()
Definition: mouse.cpp:168
FreeSelTool()
Definition: mouse.cpp:118
void OnMouseMove(BOOL bLeftButton, LONG x, LONG y)
Definition: mouse.cpp:134
BOOL m_bLeftButton
Definition: mouse.cpp:116
void OnButtonUp(BOOL bLeftButton, LONG x, LONG y)
Definition: mouse.cpp:146
void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick)
Definition: mouse.cpp:122
void OnCancelDraw()
Definition: mouse.cpp:283
GenericDrawTool(TOOLTYPE type)
Definition: mouse.cpp:261
void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick)
Definition: mouse.cpp:267
void OnButtonUp(BOOL bLeftButton, LONG x, LONG y)
Definition: mouse.cpp:278
void OnMouseMove(BOOL bLeftButton, LONG x, LONG y)
Definition: mouse.cpp:273
virtual void draw(BOOL bLeftButton, LONG x, LONG y)=0
LineTool()
Definition: mouse.cpp:525
virtual void draw(BOOL bLeftButton, LONG x, LONG y)
Definition: mouse.cpp:529
Definition: ncftp.h:79
virtual void draw(BOOL bLeftButton, LONG x, LONG y)
Definition: mouse.cpp:385
PenTool()
Definition: mouse.cpp:381
RRectTool()
Definition: mouse.cpp:746
virtual void draw(BOOL bLeftButton, LONG x, LONG y)
Definition: mouse.cpp:750
void OnCancelDraw()
Definition: mouse.cpp:249
RectSelTool()
Definition: mouse.cpp:194
BOOL m_bLeftButton
Definition: mouse.cpp:192
void OnFinishDraw()
Definition: mouse.cpp:238
void OnMouseMove(BOOL bLeftButton, LONG x, LONG y)
Definition: mouse.cpp:209
void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick)
Definition: mouse.cpp:198
void OnButtonUp(BOOL bLeftButton, LONG x, LONG y)
Definition: mouse.cpp:221
RectTool()
Definition: mouse.cpp:618
virtual void draw(BOOL bLeftButton, LONG x, LONG y)
Definition: mouse.cpp:622
RubberTool()
Definition: mouse.cpp:294
virtual void draw(BOOL bLeftButton, LONG x, LONG y)
Definition: mouse.cpp:298
void OnFinishDraw()
Definition: mouse.cpp:712
void OnButtonUp(BOOL bLeftButton, LONG x, LONG y)
Definition: mouse.cpp:682
void OnCancelDraw()
Definition: mouse.cpp:706
void draw(BOOL bLeftButton, LONG x, LONG y, BOOL bClosed=FALSE)
Definition: mouse.cpp:643
ShapeTool()
Definition: mouse.cpp:639
void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick)
Definition: mouse.cpp:655
BOOL m_bLeftButton
Definition: mouse.cpp:637
void OnMouseMove(BOOL bLeftButton, LONG x, LONG y)
Definition: mouse.cpp:672
TextTool()
Definition: mouse.cpp:424
void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick)
Definition: mouse.cpp:437
void OnMouseMove(BOOL bLeftButton, LONG x, LONG y)
Definition: mouse.cpp:446
void OnButtonUp(BOOL bLeftButton, LONG x, LONG y)
Definition: mouse.cpp:451
void UpdatePoint(LONG x, LONG y)
Definition: mouse.cpp:428
void OnFinishDraw()
Definition: mouse.cpp:513
void endEvent()
Definition: mouse.cpp:106
HDC m_hdc
Definition: toolsmodel.h:37
static INT pointSP
Definition: toolsmodel.h:39
virtual void OnCancelDraw()
Definition: mouse.cpp:89
void reset()
Definition: mouse.cpp:80
virtual void OnFinishDraw()
Definition: mouse.cpp:94
static ToolBase * createToolObject(TOOLTYPE type)
Definition: mouse.cpp:763
COLORREF m_fg
Definition: toolsmodel.h:38
void beginEvent()
Definition: mouse.cpp:99
static POINT pointStack[256]
Definition: toolsmodel.h:40
COLORREF m_bg
Definition: toolsmodel.h:38
ZoomTool()
Definition: mouse.cpp:358
void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick)
Definition: mouse.cpp:362
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
#define CY_MINTEXTEDIT
Definition: textedit.h:12
#define CX_MINTEXTEDIT
Definition: textedit.h:11
static int UnZoomed(int xy)
Definition: toolsmodel.h:131
TOOLTYPE
Definition: toolsmodel.h:12
@ TOOL_AIRBRUSH
Definition: toolsmodel.h:21
@ TOOL_COLOR
Definition: toolsmodel.h:17
@ TOOL_SHAPE
Definition: toolsmodel.h:26
@ TOOL_RUBBER
Definition: toolsmodel.h:15
@ TOOL_BRUSH
Definition: toolsmodel.h:20
@ TOOL_RECT
Definition: toolsmodel.h:25
@ TOOL_BEZIER
Definition: toolsmodel.h:24
@ TOOL_FILL
Definition: toolsmodel.h:16
@ TOOL_TEXT
Definition: toolsmodel.h:22
@ TOOL_PEN
Definition: toolsmodel.h:19
@ TOOL_LINE
Definition: toolsmodel.h:23
@ TOOL_FREESEL
Definition: toolsmodel.h:13
@ TOOL_ZOOM
Definition: toolsmodel.h:18
@ TOOL_ELLIPSE
Definition: toolsmodel.h:27
@ TOOL_RRECT
Definition: toolsmodel.h:28
@ TOOL_RECTSEL
Definition: toolsmodel.h:14
static int Zoomed(int xy)
Definition: toolsmodel.h:126
int32_t INT
Definition: typedefs.h:58
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
Definition: winddi.h:3709
_In_ ULONG _In_ ULONG rgb
Definition: winddi.h:3521
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3708
DWORD COLORREF
Definition: windef.h:300
#define SW_HIDE
Definition: winuser.h:762
#define SM_CXDRAG
Definition: winuser.h:1022
#define SW_SHOWNOACTIVATE
Definition: winuser.h:768
#define VK_SHIFT
Definition: winuser.h:2192
SHORT WINAPI GetAsyncKeyState(_In_ int)
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define SM_CYDRAG
Definition: winuser.h:1023
BOOL WINAPI IsWindowVisible(_In_ HWND)
int WINAPI GetSystemMetrics(_In_ int)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)