ReactOS 0.4.15-dev-6656-gbbb33a6
ShapeTool Struct Reference
Inheritance diagram for ShapeTool:
Collaboration diagram for ShapeTool:

Public Member Functions

 ShapeTool ()
 
void OnDrawOverlayOnImage (HDC hdc)
 
void OnButtonDown (BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick) override
 
void OnMouseMove (BOOL bLeftButton, LONG x, LONG y) override
 
void OnButtonUp (BOOL bLeftButton, LONG x, LONG y) override
 
void OnCancelDraw () override
 
void OnFinishDraw () override
 
- Public Member Functions inherited from ToolBase
 ToolBase (TOOLTYPE tool)
 
virtual ~ToolBase ()
 
virtual void OnButtonDown (BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick)
 
virtual void OnMouseMove (BOOL bLeftButton, LONG x, LONG y)
 
virtual void OnButtonUp (BOOL bLeftButton, LONG x, LONG y)
 
virtual void OnCancelDraw ()
 
virtual void OnFinishDraw ()
 
virtual void OnDrawOverlayOnImage (HDC hdc)
 
virtual void OnDrawOverlayOnCanvas (HDC hdc)
 
void beginEvent ()
 
void endEvent ()
 
void reset ()
 

Public Attributes

BOOL m_bLeftButton = FALSE
 
BOOL m_bClosed = FALSE
 
- Public Attributes inherited from ToolBase
TOOLTYPE m_tool
 
HDC m_hdc
 
COLORREF m_fg
 
COLORREF m_bg
 

Additional Inherited Members

- Static Public Member Functions inherited from ToolBase
static ToolBasecreateToolObject (TOOLTYPE type)
 
- Static Public Attributes inherited from ToolBase
static INT s_pointSP = 0
 
static POINT s_pointStack [256] = { { 0 } }
 
- Protected Member Functions inherited from ToolBase
void OnDrawSelectionOnCanvas (HDC hdc)
 

Detailed Description

Definition at line 768 of file mouse.cpp.

Constructor & Destructor Documentation

◆ ShapeTool()

ShapeTool::ShapeTool ( )
inline

Definition at line 773 of file mouse.cpp.

774 {
775 }
@ TOOL_SHAPE
Definition: toolsmodel.h:25

Member Function Documentation

◆ OnButtonDown()

void ShapeTool::OnButtonDown ( BOOL  bLeftButton,
LONG  x,
LONG  y,
BOOL  bDoubleClick 
)
inlineoverridevirtual

Reimplemented from ToolBase.

Definition at line 788 of file mouse.cpp.

789 {
790 m_bLeftButton = bLeftButton;
792
793 if ((s_pointSP > 0) && (GetAsyncKeyState(VK_SHIFT) < 0))
795
798
799 if (s_pointSP && bDoubleClick)
800 {
801 OnFinishDraw();
802 return;
803 }
804
805 if (s_pointSP == 0)
806 {
807 s_pointSP++;
810 }
811
813 }
void roundTo8Directions(LONG x0, LONG y0, LONG &x1, LONG &y1)
Definition: mouse.cpp:28
void NotifyImageChanged()
Definition: history.cpp:15
#define FALSE
Definition: types.h:117
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
ImageModel imageModel
Definition: history.cpp:11
BOOL m_bClosed
Definition: mouse.cpp:771
void OnFinishDraw() override
Definition: mouse.cpp:855
BOOL m_bLeftButton
Definition: mouse.cpp:770
static POINT s_pointStack[256]
Definition: toolsmodel.h:39
static INT s_pointSP
Definition: toolsmodel.h:38
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define VK_SHIFT
Definition: winuser.h:2192
SHORT WINAPI GetAsyncKeyState(_In_ int)

◆ OnButtonUp()

void ShapeTool::OnButtonUp ( BOOL  bLeftButton,
LONG  x,
LONG  y 
)
inlineoverridevirtual

Reimplemented from ToolBase.

Definition at line 826 of file mouse.cpp.

827 {
828 if ((s_pointSP > 0) && (GetAsyncKeyState(VK_SHIFT) < 0))
830
833 {
834 OnFinishDraw();
835 return;
836 }
837 else
838 {
839 s_pointSP++;
842 }
843
845 s_pointSP--;
846
848 }
BOOL nearlyEqualPoints(INT x0, INT y0, INT x1, INT y1)
Definition: mouse.cpp:46
#define _countof(array)
Definition: sndvol32.h:68

◆ OnCancelDraw()

void ShapeTool::OnCancelDraw ( )
inlineoverridevirtual

Reimplemented from ToolBase.

Definition at line 850 of file mouse.cpp.

851 {
853 }
virtual void OnCancelDraw()
Definition: mouse.cpp:77

◆ OnDrawOverlayOnImage()

void ShapeTool::OnDrawOverlayOnImage ( HDC  hdc)
inlinevirtual

Reimplemented from ToolBase.

Definition at line 777 of file mouse.cpp.

778 {
779 if (s_pointSP <= 0)
780 return;
781
782 if (m_bLeftButton)
784 else
786 }
int GetLineWidth() const
Definition: toolsmodel.cpp:47
int GetShapeStyle() const
Definition: toolsmodel.cpp:58
void Poly(HDC hdc, POINT *lpPoints, int nCount, COLORREF fg, COLORREF bg, int thickness, int style, BOOL closed, BOOL inverted)
Definition: drawing.cpp:69
ToolsModel toolsModel
Definition: toolsmodel.cpp:10
HDC hdc
Definition: main.c:9
COLORREF m_fg
Definition: toolsmodel.h:37
COLORREF m_bg
Definition: toolsmodel.h:37

Referenced by OnFinishDraw().

◆ OnFinishDraw()

void ShapeTool::OnFinishDraw ( )
inlineoverridevirtual

Reimplemented from ToolBase.

Definition at line 855 of file mouse.cpp.

856 {
857 if (s_pointSP)
858 {
859 --s_pointSP;
860 m_bClosed = TRUE;
861
864 }
865
867 s_pointSP = 0;
868
870 }
void PushImageForUndo(HBITMAP hbm=NULL)
Definition: history.cpp:106
#define TRUE
Definition: types.h:120
void OnDrawOverlayOnImage(HDC hdc)
Definition: mouse.cpp:777
HDC m_hdc
Definition: toolsmodel.h:36
virtual void OnFinishDraw()
Definition: mouse.cpp:83

Referenced by OnButtonDown(), and OnButtonUp().

◆ OnMouseMove()

void ShapeTool::OnMouseMove ( BOOL  bLeftButton,
LONG  x,
LONG  y 
)
inlineoverridevirtual

Reimplemented from ToolBase.

Definition at line 815 of file mouse.cpp.

Member Data Documentation

◆ m_bClosed

BOOL ShapeTool::m_bClosed = FALSE

Definition at line 771 of file mouse.cpp.

Referenced by OnButtonDown(), OnButtonUp(), OnDrawOverlayOnImage(), and OnFinishDraw().

◆ m_bLeftButton

BOOL ShapeTool::m_bLeftButton = FALSE

Definition at line 770 of file mouse.cpp.

Referenced by OnButtonDown(), and OnDrawOverlayOnImage().


The documentation for this struct was generated from the following file: