ReactOS 0.4.15-dev-5672-gf73ac17
TextTool Struct Reference
Inheritance diagram for TextTool:
Collaboration diagram for TextTool:

Public Member Functions

 TextTool ()
 
void UpdatePoint (LONG x, LONG y)
 
void OnButtonDown (BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick)
 
void OnMouseMove (BOOL bLeftButton, LONG x, LONG y)
 
void OnButtonUp (BOOL bLeftButton, LONG x, LONG y)
 
void OnFinishDraw ()
 
- 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 ()
 
void beginEvent ()
 
void endEvent ()
 
void reset ()
 

Additional Inherited Members

- Static Public Member Functions inherited from ToolBase
static ToolBasecreateToolObject (TOOLTYPE type)
 
- Public Attributes inherited from ToolBase
TOOLTYPE m_tool
 
HDC m_hdc
 
COLORREF m_fg
 
COLORREF m_bg
 
- Static Public Attributes inherited from ToolBase
static INT pointSP = 0
 
static POINT pointStack [256] = { { 0 } }
 

Detailed Description

Definition at line 418 of file mouse.cpp.

Constructor & Destructor Documentation

◆ TextTool()

TextTool::TextTool ( )
inline

Definition at line 420 of file mouse.cpp.

421 {
422 }
@ TOOL_TEXT
Definition: toolsmodel.h:22

Member Function Documentation

◆ OnButtonDown()

void TextTool::OnButtonDown ( BOOL  bLeftButton,
LONG  x,
LONG  y,
BOOL  bDoubleClick 
)
inlinevirtual

Reimplemented from ToolBase.

Definition at line 433 of file mouse.cpp.

434 {
435 if (!textEditWindow.IsWindow())
437
439 UpdatePoint(x, y);
440 }
HWND Create(HWND hwndParent)
Definition: textedit.cpp:297
void CopyPrevious(void)
Definition: history.cpp:47
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
ImageModel imageModel
Definition: main.cpp:32
CImgAreaWindow imageArea
Definition: main.cpp:72
CTextEditWindow textEditWindow
Definition: main.cpp:81
void UpdatePoint(LONG x, LONG y)
Definition: mouse.cpp:424

◆ OnButtonUp()

void TextTool::OnButtonUp ( BOOL  bLeftButton,
LONG  x,
LONG  y 
)
inlinevirtual

Reimplemented from ToolBase.

Definition at line 447 of file mouse.cpp.

448 {
450
451 BOOL bTextBoxShown = ::IsWindowVisible(textEditWindow);
452 if (bTextBoxShown && textEditWindow.GetWindowTextLength() > 0)
453 {
454 CString szText;
455 textEditWindow.GetWindowText(szText);
456
457 RECT rc;
460
463 Text(m_hdc, rc.left, rc.top, rc.right, rc.bottom, m_fg, m_bg, szText,
465 }
466
468 {
469 if (!fontsDialog.IsWindow())
470 fontsDialog.Create(mainWindow);
471
472 fontsDialog.ShowWindow(SW_SHOWNOACTIVATE);
473 }
474
475 if (!bTextBoxShown || selectionModel.IsSrcRectSizeNonzero())
476 {
477 RECT rc;
479
480 // Enlarge if tool small
483 {
484 if (rc.right - rc.left < cxMin)
485 rc.right = rc.left + cxMin;
486 if (rc.bottom - rc.top < cyMin)
487 rc.bottom = rc.top + cyMin;
488 }
489 else
490 {
491 SetRect(&rc, x, y, x + cxMin, y + cyMin);
492 }
493
494 if (!textEditWindow.IsWindow())
496
497 textEditWindow.SetWindowText(NULL);
500 textEditWindow.SetFocus();
501 }
502 else
503 {
504 textEditWindow.ShowWindow(SW_HIDE);
505 textEditWindow.SetWindowText(NULL);
506 }
507 }
Arabic default style
Definition: afstyles.h:94
CFontsDialog fontsDialog
Definition: dialogs.cpp:22
BOOL GetEditRect(LPRECT prc) const
Definition: textedit.cpp:453
void InvalidateEditRect()
Definition: textedit.cpp:354
HFONT GetFont() const
Definition: textedit.h:26
void ValidateEditRect(LPCRECT prc OPTIONAL)
Definition: textedit.cpp:459
void Undo(BOOL bClearRedo=FALSE)
Definition: history.cpp:60
DWORD ShowTextTool
Definition: registry.h:43
void GetRect(LPRECT prc) const
BOOL IsSrcRectSizeNonzero() const
BOOL IsBackgroundTransparent() const
Definition: toolsmodel.cpp:135
char * Text
Definition: combotst.c:136
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
static INT cxMin
Definition: eventvwr.c:4314
static INT cyMin
Definition: eventvwr.c:4314
unsigned int BOOL
Definition: ntddk_ex.h:94
ToolsModel toolsModel
Definition: main.cpp:18
RegistrySettings registrySettings
Definition: main.cpp:30
SelectionModel selectionModel
Definition: main.cpp:20
CMainWindow mainWindow
Definition: main.cpp:63
HDC m_hdc
Definition: toolsmodel.h:37
COLORREF m_fg
Definition: toolsmodel.h:38
COLORREF m_bg
Definition: toolsmodel.h:38
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
int32_t INT
Definition: typedefs.h:58
#define SW_HIDE
Definition: winuser.h:762
#define SW_SHOWNOACTIVATE
Definition: winuser.h:768
BOOL WINAPI IsWindowVisible(_In_ HWND)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)

◆ OnFinishDraw()

void TextTool::OnFinishDraw ( )
inlinevirtual

Reimplemented from ToolBase.

Definition at line 509 of file mouse.cpp.

510 {
512 toolsModel.OnButtonUp(TRUE, -1, -1);
515 }
BOOL IsMoved() const
Definition: selection.h:19
void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick)
Definition: toolsmodel.cpp:191
void OnButtonUp(BOOL bLeftButton, LONG x, LONG y)
Definition: toolsmodel.cpp:207
#define FALSE
Definition: types.h:117
CSelectionWindow selectionWindow
Definition: main.cpp:71
virtual void OnFinishDraw()
Definition: mouse.cpp:90

◆ OnMouseMove()

void TextTool::OnMouseMove ( BOOL  bLeftButton,
LONG  x,
LONG  y 
)
inlinevirtual

Reimplemented from ToolBase.

Definition at line 442 of file mouse.cpp.

443 {
444 UpdatePoint(x, y);
445 }

◆ UpdatePoint()

void TextTool::UpdatePoint ( LONG  x,
LONG  y 
)
inline

Definition at line 424 of file mouse.cpp.

425 {
427 POINT pt = { x, y };
430 RectSel(m_hdc, start.x, start.y, pt.x, pt.y);
431 }
void ResetToPrevious(void)
Definition: history.cpp:100
void Bound(POINT &pt)
Definition: history.cpp:305
void SetSrcAndDestRectFromPoints(const POINT &ptFrom, const POINT &ptTo)
#define pt(x, y)
Definition: drawing.c:79
void RectSel(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2)
Definition: drawing.cpp:228
GLuint start
Definition: gl.h:1545

Referenced by OnButtonDown(), and OnMouseMove().


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