mirror of
https://github.com/reactos/reactos.git
synced 2025-04-20 12:29:56 +00:00
[MSPAINT]
(forgot to add the files...) - Text tool allows text input (I chose a design with separate editor window) svn path=/trunk/; revision=62114
This commit is contained in:
parent
0dea67635b
commit
a2cb195c76
2 changed files with 58 additions and 0 deletions
49
reactos/base/applications/mspaint/textedit.c
Normal file
49
reactos/base/applications/mspaint/textedit.c
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: PAINT for ReactOS
|
||||||
|
* LICENSE: LGPL
|
||||||
|
* FILE: base/applications/paint/textedit.c
|
||||||
|
* PURPOSE: Text editor and font chooser for the text tool
|
||||||
|
* PROGRAMMERS: Benedikt Freisen
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* INCLUDES *********************************************************/
|
||||||
|
|
||||||
|
#include "precomp.h"
|
||||||
|
|
||||||
|
/* FUNCTIONS ********************************************************/
|
||||||
|
|
||||||
|
LRESULT CALLBACK
|
||||||
|
TextEditWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
switch (message)
|
||||||
|
{
|
||||||
|
case WM_SIZE:
|
||||||
|
{
|
||||||
|
RECT clientRect;
|
||||||
|
GetClientRect(hwnd, &clientRect);
|
||||||
|
MoveWindow(hwndEditCtl, clientRect.left, clientRect.top, RECT_WIDTH(clientRect), RECT_HEIGHT(clientRect), TRUE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case WM_CLOSE:
|
||||||
|
ShowWindow(hwnd, SW_HIDE);
|
||||||
|
break;
|
||||||
|
case WM_COMMAND:
|
||||||
|
switch(HIWORD(wParam))
|
||||||
|
{
|
||||||
|
case EN_UPDATE:
|
||||||
|
{
|
||||||
|
HeapFree(GetProcessHeap(), 0, textToolText);
|
||||||
|
textToolTextMaxLen = GetWindowTextLength(hwndEditCtl) + 1;
|
||||||
|
textToolText = HeapAlloc(GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS, sizeof(TCHAR) * textToolTextMaxLen);
|
||||||
|
GetWindowText(hwndEditCtl, textToolText, textToolTextMaxLen);
|
||||||
|
ForceRefreshSelectionContents();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return DefWindowProc(hwnd, message, wParam, lParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
9
reactos/base/applications/mspaint/textedit.h
Normal file
9
reactos/base/applications/mspaint/textedit.h
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: PAINT for ReactOS
|
||||||
|
* LICENSE: LGPL
|
||||||
|
* FILE: base/applications/paint/textedit.h
|
||||||
|
* PURPOSE: Text editor and font chooser for the text tool
|
||||||
|
* PROGRAMMERS: Benedikt Freisen
|
||||||
|
*/
|
||||||
|
|
||||||
|
LRESULT CALLBACK TextEditWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
|
Loading…
Reference in a new issue