2 Copyright (C) 1999-2007 id Software, Inc. and contributors.
3 For a list of contributors, see the accompanying CONTRIBUTORS file.
5 This file is part of GtkRadiant.
7 GtkRadiant is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 GtkRadiant is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GtkRadiant; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 // Leonardo Zide (leo@lokigames.com)
31 // =============================================================================
43 void ZWnd::OnCreate ()
45 g_qeglobals_gui.d_z = m_pWidget;
48 Error ("wglMakeCurrent in CZWnd::OnCreate failed");
51 void ZWnd::OnLButtonDown(guint32 nFlags, int pointx, int pointy)
55 Z_MouseDown (pointx, m_pWidget->allocation.height - 1 - pointy , nFlags);
58 void ZWnd::OnMButtonDown(guint32 nFlags, int pointx, int pointy)
62 Z_MouseDown (pointx, m_pWidget->allocation.height - 1 - pointy , nFlags);
65 void ZWnd::OnRButtonDown(guint32 nFlags, int pointx, int pointy)
69 Z_MouseDown (pointx, m_pWidget->allocation.height - 1 - pointy , nFlags);
72 void ZWnd::OnLButtonUp(guint32 nFlags, int pointx, int pointy)
74 Z_MouseUp (pointx, m_pWidget->allocation.height - 1 - pointy, nFlags);
78 void ZWnd::OnMButtonUp(guint32 nFlags, int pointx, int pointy)
80 Z_MouseUp (pointx, m_pWidget->allocation.height - 1 - pointy, nFlags);
84 void ZWnd::OnRButtonUp(guint32 nFlags, int pointx, int pointy)
86 Z_MouseUp (pointx, m_pWidget->allocation.height - 1 - pointy, nFlags);
90 void ZWnd::OnMouseMove(guint32 nFlags, int pointx, int pointy)
92 float fz = z.origin[2] + ((m_pWidget->allocation.height - 1 - pointy) - (z.height/2)) / z.scale;
93 fz = floor(fz / g_qeglobals.d_gridsize + 0.5) * g_qeglobals.d_gridsize;
95 strStatus.Format("Z:: %.1f", fz);
96 g_pParentWnd->SetStatusText(1, strStatus);
97 Z_MouseMoved (pointx, m_pWidget->allocation.height - 1 - pointy, nFlags);
100 void ZWnd::OnExpose()
104 Sys_Printf("ERROR: wglMakeCurrent failed..\n ");
105 Sys_Printf("Please restart Radiant if the Z view is not working\n");
109 QE_CheckOpenGLForErrors();
111 QE_CheckOpenGLForErrors();
116 void ZWnd::OnSize(int cx, int cy)