ReactOS  0.4.12-dev-43-g63b00d8
textedit.cpp
Go to the documentation of this file.
1 /*
2  * PROJECT: PAINT for ReactOS
3  * LICENSE: LGPL
4  * FILE: base/applications/mspaint/textedit.cpp
5  * PURPOSE: Text editor and font chooser for the text tool
6  * PROGRAMMERS: Benedikt Freisen
7  */
8 
9 /* INCLUDES *********************************************************/
10 
11 #include "precomp.h"
12 
13 /* FUNCTIONS ********************************************************/
15 {
16  /* creating the edit control within the editor window */
17  RECT editControlPos = {0, 0, 0 + 100, 0 + 100};
18  editControl.Create(_T("EDIT"), m_hWnd, editControlPos, NULL,
21  return 0;
22 }
23 
25 {
26  RECT clientRect;
27  GetClientRect(&clientRect);
28  editControl.MoveWindow(clientRect.left, clientRect.top, RECT_WIDTH(clientRect), RECT_HEIGHT(clientRect), TRUE);
29  return 0;
30 }
31 
33 {
35  return 0;
36 }
37 
39 {
40  switch(HIWORD(wParam))
41  {
42  case EN_UPDATE:
43  {
49  break;
50  }
51  }
52  return 0;
53 }
54 
56 {
57  ShowWindow((wParam == TOOL_TEXT) ? SW_SHOW : SW_HIDE);
58  return 0;
59 }
#define TRUE
Definition: types.h:120
BOOL MoveWindow(int x, int y, int nWidth, int nHeight, BOOL bRepaint=TRUE)
Definition: atlwin.h:949
#define TOOL_TEXT
Definition: definitions.h:144
int GetWindowTextLength() const
Definition: atlwin.h:783
#define SW_HIDE
Definition: winuser.h:762
LRESULT OnCommand(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: textedit.cpp:38
#define ES_MULTILINE
Definition: pedump.c:667
#define RECT_WIDTH(a)
Definition: definitions.h:19
LONG top
Definition: windef.h:297
LRESULT OnCreate(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: textedit.cpp:14
#define WS_CHILD
Definition: pedump.c:617
LONG left
Definition: windef.h:296
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
WPARAM wParam
Definition: combotst.c:138
CHAR * LPTSTR
Definition: xmlstorage.h:192
UINT_PTR WPARAM
Definition: windef.h:207
LONG_PTR LPARAM
Definition: windef.h:208
smooth NULL
Definition: ftsmooth.c:416
#define SW_SHOW
Definition: winuser.h:769
#define ES_AUTOVSCROLL
Definition: pedump.c:671
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LRESULT OnToolsModelToolChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: textedit.cpp:55
HWND Create(LPCTSTR lpstrWndClass, HWND hWndParent, _U_RECT rect=NULL, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
Definition: atlwin.h:374
unsigned int UINT
Definition: ndis.h:50
CWindow editControl
Definition: textedit.h:24
#define ES_NOHIDESEL
Definition: pedump.c:673
#define WS_HSCROLL
Definition: pedump.c:628
LRESULT OnClose(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: textedit.cpp:32
int GetWindowText(LPTSTR lpszStringBuf, int nMaxCount) const
Definition: atlwin.h:767
LPTSTR textToolText
Definition: main.cpp:25
void ForceRefreshSelectionContents()
Definition: selection.cpp:56
#define RECT_HEIGHT(a)
Definition: definitions.h:22
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
int textToolTextMaxLen
Definition: main.cpp:26
#define WS_BORDER
Definition: pedump.c:625
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define WS_VSCROLL
Definition: pedump.c:627
#define HIWORD(l)
Definition: typedefs.h:246
#define EN_UPDATE
Definition: winuser.h:1989
LONG_PTR LRESULT
Definition: windef.h:209
LRESULT OnSize(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: textedit.cpp:24
#define WS_VISIBLE
Definition: pedump.c:620
#define HEAP_GENERATE_EXCEPTIONS
Definition: nt_native.h:1694
LPARAM lParam
Definition: combotst.c:139
#define ES_AUTOHSCROLL
Definition: pedump.c:672
#define HeapFree(x, y, z)
Definition: compat.h:394