ReactOS  0.4.15-dev-5615-gc3644fd
textedit.h
Go to the documentation of this file.
1 /*
2  * PROJECT: PAINT for ReactOS
3  * LICENSE: LGPL
4  * FILE: base/applications/mspaint/textedit.h
5  * PURPOSE: Text editor and font chooser for the text tool
6  * PROGRAMMERS: Benedikt Freisen
7  */
8 
9 #pragma once
10 
11 #define CX_MINTEXTEDIT 100
12 #define CY_MINTEXTEDIT 24
13 
14 class CTextEditWindow : public CWindowImpl<CTextEditWindow>
15 {
16 public:
18 
20  void DoFillBack(HWND hwnd, HDC hDC);
21  void FixEditPos(LPCTSTR pszOldText);
22  void InvalidateEditRect();
23  void UpdateFont();
24  BOOL GetEditRect(LPRECT prc) const;
26  HFONT GetFont() const { return m_hFont; }
27 
48  END_MSG_MAP()
49 
50  LRESULT OnCreate(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
51  LRESULT OnClose(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
56  LRESULT OnChar(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
57  LRESULT OnKeyDown(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
60  LRESULT OnPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
61  LRESULT OnNCPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
65  LRESULT OnMove(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
66  LRESULT OnSize(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
67  LRESULT OnSetSel(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
69 
70 protected:
76 
77  INT DoHitTest(RECT& rc, POINT pt);
78  void DrawGrip(HDC hDC, RECT& rc);
79  void Reposition();
80 };
LRESULT OnChar(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: textedit.cpp:156
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
LRESULT OnSetCursor(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: textedit.cpp:255
#define WM_CHAR
Definition: winuser.h:1707
#define WM_LBUTTONDOWN
Definition: winuser.h:1766
LRESULT OnPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: textedit.cpp:209
LRESULT OnToolsModelSettingsChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: textedit.cpp:376
#define pt(x, y)
Definition: drawing.c:79
#define WM_MOUSEWHEEL
Definition: treelist.c:96
#define WM_NCCALCSIZE
Definition: winuser.h:1675
static HDC
Definition: imagelist.c:92
HWND Create(HWND hwndParent)
Definition: textedit.cpp:297
LONG m_nAppIsMovingOrSizing
Definition: textedit.h:74
#define WM_MOVE
Definition: winuser.h:1600
#define WM_NCHITTEST
Definition: winuser.h:1676
UINT_PTR WPARAM
Definition: windef.h:207
LRESULT OnCreate(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: textedit.cpp:332
#define WM_PALETTEMODELCOLORCHANGED
Definition: precomp.h:35
int32_t INT
Definition: typedefs.h:58
WPARAM wParam
Definition: combotst.c:138
HFONT GetFont() const
Definition: textedit.h:26
INT DoHitTest(RECT &rc, POINT pt)
Definition: textedit.cpp:37
LRESULT OnMove(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: textedit.cpp:266
#define WM_NCPAINT
Definition: winuser.h:1677
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
#define WM_SETCURSOR
Definition: winuser.h:1626
LRESULT OnPaletteModelColorChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: textedit.cpp:370
void DoFillBack(HWND hwnd, HDC hDC)
Definition: textedit.cpp:318
static HWND hwndParent
Definition: cryptui.c:300
void DrawGrip(HDC hDC, RECT &rc)
Definition: textedit.cpp:77
#define WM_KEYDOWN
Definition: winuser.h:1705
LONG_PTR LPARAM
Definition: windef.h:208
LRESULT OnToolsModelZoomChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: textedit.cpp:382
LRESULT OnEraseBkGnd(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: textedit.cpp:194
BOOL GetEditRect(LPRECT prc) const
Definition: textedit.cpp:453
LRESULT OnToolsModelToolChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: textedit.cpp:389
HWND m_hwndParent
Definition: textedit.h:71
#define WM_SIZE
Definition: winuser.h:1601
#define END_MSG_MAP()
Definition: atlwin.h:1911
#define WM_CLOSE
Definition: winuser.h:1611
#define EM_SETSEL
Definition: winuser.h:2008
static BOOL protected
Definition: protectdata.c:37
#define WM_PAINT
Definition: winuser.h:1610
LRESULT OnNCCalcSize(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: textedit.cpp:242
LRESULT OnNCHitTest(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: textedit.cpp:247
void ValidateEditRect(LPCRECT prc OPTIONAL)
Definition: textedit.cpp:459
LRESULT OnClose(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: textedit.cpp:338
#define WM_TOOLSMODELSETTINGSCHANGED
Definition: precomp.h:33
void FixEditPos(LPCTSTR pszOldText)
Definition: textedit.cpp:112
void UpdateFont()
Definition: textedit.cpp:402
static HDC hDC
Definition: 3dtext.c:33
HFONT m_hFontZoomed
Definition: textedit.h:73
unsigned int UINT
Definition: ndis.h:50
#define WM_TOOLSMODELTOOLCHANGED
Definition: precomp.h:32
#define BEGIN_MSG_MAP(theClass)
Definition: atlwin.h:1892
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
LRESULT OnNCPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: textedit.cpp:226
#define WM_TOOLSMODELZOOMCHANGED
Definition: precomp.h:34
#define WM_CREATE
Definition: winuser.h:1598
void Reposition()
Definition: textedit.cpp:471
LRESULT OnKeyDown(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: textedit.cpp:170
LRESULT OnLButtonDown(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: textedit.cpp:186
#define WM_ERASEBKGND
Definition: winuser.h:1615
LONG_PTR LRESULT
Definition: windef.h:209
HFONT m_hFont
Definition: textedit.h:72
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4022
_Out_ LPRECT prc
Definition: ntgdi.h:1658
LRESULT OnSize(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: textedit.cpp:278
LRESULT OnSetSel(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: textedit.cpp:444
LRESULT OnMouseWheel(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: textedit.cpp:508
LPARAM lParam
Definition: combotst.c:139
MESSAGE_HANDLER(WM_NCCALCSIZE, OnNCCalcSize)
void InvalidateEditRect()
Definition: textedit.cpp:354
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68