summaryrefslogtreecommitdiff
path: root/hammer/ToolMagnify.cpp
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /hammer/ToolMagnify.cpp
downloadarchived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.tar.xz
archived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.zip
Diffstat (limited to 'hammer/ToolMagnify.cpp')
-rw-r--r--hammer/ToolMagnify.cpp85
1 files changed, 85 insertions, 0 deletions
diff --git a/hammer/ToolMagnify.cpp b/hammer/ToolMagnify.cpp
new file mode 100644
index 0000000..fc65c75
--- /dev/null
+++ b/hammer/ToolMagnify.cpp
@@ -0,0 +1,85 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#include "stdafx.h"
+#include "MapDoc.h"
+#include "MapView2D.h"
+#include "resource.h"
+#include "ToolMagnify.h"
+#include "HammerVGui.h"
+#include <VGuiMatSurface/IMatSystemSurface.h>
+
+// memdbgon must be the last include file in a .cpp file!!!
+#include <tier0/memdbgon.h>
+
+
+//-----------------------------------------------------------------------------
+// Purpose: Loads the cursor (only once).
+//-----------------------------------------------------------------------------
+CToolMagnify::CToolMagnify(void)
+{
+}
+
+
+//-----------------------------------------------------------------------------
+// Purpose:
+// Input : *pView -
+// nFlags -
+// point -
+// Output : Returns true on success, false on failure.
+//-----------------------------------------------------------------------------
+bool CToolMagnify::OnContextMenu2D(CMapView2D *pView, UINT nFlags, const Vector2D &vPoint)
+{
+ // Return true to suppress the default view context menu behavior.
+ return true;
+}
+
+
+//-----------------------------------------------------------------------------
+// Purpose:
+// Input : pView -
+// nFlags -
+// point -
+// Output : Returns true to indicate that the message was handled.
+//-----------------------------------------------------------------------------
+bool CToolMagnify::OnLMouseDown2D(CMapView2D *pView, UINT nFlags, const Vector2D &vPoint)
+{
+ pView->SetZoom(pView->GetZoom() * 2);
+ pView->Invalidate();
+ return true;
+}
+
+
+//-----------------------------------------------------------------------------
+// Purpose:
+// Input : pView -
+// nFlags -
+// point -
+// Output : Returns true to indicate that the message was handled.
+//-----------------------------------------------------------------------------
+bool CToolMagnify::OnMouseMove2D(CMapView2D *pView, UINT nFlags, const Vector2D &vPoint)
+{
+ // cursors are cached by surface
+ pView->SetCursor( "Resource/magnify.cur" );
+ return true;
+}
+
+
+//-----------------------------------------------------------------------------
+// Purpose:
+// Input : pView -
+// nFlags -
+// point -
+// Output : Returns true to indicate that the message was handled.
+//-----------------------------------------------------------------------------
+bool CToolMagnify::OnRMouseDown2D(CMapView2D *pView, UINT nFlags, const Vector2D &vPoint)
+{
+ pView->SetZoom(pView->GetZoom() * 0.5f);
+ return true;
+}
+
+