[MSPAINT]
[reactos.git] / reactos / base / applications / mspaint / selection.cpp
index a9e7530..9e5c689 100644 (file)
@@ -4,6 +4,7 @@
  * FILE:        base/applications/mspaint/selection.cpp
  * PURPOSE:     Window procedure of the selection window
  * PROGRAMMERS: Benedikt Freisen
+ *              Katayama Hirofumi MZ
  */
 
 /* INCLUDES *********************************************************/
@@ -230,6 +231,39 @@ LRESULT CSelectionWindow::OnLButtonUp(UINT nMsg, WPARAM wParam, LPARAM lParam, B
     return 0;
 }
 
+LRESULT CSelectionWindow::OnCaptureChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+    if (m_bMoving)
+    {
+        m_bMoving = FALSE;
+        if (m_iAction == ACTION_MOVE)
+        {
+            // FIXME: dirty hack
+            placeSelWin();
+            imageModel.Undo();
+            imageModel.Undo();
+        }
+        else
+        {
+            m_iAction = ACTION_MOVE;
+        }
+        ShowWindow(SW_HIDE);
+    }
+    return 0;
+}
+
+LRESULT CSelectionWindow::OnKeyDown(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+    if (wParam == VK_ESCAPE)
+    {
+        if (GetCapture() == m_hWnd)
+        {
+            ReleaseCapture();
+        }
+    }
+    return 0;
+}
+
 LRESULT CSelectionWindow::OnPaletteModelColorChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
 {
     if (toolsModel.GetActiveTool() == TOOL_TEXT)