[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:
Benedikt Freisen 2014-02-10 20:53:14 +00:00
parent 0dea67635b
commit a2cb195c76
2 changed files with 58 additions and 0 deletions

View 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;
}

View 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);