Author: bfreisen
Date: Mon Aug 17 12:03:39 2015
New Revision: 68733
URL:
http://svn.reactos.org/svn/reactos?rev=68733&view=rev
Log:
[MSPAINT_NEW] implement fullscreen view
Added:
trunk/reactos/base/applications/mspaint_new/fullscreen.cpp (with props)
trunk/reactos/base/applications/mspaint_new/fullscreen.h (with props)
Modified:
trunk/reactos/base/applications/mspaint_new/CMakeLists.txt
trunk/reactos/base/applications/mspaint_new/globalvar.h
trunk/reactos/base/applications/mspaint_new/main.cpp
trunk/reactos/base/applications/mspaint_new/precomp.h
trunk/reactos/base/applications/mspaint_new/winproc.cpp
Modified: trunk/reactos/base/applications/mspaint_new/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint_…
==============================================================================
--- trunk/reactos/base/applications/mspaint_new/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mspaint_new/CMakeLists.txt [iso-8859-1] Mon Aug 17
12:03:39 2015
@@ -8,6 +8,7 @@
dialogs.cpp
dib.cpp
drawing.cpp
+ fullscreen.cpp
history.cpp
imgarea.cpp
main.cpp
Added: trunk/reactos/base/applications/mspaint_new/fullscreen.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint_…
==============================================================================
--- trunk/reactos/base/applications/mspaint_new/fullscreen.cpp (added)
+++ trunk/reactos/base/applications/mspaint_new/fullscreen.cpp [iso-8859-1] Mon Aug 17
12:03:39 2015
@@ -0,0 +1,61 @@
+/*
+ * PROJECT: PAINT for ReactOS
+ * LICENSE: LGPL
+ * FILE: base/applications/mspaint_new/fullscreen.cpp
+ * PURPOSE: Window for fullscreen view
+ * PROGRAMMERS: Benedikt Freisen
+ */
+
+/* INCLUDES *********************************************************/
+
+#include "precomp.h"
+
+/* FUNCTIONS ********************************************************/
+
+LRESULT CFullscreenWindow::OnCreate(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL&
bHandled)
+{
+ SendMessage(WM_SETICON, ICON_BIG, (LPARAM) LoadIcon(hProgInstance,
MAKEINTRESOURCE(IDI_APPICON)));
+ SendMessage(WM_SETICON, ICON_SMALL, (LPARAM) LoadIcon(hProgInstance,
MAKEINTRESOURCE(IDI_APPICON)));
+ return 0;
+}
+
+LRESULT CFullscreenWindow::OnCloseOrKeyDownOrLButtonDown(UINT nMsg, WPARAM wParam, LPARAM
lParam, BOOL& bHandled)
+{
+ mainWindow.ShowWindow(SW_SHOW);
+ ShowWindow(SW_HIDE);
+ return 0;
+}
+
+LRESULT CFullscreenWindow::OnPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL&
bHandled)
+{
+ PAINTSTRUCT ps;
+ HDC hDC = BeginPaint(&ps);
+ RECT rcWnd;
+ GetWindowRect(&rcWnd);
+ INT cxDest = imageModel.GetWidth();
+ INT cyDest = imageModel.GetHeight();
+ INT xDest = (rcWnd.right - rcWnd.left - cxDest) / 2;
+ INT yDest = (rcWnd.bottom - rcWnd.top - cyDest) / 2;
+ BitBlt(hDC, xDest, yDest, cxDest, cyDest, imageModel.GetDC(), 0, 0, SRCCOPY);
+ EndPaint(&ps);
+ return 0;
+}
+
+LRESULT CFullscreenWindow::OnSize(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL&
bHandled)
+{
+ Invalidate(TRUE);
+ return 0;
+}
+
+LRESULT CFullscreenWindow::OnSetCursor(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL&
bHandled)
+{
+ SetCursor(LoadCursor(NULL, IDC_ARROW));
+ bHandled = FALSE;
+ return 0;
+}
+
+LRESULT CFullscreenWindow::OnGetText(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL&
bHandled)
+{
+ // return caption of the main window, instead
+ return mainWindow.SendMessage(nMsg, wParam, lParam);
+}
Propchange: trunk/reactos/base/applications/mspaint_new/fullscreen.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/base/applications/mspaint_new/fullscreen.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint_…
==============================================================================
--- trunk/reactos/base/applications/mspaint_new/fullscreen.h (added)
+++ trunk/reactos/base/applications/mspaint_new/fullscreen.h [iso-8859-1] Mon Aug 17
12:03:39 2015
@@ -0,0 +1,31 @@
+/*
+ * PROJECT: PAINT for ReactOS
+ * LICENSE: LGPL
+ * FILE: base/applications/mspaint_new/fullscreen.h
+ * PURPOSE: Window for fullscreen view
+ * PROGRAMMERS: Benedikt Freisen
+ */
+
+class CFullscreenWindow : public CWindowImpl<CFullscreenWindow>
+{
+public:
+ DECLARE_WND_CLASS_EX(_T("FullscreenWindow"), CS_DBLCLKS, COLOR_BACKGROUND)
+
+ BEGIN_MSG_MAP(CFullscreenWindow)
+ MESSAGE_HANDLER(WM_CREATE, OnCreate)
+ MESSAGE_HANDLER(WM_CLOSE, OnCloseOrKeyDownOrLButtonDown)
+ MESSAGE_HANDLER(WM_KEYDOWN, OnCloseOrKeyDownOrLButtonDown)
+ MESSAGE_HANDLER(WM_LBUTTONDOWN, OnCloseOrKeyDownOrLButtonDown)
+ MESSAGE_HANDLER(WM_PAINT, OnPaint)
+ MESSAGE_HANDLER(WM_SIZE, OnSize)
+ MESSAGE_HANDLER(WM_SETCURSOR, OnSetCursor)
+ MESSAGE_HANDLER(WM_GETTEXT, OnGetText)
+ END_MSG_MAP()
+
+ LRESULT OnCreate(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+ LRESULT OnCloseOrKeyDownOrLButtonDown(UINT nMsg, WPARAM wParam, LPARAM lParam,
BOOL& bHandled);
+ LRESULT OnPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+ LRESULT OnSize(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+ LRESULT OnSetCursor(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+ LRESULT OnGetText(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+};
Propchange: trunk/reactos/base/applications/mspaint_new/fullscreen.h
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/base/applications/mspaint_new/globalvar.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint_…
==============================================================================
--- trunk/reactos/base/applications/mspaint_new/globalvar.h [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mspaint_new/globalvar.h [iso-8859-1] Mon Aug 17
12:03:39 2015
@@ -73,6 +73,7 @@
extern BOOL showMiniature;
class CMainWindow;
+class CFullscreenWindow;
class CMiniatureWindow;
class CToolBox;
class CToolSettingsWindow;
@@ -84,6 +85,7 @@
class CTextEditWindow;
extern CMainWindow mainWindow;
+extern CFullscreenWindow fullscreenWindow;
extern CMiniatureWindow miniature;
extern CToolBox toolBoxContainer;
extern CToolSettingsWindow toolSettingsWindow;
Modified: trunk/reactos/base/applications/mspaint_new/main.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint_…
==============================================================================
--- trunk/reactos/base/applications/mspaint_new/main.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mspaint_new/main.cpp [iso-8859-1] Mon Aug 17 12:03:39
2015
@@ -66,6 +66,7 @@
BOOL showMiniature = FALSE;
CMainWindow mainWindow;
+CFullscreenWindow fullscreenWindow;
CMiniatureWindow miniature;
CToolBox toolBoxContainer;
CToolSettingsWindow toolSettingsWindow;
@@ -144,6 +145,9 @@
/* create main window */
RECT mainWindowPos = {0, 0, 544, 375}; // FIXME: use equivalent of CW_USEDEFAULT for
position
hwnd = mainWindow.Create(HWND_DESKTOP, mainWindowPos, progtitle,
WS_OVERLAPPEDWINDOW);
+
+ RECT fullscreenWindowPos = {0, 0, 100, 100};
+ fullscreenWindow.Create(HWND_DESKTOP, fullscreenWindowPos, NULL, WS_POPUPWINDOW |
WS_MAXIMIZE);
RECT miniaturePos = {(LONG) registrySettings.ThumbXPos, (LONG)
registrySettings.ThumbYPos,
(LONG) registrySettings.ThumbXPos + (LONG)
registrySettings.ThumbWidth,
Modified: trunk/reactos/base/applications/mspaint_new/precomp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint_…
==============================================================================
--- trunk/reactos/base/applications/mspaint_new/precomp.h [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mspaint_new/precomp.h [iso-8859-1] Mon Aug 17 12:03:39
2015
@@ -21,6 +21,7 @@
#include "definitions.h"
#include "drawing.h"
#include "dib.h"
+#include "fullscreen.h"
#include "globalvar.h"
#include "history.h"
#include "imgarea.h"
Modified: trunk/reactos/base/applications/mspaint_new/winproc.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint_…
==============================================================================
--- trunk/reactos/base/applications/mspaint_new/winproc.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mspaint_new/winproc.cpp [iso-8859-1] Mon Aug 17
12:03:39 2015
@@ -613,6 +613,11 @@
case IDM_VIEWZOOM800:
zoomTo(8000, 0, 0);
break;
- }
- return 0;
-}
+
+ case IDM_VIEWFULLSCREEN:
+ fullscreenWindow.ShowWindow(SW_SHOW);
+ ShowWindow(SW_HIDE);
+ break;
+ }
+ return 0;
+}