Author: bfreisen
Date: Mon Feb 10 20:53:14 2014
New Revision: 62114

URL: http://svn.reactos.org/svn/reactos?rev=62114&view=rev
Log:
[MSPAINT]
(forgot to add the files...)
- Text tool allows text input (I chose a design with separate editor window)

Added:
    trunk/reactos/base/applications/mspaint/textedit.c   (with props)
    trunk/reactos/base/applications/mspaint/textedit.h   (with props)

Added: trunk/reactos/base/applications/mspaint/textedit.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/textedit.c?rev=62114
==============================================================================
--- trunk/reactos/base/applications/mspaint/textedit.c  (added)
+++ trunk/reactos/base/applications/mspaint/textedit.c  [iso-8859-1] Mon Feb 10 
20:53:14 2014
@@ -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;
+}

Propchange: trunk/reactos/base/applications/mspaint/textedit.c
------------------------------------------------------------------------------
    svn:eol-style = native

Added: trunk/reactos/base/applications/mspaint/textedit.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/textedit.h?rev=62114
==============================================================================
--- trunk/reactos/base/applications/mspaint/textedit.h  (added)
+++ trunk/reactos/base/applications/mspaint/textedit.h  [iso-8859-1] Mon Feb 10 
20:53:14 2014
@@ -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);

Propchange: trunk/reactos/base/applications/mspaint/textedit.h
------------------------------------------------------------------------------
    svn:eol-style = native


Reply via email to