From d4c6db46c7a1611e5367e7578cae180120ef734a Mon Sep 17 00:00:00 2001 From: mattn Date: Wed, 19 Mar 2008 07:02:30 +0000 Subject: [PATCH] * fixed prtview compilation (also included in the build chain now) * NOTE: Removed CDialog code git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/branches/ZeroRadiant@229 8a3a26a2-13c4-0310-b231-cf6edde360e5 --- config.py | 3 +- contrib/prtview/AboutDialog.cpp | 30 -- contrib/prtview/AboutDialog.h | 72 ----- contrib/prtview/ConfigDialog.cpp | 385 ----------------------- contrib/prtview/ConfigDialog.h | 107 ------- contrib/prtview/LoadPortalFileDialog.cpp | 91 ------ contrib/prtview/LoadPortalFileDialog.h | 50 --- contrib/prtview/PrtView.vcproj | 6 +- 8 files changed, 4 insertions(+), 740 deletions(-) delete mode 100644 contrib/prtview/AboutDialog.h delete mode 100644 contrib/prtview/ConfigDialog.h diff --git a/config.py b/config.py index a3887750..77dd34bc 100644 --- a/config.py +++ b/config.py @@ -127,8 +127,7 @@ class Config: # 'contrib/patches/patches.vcproj', # 'plugins/archivewad/archivewad.vcproj', - # FIXME Doesn't compile cleanly - # 'contrib/prtview/PrtView.vcproj', + 'contrib/prtview/PrtView.vcproj', 'contrib/hydratoolz/hydratoolz.vcproj', 'contrib/bobtoolz/bobToolz_gtk.vcproj', 'contrib/gtkgensurf/gtkgensurf.vcproj', diff --git a/contrib/prtview/AboutDialog.cpp b/contrib/prtview/AboutDialog.cpp index 0237010f..1bf834d2 100644 --- a/contrib/prtview/AboutDialog.cpp +++ b/contrib/prtview/AboutDialog.cpp @@ -32,8 +32,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ///////////////////////////////////////////////////////////////////////////// // CAboutDialog dialog -#ifdef GTK_PLUGIN - static void dialog_button_callback (GtkWidget *widget, gpointer data) { GtkWidget *parent; @@ -108,33 +106,5 @@ void DoAboutDlg () gtk_widget_destroy (dlg); } -#else // GTK_PLUGIN - -CAboutDialog::CAboutDialog(CWnd* pParent /*=NULL*/) - : CDialog(CAboutDialog::IDD, pParent) -{ - //{{AFX_DATA_INIT(CAboutDialog) - // NOTE: the ClassWizard will add member initialization here - //}}AFX_DATA_INIT -} - - -void CAboutDialog::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CAboutDialog) - // NOTE: the ClassWizard will add DDX and DDV calls here - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CAboutDialog, CDialog) - //{{AFX_MSG_MAP(CAboutDialog) - // NOTE: the ClassWizard will add message map macros here - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -#endif // GTK_PLUGIN - ///////////////////////////////////////////////////////////////////////////// // CAboutDialog message handlers diff --git a/contrib/prtview/AboutDialog.h b/contrib/prtview/AboutDialog.h deleted file mode 100644 index 66d8c0d0..00000000 --- a/contrib/prtview/AboutDialog.h +++ /dev/null @@ -1,72 +0,0 @@ -/* -PrtView plugin for GtkRadiant -Copyright (C) 2001 Geoffrey Dewan, Loki software and qeradiant.com - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#if !defined(AFX_ABOUTDIALOG_H__FA3BE6A2_1F1F_11D4_BFF1_204C4F4F5020__INCLUDED_) -#define AFX_ABOUTDIALOG_H__FA3BE6A2_1F1F_11D4_BFF1_204C4F4F5020__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// AboutDialog.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CAboutDialog dialog - -#ifdef GTK_PLUGIN -void DoAboutDlg (); - -#else // GTK_PLUGIN - -class CAboutDialog : public CDialog -{ -// Construction -public: - CAboutDialog(CWnd* pParent = NULL); // standard constructor - -// Dialog Data - //{{AFX_DATA(CAboutDialog) - enum { IDD = IDD_ABOUT }; - // NOTE: the ClassWizard will add data members here - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CAboutDialog) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CAboutDialog) - // NOTE: the ClassWizard will add member functions here - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -#endif // GTK_PLUGIN - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_ABOUTDIALOG_H__FA3BE6A2_1F1F_11D4_BFF1_204C4F4F5020__INCLUDED_) diff --git a/contrib/prtview/ConfigDialog.cpp b/contrib/prtview/ConfigDialog.cpp index 3f0b272c..c73cda9c 100644 --- a/contrib/prtview/ConfigDialog.cpp +++ b/contrib/prtview/ConfigDialog.cpp @@ -32,8 +32,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ///////////////////////////////////////////////////////////////////////////// // CConfigDialog dialog -#ifdef GTK_PLUGIN - static void dialog_button_callback (GtkWidget *widget, gpointer data) { GtkWidget *parent; @@ -540,386 +538,3 @@ void DoConfigDialog () gtk_grab_remove (dlg); gtk_widget_destroy (dlg); } - -#else // GTK_PLUGIN - -CConfigDialog::CConfigDialog(CWnd* pParent /*=NULL*/) - : CDialog(CConfigDialog::IDD, pParent) -{ - //{{AFX_DATA_INIT(CConfigDialog) - //}}AFX_DATA_INIT -} - - -void CConfigDialog::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CConfigDialog) - DDX_Control(pDX, IDC_CLIP, m_clip_ctrl); - DDX_Control(pDX, IDC_CUBIC, m_cubic_ctrl); - DDX_Control(pDX, IDC_SCROLL_CUBIC, m_scroll_cubic_ctrl); - DDX_Control(pDX, IDC_LINES, m_line_ctrl); - DDX_Control(pDX, IDC_SCROLL_3D_TRANS, m_scroll_3d_trans_ctrl); - DDX_Control(pDX, IDC_3D_TRANS, m_3d_trans_ctrl); - DDX_Control(pDX, IDC_POLY, m_poly_ctrl); - DDX_Control(pDX, IDC_FOG, m_fog_ctrl); - DDX_Control(pDX, IDC_ZBUFFER, m_z_ctrl); - DDX_Control(pDX, IDC_SCROLL_3D_WIDTH, m_scroll_3d_width_ctrl); - DDX_Control(pDX, IDC_ANTI_ALIAS_3D, m_aa_3d_ctrl); - DDX_Control(pDX, IDC_3D_WIDTH, m_3d_width_ctrl); - DDX_Control(pDX, IDC_ANTI_ALIAS_2D, m_aa_2d_ctrl); - DDX_Control(pDX, IDC_SCROLL_2D_WIDTH, m_scroll_2d_width_ctrl); - DDX_Control(pDX, IDC_2D_WIDTH, m_2d_width_ctrl); - DDX_Control(pDX, IDC_CONFIG_3D, m_3d_ctrl); - DDX_Control(pDX, IDC_CONFIG_2D, m_2d_ctrl); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CConfigDialog, CDialog) - //{{AFX_MSG_MAP(CConfigDialog) - ON_WM_HSCROLL() - ON_BN_CLICKED(IDC_ANTI_ALIAS_2D, OnAntiAlias2d) - ON_BN_CLICKED(IDC_CONFIG_2D, OnConfig2d) - ON_BN_CLICKED(IDC_CONFIG_3D, OnConfig3d) - ON_BN_CLICKED(IDC_COLOR_2D, OnColor2d) - ON_BN_CLICKED(IDC_ANTI_ALIAS_3D, OnAntiAlias3d) - ON_BN_CLICKED(IDC_COLOR_3D, OnColor3d) - ON_BN_CLICKED(IDC_COLOR_FOG, OnColorFog) - ON_BN_CLICKED(IDC_FOG, OnFog) - ON_CBN_SELCHANGE(IDC_ZBUFFER, OnSelchangeZbuffer) - ON_BN_CLICKED(IDC_POLY, OnPoly) - ON_BN_CLICKED(IDC_LINES, OnLines) - ON_BN_CLICKED(IDC_CLIP, OnClip) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CConfigDialog message handlers - -void CConfigDialog::Set2DText() -{ - char s[40]; - - sprintf(s, "Line Width = %6.3f", portals.width_2d * 0.5f); - - m_2d_width_ctrl.SetWindowText(s); -} - -void CConfigDialog::Set3DText() -{ - char s[40]; - - sprintf(s, "Line Width = %6.3f", portals.width_3d * 0.5f); - - m_3d_width_ctrl.SetWindowText(s); -} - -void CConfigDialog::Set3DTransText() -{ - char s[40]; - - sprintf(s, "Polygon transparency = %d%%", (int)portals.trans_3d); - - m_3d_trans_ctrl.SetWindowText(s); -} - -void CConfigDialog::SetClipText() -{ - char s[40]; - - sprintf(s, "Cubic clip range = %d", (int)portals.clip_range * 64); - - m_cubic_ctrl.SetWindowText(s); -} - -qboolean CConfigDialog::OnInitDialog() -{ - CDialog::OnInitDialog(); - - m_2d_ctrl.SetCheck(portals.show_2d); - m_aa_2d_ctrl.SetCheck(portals.aa_2d); - Set2DText(); - - m_scroll_2d_width_ctrl.SetScrollRange(2, 40, FALSE); - m_scroll_2d_width_ctrl.SetScrollPos((int)portals.width_2d, TRUE); - - m_3d_ctrl.SetCheck(portals.show_3d); - m_fog_ctrl.SetCheck(portals.fog); - m_poly_ctrl.SetCheck(portals.polygons); - m_line_ctrl.SetCheck(portals.lines); - m_aa_3d_ctrl.SetCheck(portals.aa_3d); - m_z_ctrl.SetCurSel(portals.zbuffer); - m_clip_ctrl.SetCheck(portals.clip); - - Set3DText(); - Set3DTransText(); - SetClipText(); - - m_scroll_3d_width_ctrl.SetScrollRange(2, 40, FALSE); - m_scroll_3d_width_ctrl.SetScrollPos((int)portals.width_3d, TRUE); - m_scroll_3d_trans_ctrl.SetScrollRange(0, 100, FALSE); - m_scroll_3d_trans_ctrl.SetScrollPos((int)portals.trans_3d, TRUE); - m_scroll_cubic_ctrl.SetScrollRange(1, 128, FALSE); - m_scroll_cubic_ctrl.SetScrollPos((int)portals.clip_range, TRUE); - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - -void CConfigDialog::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) -{ - float *adj; - float scr_min, scr_max, scr_big; - - if(nSBCode == SB_THUMBPOSITION) - { - CDialog::OnHScroll(nSBCode, nPos, pScrollBar); - return; - } - - if(pScrollBar == &m_scroll_2d_width_ctrl) - { - scr_min = 2.0f; - scr_max = 40.0f; - scr_big = 4.0f; - - adj = &portals.width_2d; - } - else if(pScrollBar == &m_scroll_3d_width_ctrl) - { - scr_min = 2.0f; - scr_max = 40.0f; - scr_big = 4.0f; - - adj = &portals.width_3d; - } - else if(pScrollBar == &m_scroll_3d_trans_ctrl) - { - scr_min = 0.0f; - scr_max = 100.0f; - scr_big = 10.0f; - - adj = &portals.trans_3d; - } - else if(pScrollBar == &m_scroll_cubic_ctrl) - { - scr_min = 1.0f; - scr_max = 128.0f; - scr_big = 8.0f; - - adj = &portals.clip_range; - } - else - { - CDialog::OnHScroll(nSBCode, nPos, pScrollBar); - return; - } - - switch(nSBCode) - { - case SB_LEFT: - *adj = scr_min; - pScrollBar->SetScrollPos((int)scr_min, TRUE); - break; - case SB_RIGHT: - *adj = scr_max; - pScrollBar->SetScrollPos((int)scr_max, TRUE); - break; - case SB_LINELEFT: - *adj -= 1.0f; - - if(*adj < scr_min) - *adj = scr_min; - - pScrollBar->SetScrollPos((int)(*adj), TRUE); - - break; - case SB_LINERIGHT: - *adj += 1.0f; - - if(*adj > scr_max) - *adj = scr_max; - - pScrollBar->SetScrollPos((int)(*adj), TRUE); - - break; - case SB_PAGELEFT: - *adj -= scr_big; - - if(*adj < scr_min) - *adj = scr_min; - - pScrollBar->SetScrollPos((int)(*adj), TRUE); - - break; - case SB_PAGERIGHT: - *adj += scr_big; - - if(*adj > scr_max) - *adj = scr_max; - - pScrollBar->SetScrollPos((int)(*adj), TRUE); - - break; - case SB_THUMBTRACK: - *adj = (float)nPos; - - break; - case SB_ENDSCROLL: - pScrollBar->SetScrollPos((int)(*adj), TRUE); - - break; - default: - CDialog::OnHScroll(nSBCode, nPos, pScrollBar); - } - - if(pScrollBar == &m_scroll_2d_width_ctrl) - { - Set2DText(); - - if(interfaces_started) - g_FuncTable.m_pfnSysUpdateWindows(UPDATE_2D); - } - else if(pScrollBar == &m_scroll_3d_width_ctrl) - { - Set3DText(); - - if(interfaces_started) - g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); - } - else if(pScrollBar == &m_scroll_3d_trans_ctrl) - { - Set3DTransText(); - - if(interfaces_started) - g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); - } - else if(pScrollBar == &m_scroll_cubic_ctrl) - { - SetClipText(); - - if(interfaces_started) - g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); - } -} - -void CConfigDialog::OnAntiAlias2d() -{ - portals.aa_2d = m_aa_2d_ctrl.GetCheck(); - - if(interfaces_started) - g_FuncTable.m_pfnSysUpdateWindows(UPDATE_2D); -} - -void CConfigDialog::OnConfig2d() -{ - portals.show_2d = m_2d_ctrl.GetCheck(); - - if(interfaces_started) - g_FuncTable.m_pfnSysUpdateWindows(UPDATE_2D); -} - -void CConfigDialog::OnColor2d() -{ - CColorDialog dlg(portals.color_2d, CC_ANYCOLOR, this); - - if(dlg.DoModal() == IDOK) - { - portals.color_2d = dlg.GetColor(); - - portals.FixColors(); - - if(interfaces_started) - g_FuncTable.m_pfnSysUpdateWindows(UPDATE_2D); - } -} - -void CConfigDialog::OnConfig3d() -{ - portals.show_3d = m_3d_ctrl.GetCheck(); - - if(interfaces_started) - g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); -} - - -void CConfigDialog::OnAntiAlias3d() -{ - portals.aa_3d = m_aa_3d_ctrl.GetCheck(); - - if(interfaces_started) - g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); -} - -void CConfigDialog::OnColor3d() -{ - CColorDialog dlg(portals.color_3d, CC_ANYCOLOR, this); - - if(dlg.DoModal() == IDOK) - { - portals.color_3d = dlg.GetColor(); - - portals.FixColors(); - - if(interfaces_started) - g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); - } -} - -void CConfigDialog::OnColorFog() -{ - CColorDialog dlg(portals.color_fog, CC_ANYCOLOR, this); - - if(dlg.DoModal() == IDOK) - { - portals.color_fog = dlg.GetColor(); - - portals.FixColors(); - - if(interfaces_started) - g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); - } -} - -void CConfigDialog::OnFog() -{ - portals.fog = m_fog_ctrl.GetCheck(); - - if(interfaces_started) - g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); -} - -void CConfigDialog::OnSelchangeZbuffer() -{ - portals.zbuffer = m_z_ctrl.GetCurSel(); - - if(interfaces_started) - g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); -} - -void CConfigDialog::OnPoly() -{ - portals.polygons = m_poly_ctrl.GetCheck(); - - if(interfaces_started) - g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); -} - -void CConfigDialog::OnLines() -{ - portals.lines = m_line_ctrl.GetCheck(); - - if(interfaces_started) - g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); -} - -void CConfigDialog::OnClip() -{ - portals.clip = m_clip_ctrl.GetCheck(); - - if(interfaces_started) - g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); -} - -#endif // GTK_PLUGIN diff --git a/contrib/prtview/ConfigDialog.h b/contrib/prtview/ConfigDialog.h deleted file mode 100644 index 11690fdc..00000000 --- a/contrib/prtview/ConfigDialog.h +++ /dev/null @@ -1,107 +0,0 @@ -/* -PrtView plugin for GtkRadiant -Copyright (C) 2001 Geoffrey Dewan, Loki software and qeradiant.com - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#if !defined(AFX_CONFIGDIALOG_H__E484E672_2088_11D4_BFFA_204C4F4F5020__INCLUDED_) -#define AFX_CONFIGDIALOG_H__E484E672_2088_11D4_BFFA_204C4F4F5020__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// ConfigDialog.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CConfigDialog dialog - -#ifdef GTK_PLUGIN - -void DoConfigDialog (); - -#else - -class CConfigDialog : public CDialog -{ -// Construction -public: - CConfigDialog(CWnd* pParent = NULL); // standard constructor - -// Dialog Data - //{{AFX_DATA(CConfigDialog) - enum { IDD = IDD_CONFIG }; - CButton m_clip_ctrl; - CStatic m_cubic_ctrl; - CScrollBar m_scroll_cubic_ctrl; - CButton m_line_ctrl; - CScrollBar m_scroll_3d_trans_ctrl; - CStatic m_3d_trans_ctrl; - CButton m_poly_ctrl; - CButton m_fog_ctrl; - CComboBox m_z_ctrl; - CScrollBar m_scroll_3d_width_ctrl; - CButton m_aa_3d_ctrl; - CStatic m_3d_width_ctrl; - CButton m_aa_2d_ctrl; - CScrollBar m_scroll_2d_width_ctrl; - CStatic m_2d_width_ctrl; - CButton m_3d_ctrl; - CButton m_2d_ctrl; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CConfigDialog) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - void Set2DText(); - void Set3DText(); - void Set3DTransText(); - void SetClipText(); - - // Generated message map functions - //{{AFX_MSG(CConfigDialog) - virtual qboolean OnInitDialog(); - afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); - afx_msg void OnAntiAlias2d(); - afx_msg void OnConfig2d(); - afx_msg void OnConfig3d(); - afx_msg void OnColor2d(); - afx_msg void OnAntiAlias3d(); - afx_msg void OnColor3d(); - afx_msg void OnColorFog(); - afx_msg void OnFog(); - afx_msg void OnSelchangeZbuffer(); - afx_msg void OnPoly(); - afx_msg void OnLines(); - afx_msg void OnClip(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -#endif // GTK_PLUGIN - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_CONFIGDIALOG_H__E484E672_2088_11D4_BFFA_204C4F4F5020__INCLUDED_) diff --git a/contrib/prtview/LoadPortalFileDialog.cpp b/contrib/prtview/LoadPortalFileDialog.cpp index 0dda214c..8d6b5318 100644 --- a/contrib/prtview/LoadPortalFileDialog.cpp +++ b/contrib/prtview/LoadPortalFileDialog.cpp @@ -28,8 +28,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //static char THIS_FILE[] = __FILE__; #endif -#ifdef GTK_PLUGIN - static void dialog_button_callback (GtkWidget *widget, gpointer data) { GtkWidget *parent; @@ -197,92 +195,3 @@ int DoLoadPortalFileDialog () return ret; } - -#else // GTK_PLUGIN - -///////////////////////////////////////////////////////////////////////////// -// CLoadPortalFileDialog dialog - -CLoadPortalFileDialog::CLoadPortalFileDialog(CWnd* pParent /*=NULL*/) - : CDialog(CLoadPortalFileDialog::IDD, pParent) -{ - //{{AFX_DATA_INIT(CLoadPortalFileDialog) - // NOTE: the ClassWizard will add member initialization here - //}}AFX_DATA_INIT -} - - -void CLoadPortalFileDialog::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CLoadPortalFileDialog) - DDX_Control(pDX, IDC_LOAD_3D, m_3d_ctrl); - DDX_Control(pDX, IDC_LOAD_2D, m_2d_ctrl); - DDX_Control(pDX, IDC_LOAD_FILE_NAME, m_fn_ctrl); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CLoadPortalFileDialog, CDialog) - //{{AFX_MSG_MAP(CLoadPortalFileDialog) - ON_BN_CLICKED(IDC_LOAD_OTHER, OnLoadOther) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - - -///////////////////////////////////////////////////////////////////////////// -// CLoadPortalFileDialog message handlers - -qboolean CLoadPortalFileDialog::OnInitDialog() -{ - CDialog::OnInitDialog(); - - char fn_drive[_MAX_DRIVE]; - char fn_dir[_MAX_DIR]; - char fn_name[_MAX_FNAME]; - char fn_ext[_MAX_EXT]; - - char *fn = g_IBSPTable.m_pfnGetMapName(); - - _fullpath(portals.fn, fn, _MAX_PATH); - _splitpath(fn, fn_drive, fn_dir, fn_name, fn_ext); - - strcpy(portals.fn, fn_drive); - strcat(portals.fn, fn_dir); - strcat(portals.fn, fn_name); - strcat(portals.fn, ".prt"); - - m_fn_ctrl.SetWindowText(portals.fn); - - m_2d_ctrl.SetCheck(portals.show_2d); - m_3d_ctrl.SetCheck(portals.show_3d); - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - -void CLoadPortalFileDialog::OnOK() -{ - portals.Purge(); - - portals.show_3d = m_3d_ctrl.GetCheck(); - portals.show_2d = m_2d_ctrl.GetCheck(); - - CDialog::OnOK(); -} - -void CLoadPortalFileDialog::OnLoadOther() -{ - CFileDialog dlg(TRUE, "prt", portals.fn, OFN_NOCHANGEDIR | OFN_HIDEREADONLY | OFN_LONGNAMES | OFN_FILEMUSTEXIST, - "Portal files (*.prt)|*.prt|All Files (*.*)|*.*||", NULL); - - dlg.m_ofn.lpstrTitle = "Locate portal file"; - - if(IDOK == dlg.DoModal()) - { - _fullpath(portals.fn, dlg.GetPathName().GetBuffer(1), _MAX_PATH); - m_fn_ctrl.SetWindowText(portals.fn); - } -} - -#endif // GTK_PLUGIN diff --git a/contrib/prtview/LoadPortalFileDialog.h b/contrib/prtview/LoadPortalFileDialog.h index 4540c104..433d5708 100644 --- a/contrib/prtview/LoadPortalFileDialog.h +++ b/contrib/prtview/LoadPortalFileDialog.h @@ -23,55 +23,5 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #if _MSC_VER >= 1000 #pragma once #endif // _MSC_VER >= 1000 -// LoadPortalFileDialog.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CLoadPortalFileDialog dialog - -#ifdef GTK_PLUGIN - -int DoLoadPortalFileDialog (); - -#else - -class CLoadPortalFileDialog : public CDialog -{ -// Construction -public: - CLoadPortalFileDialog(CWnd* pParent = NULL); // standard constructor - -// Dialog Data - //{{AFX_DATA(CLoadPortalFileDialog) - enum { IDD = IDD_LOAD }; - CButton m_3d_ctrl; - CButton m_2d_ctrl; - CStatic m_fn_ctrl; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CLoadPortalFileDialog) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CLoadPortalFileDialog) - virtual qboolean OnInitDialog(); - virtual void OnOK(); - afx_msg void OnLoadOther(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -#endif // GTK_PLUGIN - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. #endif // !defined(AFX_LOADPORTALFILEDIALOG_H__6BEDE392_1FDC_11D4_BFF7_204C4F4F5020__INCLUDED_) diff --git a/contrib/prtview/PrtView.vcproj b/contrib/prtview/PrtView.vcproj index bfb7567d..f450d1e4 100644 --- a/contrib/prtview/PrtView.vcproj +++ b/contrib/prtview/PrtView.vcproj @@ -56,15 +56,15 @@ - + - + - + -- 2.39.2