From dff76684e8cfacadd1218eb0b24c64b38721aef9 Mon Sep 17 00:00:00 2001 From: Dmitry Tsarevich Date: Mon, 23 Dec 2024 18:23:54 +0300 Subject: [PATCH] [hammer] Derive dailog windows from CBaseDialog to add DPI support and main icon --- hammer/MapDiffDlg.cpp | 4 +- hammer/MapDiffDlg.h | 2 +- hammer/ModelBrowser.cpp | 6 +- hammer/ModelBrowser.h | 3 +- hammer/NewVisGroupDlg.cpp | 4 +- hammer/NewVisGroupDlg.h | 3 +- hammer/ScenePreviewDlg.cpp | 4 +- hammer/ScenePreviewDlg.h | 3 +- hammer/SearchReplaceDlg.cpp | 4 +- hammer/SearchReplaceDlg.h | 3 +- hammer/SoundBrowser.cpp | 4 +- hammer/TorusDlg.cpp | 4 +- hammer/archdlg.cpp | 4 +- hammer/archdlg.h | 3 +- hammer/dispdlg.cpp | 20 +- hammer/dispdlg.h | 11 +- hammer/dynamicdialogwnd.cpp | 2 +- hammer/dynamicdialogwnd.h | 5 +- hammer/editgameconfigs.cpp | 4 +- hammer/editgameconfigs.h | 3 +- hammer/editgroups.cpp | 4 +- hammer/editgroups.h | 3 +- hammer/editpathdlg.cpp | 4 +- hammer/editpathdlg.h | 4 +- hammer/editpathnodedlg.cpp | 4 +- hammer/editpathnodedlg.h | 3 +- hammer/editprefabdlg.cpp | 4 +- hammer/editprefabdlg.h | 3 +- hammer/entityhelpdlg.cpp | 4 +- hammer/entityhelpdlg.h | 3 +- hammer/entityreportdlg.cpp | 4 +- hammer/entityreportdlg.h | 3 +- hammer/gotobrushdlg.cpp | 4 +- hammer/gotobrushdlg.h | 3 +- hammer/hammer.cpp | 7 +- hammer/hammer_dll.vpc | 4 +- hammer/listboxex.cpp | 431 ------------------------------------ hammer/listboxex.h | 123 ---------- hammer/manifestdialog.cpp | 18 +- hammer/manifestdialog.h | 11 +- hammer/mapcheckdlg.cpp | 4 +- hammer/mapcheckdlg.h | 2 +- hammer/maperrorsdlg.cpp | 4 +- hammer/maperrorsdlg.h | 4 +- hammer/mapinfodlg.cpp | 2 +- hammer/mapinfodlg.h | 3 +- hammer/materialdlg.cpp | 8 +- hammer/materialdlg.h | 5 +- hammer/newdoctype.cpp | 4 +- hammer/newdoctype.h | 4 +- hammer/newkeyvalue.cpp | 4 +- hammer/newkeyvalue.h | 4 +- hammer/noise.cpp | 2 +- hammer/op_entity.h | 1 - hammer/pastespecialdlg.cpp | 5 +- hammer/pastespecialdlg.h | 3 +- hammer/prefabsdlg.cpp | 4 +- hammer/prefabsdlg.h | 3 +- hammer/progdlg.cpp | 2 +- hammer/progdlg.h | 1 + hammer/replacetexdlg.cpp | 4 +- hammer/replacetexdlg.h | 4 +- hammer/runmap.cpp | 4 +- hammer/runmap.h | 2 + hammer/runmapcfgdlg.cpp | 4 +- hammer/runmapcfgdlg.h | 3 +- hammer/runmapexpertdlg.cpp | 4 +- hammer/runmapexpertdlg.h | 3 +- hammer/scaleverticesdlg.cpp | 4 +- hammer/scaleverticesdlg.h | 3 +- hammer/sculptoptions.cpp | 18 +- hammer/sculptoptions.h | 7 +- hammer/selectentitydlg.cpp | 5 +- hammer/selectentitydlg.h | 4 +- hammer/strdlg.cpp | 4 +- hammer/strdlg.h | 3 +- hammer/texturebrowser.cpp | 4 +- hammer/texturebrowser.h | 4 +- hammer/torusdlg.h | 6 +- hammer/transformdlg.cpp | 4 +- hammer/transformdlg.h | 4 +- 81 files changed, 193 insertions(+), 714 deletions(-) delete mode 100644 hammer/listboxex.cpp delete mode 100644 hammer/listboxex.h diff --git a/hammer/MapDiffDlg.cpp b/hammer/MapDiffDlg.cpp index d8b991489..d9b9f334d 100644 --- a/hammer/MapDiffDlg.cpp +++ b/hammer/MapDiffDlg.cpp @@ -29,7 +29,7 @@ CMapDoc *s_pCurrentMap = NULL; // MapDiffDlg dialog CMapDiffDlg::CMapDiffDlg(CWnd* pParent ) - : CDialog(CMapDiffDlg::IDD, pParent) + : CBaseDlg(CMapDiffDlg::IDD, pParent) { m_bCheckSimilar = true; } @@ -43,7 +43,7 @@ void CMapDiffDlg::DoDataExchange(CDataExchange* pDX) } -BEGIN_MESSAGE_MAP(CMapDiffDlg, CDialog) +BEGIN_MESSAGE_MAP(CMapDiffDlg, CBaseDlg) ON_BN_CLICKED(IDC_SIMILARCHECK, OnBnClickedSimilarcheck) ON_BN_CLICKED(IDC_MAPBROWSE, OnBnClickedMapbrowse) ON_BN_CLICKED(IDOK, OnBnClickedOk) diff --git a/hammer/MapDiffDlg.h b/hammer/MapDiffDlg.h index 397c57e83..eb1ee0f72 100644 --- a/hammer/MapDiffDlg.h +++ b/hammer/MapDiffDlg.h @@ -10,7 +10,7 @@ // MapDiffDlg dialog -class CMapDiffDlg : public CDialog +class CMapDiffDlg : public CBaseDlg { public: static void MapDiff(CWnd *pwndParent, CMapDoc *p_CurrentMap); diff --git a/hammer/ModelBrowser.cpp b/hammer/ModelBrowser.cpp index 773e2d7b9..18ec8a034 100644 --- a/hammer/ModelBrowser.cpp +++ b/hammer/ModelBrowser.cpp @@ -72,9 +72,9 @@ class CModelBrowserPanel : public vgui::EditablePanel CModelBrowser *m_pBrowser; }; -IMPLEMENT_DYNAMIC(CModelBrowser, CDialog) +IMPLEMENT_DYNAMIC(CModelBrowser, CBaseDlg) CModelBrowser::CModelBrowser(CWnd* pParent /*=NULL*/) - : CDialog(CModelBrowser::IDD, pParent) + : CBaseDlg(CModelBrowser::IDD, pParent) { m_pPicker = new CMDLPicker( NULL ); m_pStatusLine = new vgui::TextEntry( NULL, "StatusLine" ); @@ -214,7 +214,7 @@ void CModelBrowser::OnSize(UINT nType, int cx, int cy) } -BEGIN_MESSAGE_MAP(CModelBrowser, CDialog) +BEGIN_MESSAGE_MAP(CModelBrowser, CBaseDlg) ON_WM_SIZE() ON_WM_DESTROY() END_MESSAGE_MAP() diff --git a/hammer/ModelBrowser.h b/hammer/ModelBrowser.h index 750395175..7ad0a8e24 100644 --- a/hammer/ModelBrowser.h +++ b/hammer/ModelBrowser.h @@ -1,6 +1,7 @@ //========= Copyright Valve Corporation, All rights reserved. ============// #pragma once +#include "windows/base_dlg.h" #include "resource.h" #include "VGuiWnd.h" @@ -17,7 +18,7 @@ class CModelBrowserPanel; class CMDLPicker; -class CModelBrowser : public CDialog +class CModelBrowser : public CBaseDlg { DECLARE_DYNAMIC(CModelBrowser) diff --git a/hammer/NewVisGroupDlg.cpp b/hammer/NewVisGroupDlg.cpp index 563da4991..e579cfed6 100644 --- a/hammer/NewVisGroupDlg.cpp +++ b/hammer/NewVisGroupDlg.cpp @@ -18,7 +18,7 @@ static const unsigned int g_uSelChangeMsg = ::RegisterWindowMessage(GROUPLIST_MS static BOOL s_bLastHideObjects = TRUE; -BEGIN_MESSAGE_MAP(CNewVisGroupDlg, CDialog) +BEGIN_MESSAGE_MAP(CNewVisGroupDlg, CBaseDlg) //{{AFX_MSG_MAP(CNewVisGroupDlg) ON_REGISTERED_MESSAGE(g_uSelChangeMsg, OnSelChangeGroupList) ON_COMMAND(IDC_PLACE_IN_EXISTING_VISGROUP, OnPlaceInExistingVisGroup) @@ -32,7 +32,7 @@ END_MESSAGE_MAP() // Input : pParent - //----------------------------------------------------------------------------- CNewVisGroupDlg::CNewVisGroupDlg(CString &str, CWnd *pParent) - : CDialog(CNewVisGroupDlg::IDD, pParent) + : CBaseDlg(CNewVisGroupDlg::IDD, pParent) { m_pPickedVisGroup = NULL; diff --git a/hammer/NewVisGroupDlg.h b/hammer/NewVisGroupDlg.h index e06dccc50..a24d8b128 100644 --- a/hammer/NewVisGroupDlg.h +++ b/hammer/NewVisGroupDlg.h @@ -10,11 +10,12 @@ #pragma once #endif +#include "windows/base_dlg.h" #include "resource.h" #include "GroupList.h" -class CNewVisGroupDlg : public CDialog +class CNewVisGroupDlg : public CBaseDlg { public: CNewVisGroupDlg(CString &str, CWnd *pParent = NULL); diff --git a/hammer/ScenePreviewDlg.cpp b/hammer/ScenePreviewDlg.cpp index a59d52763..594114ccf 100644 --- a/hammer/ScenePreviewDlg.cpp +++ b/hammer/ScenePreviewDlg.cpp @@ -18,7 +18,7 @@ #define WM_SCENEPREVIEW_IDLE (WM_USER+1) -BEGIN_MESSAGE_MAP(CScenePreviewDlg, CDialog) +BEGIN_MESSAGE_MAP(CScenePreviewDlg, CBaseDlg) //{{AFX_MSG_MAP(CScenePreviewDlg) ON_BN_CLICKED(IDCANCEL, OnCancel) //}}AFX_MSG_MAP @@ -26,7 +26,7 @@ END_MESSAGE_MAP() CScenePreviewDlg::CScenePreviewDlg( CChoreoScene *pScene, const char *pFilename, CWnd* pParent /*=NULL*/ ) - : CDialog(CScenePreviewDlg::IDD, pParent) + : CBaseDlg(CScenePreviewDlg::IDD, pParent) { //{{AFX_DATA_INIT(CScenePreviewDlg) m_pScene = pScene; diff --git a/hammer/ScenePreviewDlg.h b/hammer/ScenePreviewDlg.h index 3c42cbbdd..020be7459 100644 --- a/hammer/ScenePreviewDlg.h +++ b/hammer/ScenePreviewDlg.h @@ -11,11 +11,12 @@ #endif #include "resource.h" +#include "windows/base_dlg.h" class CChoreoScene; -class CScenePreviewDlg : public CDialog +class CScenePreviewDlg : public CBaseDlg { // Construction public: diff --git a/hammer/SearchReplaceDlg.cpp b/hammer/SearchReplaceDlg.cpp index be9ac1af2..6e81a7042 100644 --- a/hammer/SearchReplaceDlg.cpp +++ b/hammer/SearchReplaceDlg.cpp @@ -311,7 +311,7 @@ int FindReplace(CMapEntity *pEntity, FindObject_t &FindObject, const char *pszRe } -BEGIN_MESSAGE_MAP(CSearchReplaceDlg, CDialog) +BEGIN_MESSAGE_MAP(CSearchReplaceDlg, CBaseDlg) //{{AFX_MSG_MAP(CSearchReplaceDlg) ON_WM_SHOWWINDOW() ON_COMMAND_EX(IDC_FIND_NEXT, OnFindReplace) @@ -326,7 +326,7 @@ END_MESSAGE_MAP() // Input : pParent - //----------------------------------------------------------------------------- CSearchReplaceDlg::CSearchReplaceDlg(CWnd *pParent) - : CDialog(CSearchReplaceDlg::IDD, pParent) + : CBaseDlg(CSearchReplaceDlg::IDD, pParent) { m_bNewSearch = true; diff --git a/hammer/SearchReplaceDlg.h b/hammer/SearchReplaceDlg.h index 1f6413d6f..e640841f9 100644 --- a/hammer/SearchReplaceDlg.h +++ b/hammer/SearchReplaceDlg.h @@ -11,6 +11,7 @@ #pragma once #endif +#include "windows/base_dlg.h" #include "resource.h" #include "utlvector.h" #include "MapClass.h" @@ -28,7 +29,7 @@ enum FindReplaceIn_t }; -class CSearchReplaceDlg : public CDialog +class CSearchReplaceDlg : public CBaseDlg { // Construction public: diff --git a/hammer/SoundBrowser.cpp b/hammer/SoundBrowser.cpp index 86c075adb..0ae02842c 100644 --- a/hammer/SoundBrowser.cpp +++ b/hammer/SoundBrowser.cpp @@ -23,7 +23,7 @@ int CSoundBrowser::m_nFilterHistory; CSoundBrowser::CSoundBrowser( const char *pCurrentSoundName, CWnd* pParent /*=NULL*/ ) - : CDialog(CSoundBrowser::IDD, pParent) + : CBaseDlg(CSoundBrowser::IDD, pParent) { //{{AFX_DATA_INIT(CSoundBrowser) m_Autoplay = FALSE; @@ -61,7 +61,7 @@ void CSoundBrowser::DoDataExchange(CDataExchange* pDX) } -BEGIN_MESSAGE_MAP(CSoundBrowser, CDialog) +BEGIN_MESSAGE_MAP(CSoundBrowser, CBaseDlg) //{{AFX_MSG_MAP(CSoundBrowser) ON_WM_CLOSE() ON_CBN_EDITCHANGE(IDC_SOUND_FILTER, OnChangeFilter) diff --git a/hammer/TorusDlg.cpp b/hammer/TorusDlg.cpp index 80a770fc6..d430664c3 100644 --- a/hammer/TorusDlg.cpp +++ b/hammer/TorusDlg.cpp @@ -23,7 +23,7 @@ void MakeArcCenterRadius(float xCenter, float yCenter, float xrad, float yrad, i void MakeArc(float x1, float y1, float x2, float y2, int npoints, float start_ang, float fArc, float points[][2]); CTorusDlg::CTorusDlg(Vector& boxmins, Vector& boxmaxs, CWnd* pParent /*=NULL*/) - : CDialog(CTorusDlg::IDD, pParent) + : CBaseDlg(CTorusDlg::IDD, pParent) { bmins = boxmins; bmaxs = boxmaxs; @@ -133,7 +133,7 @@ void CTorusDlg::DoDataExchange(CDataExchange* pDX) } -BEGIN_MESSAGE_MAP(CTorusDlg, CDialog) +BEGIN_MESSAGE_MAP(CTorusDlg, CBaseDlg) //{{AFX_MSG_MAP(CTorusDlg) ON_EN_CHANGE(IDC_ARC, OnChangeArc) ON_EN_CHANGE(IDC_ROTATION_ARC, OnChangeTorusArc) diff --git a/hammer/archdlg.cpp b/hammer/archdlg.cpp index 44b44ec7d..b39593c92 100644 --- a/hammer/archdlg.cpp +++ b/hammer/archdlg.cpp @@ -20,7 +20,7 @@ extern void MakeArc(float x1, float y1, float x2, float y2, int npoints, CArchDlg::CArchDlg(Vector& boxmins, Vector& boxmaxs, CWnd* pParent /*=NULL*/) - : CDialog(CArchDlg::IDD, pParent) + : CBaseDlg(CArchDlg::IDD, pParent) { bmins = boxmins; bmaxs = boxmaxs; @@ -89,7 +89,7 @@ void CArchDlg::DoDataExchange(CDataExchange* pDX) } -BEGIN_MESSAGE_MAP(CArchDlg, CDialog) +BEGIN_MESSAGE_MAP(CArchDlg, CBaseDlg) //{{AFX_MSG_MAP(CArchDlg) ON_EN_CHANGE(IDC_ARC, OnChangeArc) ON_BN_CLICKED(IDC_CIRCLE, OnCircle) diff --git a/hammer/archdlg.h b/hammer/archdlg.h index 4165b214a..f947bebef 100644 --- a/hammer/archdlg.h +++ b/hammer/archdlg.h @@ -10,13 +10,14 @@ #pragma once #endif // _MSC_VER >= 1000 +#include "windows/base_dlg.h" #include "mathlib/vector.h" #include "resource.h" constexpr inline size_t ARC_MAX_POINTS{4096}; -class CArchDlg : public CDialog +class CArchDlg : public CBaseDlg { // Construction public: diff --git a/hammer/dispdlg.cpp b/hammer/dispdlg.cpp index e31336d77..7f05ab4d5 100644 --- a/hammer/dispdlg.cpp +++ b/hammer/dispdlg.cpp @@ -31,7 +31,7 @@ // // Displacement Create Dialog Functions // -BEGIN_MESSAGE_MAP(CDispCreateDlg, CDialog) +BEGIN_MESSAGE_MAP(CDispCreateDlg, CBaseDlg) //{{AFX_MSG_MAP(CDispCreateDlg) ON_WM_VSCROLL() //}}AFX_MSG_MAP @@ -43,7 +43,7 @@ extern CToolDisplace* GetDisplacementTool(); // Purpose: constructor //----------------------------------------------------------------------------- CDispCreateDlg::CDispCreateDlg( CWnd *pParent ) : - CDialog( CDispCreateDlg::IDD, pParent ) + CBaseDlg( CDispCreateDlg::IDD, pParent ) { m_Power = 0; } @@ -99,7 +99,7 @@ void CDispCreateDlg::OnVScroll( UINT nSBCode, UINT nPos, CScrollBar *pScrollBar // // Displacement Noise Dialog Functions // -BEGIN_MESSAGE_MAP(CDispNoiseDlg, CDialog) +BEGIN_MESSAGE_MAP(CDispNoiseDlg, CBaseDlg) //{{AFX_MSG_MAP(CDispNoiseDlg) ON_NOTIFY( UDN_DELTAPOS, ID_DISP_NOISE_MIN_SPIN, OnSpinUpDown ) ON_NOTIFY( UDN_DELTAPOS, ID_DISP_NOISE_MAX_SPIN, OnSpinUpDown ) @@ -110,7 +110,7 @@ END_MESSAGE_MAP() // Purpose: constructor //----------------------------------------------------------------------------- CDispNoiseDlg::CDispNoiseDlg( CWnd *pParent ) : - CDialog( CDispNoiseDlg::IDD, pParent ) + CBaseDlg( CDispNoiseDlg::IDD, pParent ) { m_Min = m_Max = 0.0f; } @@ -203,7 +203,7 @@ void CDispNoiseDlg::OnSpinUpDown( NMHDR *pNMHDR, LRESULT *pResult ) // // Displacement Paint Distance Dialog Functions // -BEGIN_MESSAGE_MAP(CDispPaintDistDlg, CDialog) +BEGIN_MESSAGE_MAP(CDispPaintDistDlg, CBaseDlg) //{{AFX_MSG_MAP(CDispPaintDistDlg) ON_BN_CLICKED( ID_DISP_PAINT_DIST_RAISELOWER, OnEffectRaiseLowerGeo ) ON_BN_CLICKED( ID_DISP_PAINT_DIST_RAISETO, OnEffectRaiseToGeo ) @@ -231,7 +231,7 @@ END_MESSAGE_MAP() // Purpose: constructor //----------------------------------------------------------------------------- CDispPaintDistDlg::CDispPaintDistDlg( CWnd *pParent ) : - CDialog( CDispPaintDistDlg::IDD, pParent ) + CBaseDlg( CDispPaintDistDlg::IDD, pParent ) { } @@ -1069,7 +1069,7 @@ void CDispPaintDistDlg::OnDestroy( void ) // // Paint Scult Dialog Functions // -BEGIN_MESSAGE_MAP(CPaintSculptDlg, CDialog) +BEGIN_MESSAGE_MAP(CPaintSculptDlg, CBaseDlg) //{{AFX_MSG_MAP(CPaintSculptDlg) ON_BN_CLICKED( ID_DISP_PAINT_DIST_AUTOSEW, OnCheckAutoSew ) ON_WM_CLOSE() @@ -1088,7 +1088,7 @@ END_MESSAGE_MAP() // Purpose: constructor //----------------------------------------------------------------------------- CPaintSculptDlg::CPaintSculptDlg( CWnd *pParent ) : -CDialog( CPaintSculptDlg::IDD, pParent ) +CBaseDlg( CPaintSculptDlg::IDD, pParent ) { m_bAutoSew = true; m_SculptMode = SCULPT_MODE_PUSH; @@ -1414,7 +1414,7 @@ void CPaintSculptDlg::SetActiveMode( SculptMode NewMode ) // // Set Paint Distance Dialog Functions // -BEGIN_MESSAGE_MAP(CDispPaintDataDlg, CDialog) +BEGIN_MESSAGE_MAP(CDispPaintDataDlg, CBaseDlg) //{{AFX_MSG_MAP(CDispPaintDataDlg) ON_BN_CLICKED( ID_DISP_PAINT_DATA_RAISELOWER, OnEffectRaiseLowerData ) ON_BN_CLICKED( ID_DISP_PAINT_DATA_RAISETO, OnEffectRaiseToData ) @@ -1435,7 +1435,7 @@ END_MESSAGE_MAP() // Purpose: constructor //----------------------------------------------------------------------------- CDispPaintDataDlg::CDispPaintDataDlg( CWnd *pParent ) : - CDialog( CDispPaintDataDlg::IDD, pParent ) + CBaseDlg( CDispPaintDataDlg::IDD, pParent ) { } diff --git a/hammer/dispdlg.h b/hammer/dispdlg.h index 0b31d7031..7a465dbb4 100644 --- a/hammer/dispdlg.h +++ b/hammer/dispdlg.h @@ -9,6 +9,7 @@ #define DISPDLG_H #pragma once +#include "windows/base_dlg.h" #include "resource.h" #include "IconComboBox.h" #include "mathlib/vector.h" @@ -18,7 +19,7 @@ // // Displacement Create Dialog // -class CDispCreateDlg : public CDialog +class CDispCreateDlg : public CBaseDlg { public: @@ -50,7 +51,7 @@ class CDispCreateDlg : public CDialog // // Displacement Noise Dialog // -class CDispNoiseDlg : public CDialog +class CDispNoiseDlg : public CBaseDlg { public: @@ -85,7 +86,7 @@ class CDispNoiseDlg : public CDialog // // Displacement Paint Dist Dialog // -class CDispPaintDistDlg : public CDialog +class CDispPaintDistDlg : public CBaseDlg { public: @@ -180,7 +181,7 @@ class CSculptPushOptions; class CSculptCarveOptions; class CSculptProjectOptions; -class CPaintSculptDlg : public CDialog +class CPaintSculptDlg : public CBaseDlg { public: @@ -248,7 +249,7 @@ class CPaintSculptDlg : public CDialog // // Displacement Paint Dist Dialog // -class CDispPaintDataDlg : public CDialog +class CDispPaintDataDlg : public CBaseDlg { public: diff --git a/hammer/dynamicdialogwnd.cpp b/hammer/dynamicdialogwnd.cpp index 7ddadb9bf..64f07c99b 100644 --- a/hammer/dynamicdialogwnd.cpp +++ b/hammer/dynamicdialogwnd.cpp @@ -42,7 +42,7 @@ END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CDynamicDialogWnd message handlers -void CDynamicDialogWnd::SetDialogClass(UINT nID, CDialog *pDialog) +void CDynamicDialogWnd::SetDialogClass(UINT nID, CBaseDlg *pDialog) { delete m_pDialog; diff --git a/hammer/dynamicdialogwnd.h b/hammer/dynamicdialogwnd.h index 514a1e8e3..3f5a1933e 100644 --- a/hammer/dynamicdialogwnd.h +++ b/hammer/dynamicdialogwnd.h @@ -8,6 +8,7 @@ // DynamicDialogWnd.h : header file // +#include "windows/base_dlg.h" ///////////////////////////////////////////////////////////////////////////// // CDynamicDialogWnd window @@ -22,7 +23,7 @@ class CDynamicDialogWnd : public CWnd // Operations public: - void SetDialogClass(UINT nID, CDialog *pDialog); + void SetDialogClass(UINT nID, CBaseDlg *pDialog); // Overrides // ClassWizard generated virtual function overrides @@ -40,7 +41,7 @@ class CDynamicDialogWnd : public CWnd //}}AFX_MSG DECLARE_MESSAGE_MAP() - CDialog *m_pDialog; + CBaseDlg *m_pDialog; }; ///////////////////////////////////////////////////////////////////////////// diff --git a/hammer/editgameconfigs.cpp b/hammer/editgameconfigs.cpp index 23f9af20d..a5583dfd4 100644 --- a/hammer/editgameconfigs.cpp +++ b/hammer/editgameconfigs.cpp @@ -23,7 +23,7 @@ CEditGameConfigs::CEditGameConfigs(BOOL bSelectOnly, CWnd* pParent /*=NULL*/) - : CDialog(CEditGameConfigs::IDD, pParent) + : CBaseDlg(CEditGameConfigs::IDD, pParent) { //{{AFX_DATA_INIT(CEditGameConfigs) // NOTE: the ClassWizard will add member initialization here @@ -43,7 +43,7 @@ void CEditGameConfigs::DoDataExchange(CDataExchange* pDX) } -BEGIN_MESSAGE_MAP(CEditGameConfigs, CDialog) +BEGIN_MESSAGE_MAP(CEditGameConfigs, CBaseDlg) //{{AFX_MSG_MAP(CEditGameConfigs) ON_BN_CLICKED(IDC_ADD, OnAdd) ON_BN_CLICKED(IDC_COPY, OnCopy) diff --git a/hammer/editgameconfigs.h b/hammer/editgameconfigs.h index 5064ebf24..ac263c537 100644 --- a/hammer/editgameconfigs.h +++ b/hammer/editgameconfigs.h @@ -15,11 +15,12 @@ #define EDITGAMECONFIGS_H #pragma once +#include "windows/base_dlg.h" #include "Options.h" #include "Resource.h" -class CEditGameConfigs : public CDialog +class CEditGameConfigs : public CBaseDlg { // Construction public: diff --git a/hammer/editgroups.cpp b/hammer/editgroups.cpp index b6cafaed5..e379e7efb 100644 --- a/hammer/editgroups.cpp +++ b/hammer/editgroups.cpp @@ -19,7 +19,7 @@ static const unsigned int g_uSelChangeMsg = ::RegisterWindowMessage(GROUPLIST_MSG_SEL_CHANGE); -BEGIN_MESSAGE_MAP(CEditGroups, CDialog) +BEGIN_MESSAGE_MAP(CEditGroups, CBaseDlg) //{{AFX_MSG_MAP(CEditGroups) ON_BN_CLICKED(IDC_COLOR, OnColor) ON_EN_CHANGE(IDC_NAME, OnChangeName) @@ -36,7 +36,7 @@ END_MESSAGE_MAP() // Input : pParent - Parent window. //----------------------------------------------------------------------------- CEditGroups::CEditGroups(CWnd* pParent /*=NULL*/) - : CDialog(CEditGroups::IDD, pParent) + : CBaseDlg(CEditGroups::IDD, pParent) { //{{AFX_DATA_INIT(CEditGroups) // NOTE: the ClassWizard will add member initialization here diff --git a/hammer/editgroups.h b/hammer/editgroups.h index c84d6ce0b..b0120f719 100644 --- a/hammer/editgroups.h +++ b/hammer/editgroups.h @@ -10,6 +10,7 @@ #pragma once #endif +#include "windows/base_dlg.h" #include "GroupList.h" #include "mapdoc.h" @@ -33,7 +34,7 @@ class CColorBox : public CStatic }; -class CEditGroups : public CDialog +class CEditGroups : public CBaseDlg { // Construction public: diff --git a/hammer/editpathdlg.cpp b/hammer/editpathdlg.cpp index 0e36370ce..77e0eaba3 100644 --- a/hammer/editpathdlg.cpp +++ b/hammer/editpathdlg.cpp @@ -15,7 +15,7 @@ CEditPathDlg::CEditPathDlg(CWnd* pParent /*=NULL*/) - : CDialog(CEditPathDlg::IDD, pParent) + : CBaseDlg(CEditPathDlg::IDD, pParent) { //{{AFX_DATA_INIT(CEditPathDlg) m_strClass = _T(""); @@ -37,7 +37,7 @@ void CEditPathDlg::DoDataExchange(CDataExchange* pDX) } -BEGIN_MESSAGE_MAP(CEditPathDlg, CDialog) +BEGIN_MESSAGE_MAP(CEditPathDlg, CBaseDlg) //{{AFX_MSG_MAP(CEditPathDlg) //}}AFX_MSG_MAP END_MESSAGE_MAP() diff --git a/hammer/editpathdlg.h b/hammer/editpathdlg.h index fc4bf35d1..d7824686d 100644 --- a/hammer/editpathdlg.h +++ b/hammer/editpathdlg.h @@ -14,10 +14,12 @@ // EditPathDlg.h : header file // +#include "windows/base_dlg.h" + ///////////////////////////////////////////////////////////////////////////// // CEditPathDlg dialog -class CEditPathDlg : public CDialog +class CEditPathDlg : public CBaseDlg { // Construction public: diff --git a/hammer/editpathnodedlg.cpp b/hammer/editpathnodedlg.cpp index 1a683e675..6d7d10ccd 100644 --- a/hammer/editpathnodedlg.cpp +++ b/hammer/editpathnodedlg.cpp @@ -20,7 +20,7 @@ CEditPathNodeDlg::CEditPathNodeDlg(CWnd* pParent /*=NULL*/) - : CDialog(CEditPathNodeDlg::IDD, pParent) + : CBaseDlg(CEditPathNodeDlg::IDD, pParent) { //{{AFX_DATA_INIT(CEditPathNodeDlg) m_bRetrigger = FALSE; @@ -46,7 +46,7 @@ void CEditPathNodeDlg::DoDataExchange(CDataExchange* pDX) } -BEGIN_MESSAGE_MAP(CEditPathNodeDlg, CDialog) +BEGIN_MESSAGE_MAP(CEditPathNodeDlg, CBaseDlg) //{{AFX_MSG_MAP(CEditPathNodeDlg) // NOTE: the ClassWizard will add message map macros here //}}AFX_MSG_MAP diff --git a/hammer/editpathnodedlg.h b/hammer/editpathnodedlg.h index 81e324390..68acd994a 100644 --- a/hammer/editpathnodedlg.h +++ b/hammer/editpathnodedlg.h @@ -11,13 +11,14 @@ #pragma once #endif +#include "windows/base_dlg.h" #include "resource.h" ///////////////////////////////////////////////////////////////////////////// // CEditPathNodeDlg dialog -class CEditPathNodeDlg : public CDialog +class CEditPathNodeDlg : public CBaseDlg { // Construction public: diff --git a/hammer/editprefabdlg.cpp b/hammer/editprefabdlg.cpp index 4e4aac5c2..5cd7799b6 100644 --- a/hammer/editprefabdlg.cpp +++ b/hammer/editprefabdlg.cpp @@ -21,7 +21,7 @@ CEditPrefabDlg::CEditPrefabDlg(CWnd* pParent /*=NULL*/) - : CDialog(CEditPrefabDlg::IDD, pParent) + : CBaseDlg(CEditPrefabDlg::IDD, pParent) { //{{AFX_DATA_INIT(CEditPrefabDlg) m_strDescript = _T(""); @@ -49,7 +49,7 @@ void CEditPrefabDlg::DoDataExchange(CDataExchange* pDX) } -BEGIN_MESSAGE_MAP(CEditPrefabDlg, CDialog) +BEGIN_MESSAGE_MAP(CEditPrefabDlg, CBaseDlg) //{{AFX_MSG_MAP(CEditPrefabDlg) ON_CBN_SELCHANGE(IDC_CREATEIN, OnSelchangeCreatein) //}}AFX_MSG_MAP diff --git a/hammer/editprefabdlg.h b/hammer/editprefabdlg.h index 832bf3fea..d1d68ed96 100644 --- a/hammer/editprefabdlg.h +++ b/hammer/editprefabdlg.h @@ -10,9 +10,10 @@ #pragma once #endif +#include "windows/base_dlg.h" #include "resource.h" -class CEditPrefabDlg : public CDialog +class CEditPrefabDlg : public CBaseDlg { // Construction public: diff --git a/hammer/entityhelpdlg.cpp b/hammer/entityhelpdlg.cpp index d552e4e07..79a0b4993 100644 --- a/hammer/entityhelpdlg.cpp +++ b/hammer/entityhelpdlg.cpp @@ -16,7 +16,7 @@ static CEntityHelpDlg *g_pHelpDlg = NULL; -BEGIN_MESSAGE_MAP(CEntityHelpDlg, CDialog) +BEGIN_MESSAGE_MAP(CEntityHelpDlg, CBaseDlg) //{{AFX_MSG_MAP(CEntityHelpDlg) ON_WM_DESTROY() ON_WM_CLOSE() @@ -60,7 +60,7 @@ void CEntityHelpDlg::SetEditGameClass(GDclass *pClass) // Purpose: Constructor. //----------------------------------------------------------------------------- CEntityHelpDlg::CEntityHelpDlg(CWnd *pwndParent) - : CDialog(CEntityHelpDlg::IDD, pwndParent) + : CBaseDlg(CEntityHelpDlg::IDD, pwndParent) { m_pHelpText = NULL; m_pClass = NULL; diff --git a/hammer/entityhelpdlg.h b/hammer/entityhelpdlg.h index 9899e5b5e..6e804e105 100644 --- a/hammer/entityhelpdlg.h +++ b/hammer/entityhelpdlg.h @@ -11,6 +11,7 @@ #pragma once #endif +#include "windows/base_dlg.h" #include "Resource.h" @@ -18,7 +19,7 @@ class GDclass; class CRichEditCtrlEx; -class CEntityHelpDlg : public CDialog +class CEntityHelpDlg : public CBaseDlg { public: diff --git a/hammer/entityreportdlg.cpp b/hammer/entityreportdlg.cpp index eff00eea8..6554140ae 100644 --- a/hammer/entityreportdlg.cpp +++ b/hammer/entityreportdlg.cpp @@ -45,7 +45,7 @@ void CEntityReportDlg::ShowEntityReport(CMapDoc *pDoc, CWnd *pwndParent) // Purpose: Private constructor. //----------------------------------------------------------------------------- CEntityReportDlg::CEntityReportDlg(CMapDoc *pDoc, CWnd* pParent /*=NULL*/) - : CDialog(CEntityReportDlg::IDD, pParent) + : CBaseDlg(CEntityReportDlg::IDD, pParent) { m_pDoc = pDoc; @@ -108,7 +108,7 @@ void CEntityReportDlg::DoDataExchange(CDataExchange* pDX) } -BEGIN_MESSAGE_MAP(CEntityReportDlg, CDialog) +BEGIN_MESSAGE_MAP(CEntityReportDlg, CBaseDlg) //{{AFX_MSG_MAP(CEntityReportDlg) ON_BN_CLICKED(IDC_DELETE, OnDelete) ON_BN_CLICKED(IDC_FILTERBYHIDDEN, OnFilterbyhidden) diff --git a/hammer/entityreportdlg.h b/hammer/entityreportdlg.h index e5314be0b..523cffc24 100644 --- a/hammer/entityreportdlg.h +++ b/hammer/entityreportdlg.h @@ -10,12 +10,13 @@ #pragma once #endif +#include "windows/base_dlg.h" #include #include "resource.h" #include "MapDoc.h" -class CEntityReportDlg : public CDialog +class CEntityReportDlg : public CBaseDlg { public: diff --git a/hammer/gotobrushdlg.cpp b/hammer/gotobrushdlg.cpp index 35d10fe34..4ea40d67d 100644 --- a/hammer/gotobrushdlg.cpp +++ b/hammer/gotobrushdlg.cpp @@ -14,7 +14,7 @@ #include -BEGIN_MESSAGE_MAP(CGotoBrushDlg, CDialog) +BEGIN_MESSAGE_MAP(CGotoBrushDlg, CBaseDlg) //{{AFX_MSG_MAP(CGotoBrushDlg) //}}AFX_MSG_MAP END_MESSAGE_MAP() @@ -24,7 +24,7 @@ END_MESSAGE_MAP() // Purpose: //----------------------------------------------------------------------------- CGotoBrushDlg::CGotoBrushDlg(CWnd *pParent) - : CDialog(CGotoBrushDlg::IDD, pParent) + : CBaseDlg(CGotoBrushDlg::IDD, pParent) { //{{AFX_DATA_INIT(CGotoBrushDlg) m_nBrushID = 0; diff --git a/hammer/gotobrushdlg.h b/hammer/gotobrushdlg.h index b958a5448..6d3e854c5 100644 --- a/hammer/gotobrushdlg.h +++ b/hammer/gotobrushdlg.h @@ -10,8 +10,9 @@ #pragma once #endif +#include "windows/base_dlg.h" -class CGotoBrushDlg : public CDialog +class CGotoBrushDlg : public CBaseDlg { // Construction public: diff --git a/hammer/hammer.cpp b/hammer/hammer.cpp index b522283a6..78bc70934 100644 --- a/hammer/hammer.cpp +++ b/hammer/hammer.cpp @@ -56,6 +56,7 @@ #include "lpreview_thread.h" #include "inputsystem/iinputsystem.h" #include "datacache/idatacache.h" +#include "windows/base_dlg.h" #ifndef NO_STEAM #include "steam/steam_api.h" #endif @@ -1431,7 +1432,7 @@ bool CHammer::IsNewDocumentVisible( void ) ///////////////////////////////////////////////////////////////////////////// // CAboutDlg dialog used for App About -class CAboutDlg : public CDialog +class CAboutDlg : public CBaseDlg { public: CAboutDlg(); @@ -1462,7 +1463,7 @@ class CAboutDlg : public CDialog //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- -CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD) +CAboutDlg::CAboutDlg() : CBaseDlg(CAboutDlg::IDD) { //{{AFX_DATA_INIT(CAboutDlg) //}}AFX_DATA_INIT @@ -1592,7 +1593,7 @@ BOOL CAboutDlg::OnInitDialog(void) } -BEGIN_MESSAGE_MAP(CAboutDlg, CDialog) +BEGIN_MESSAGE_MAP(CAboutDlg, CBaseDlg) //{{AFX_MSG_MAP(CAboutDlg) ON_BN_CLICKED(IDC_ORDER, OnOrder) //}}AFX_MSG_MAP diff --git a/hammer/hammer_dll.vpc b/hammer/hammer_dll.vpc index 98cbb5c7f..f59d08e71 100644 --- a/hammer/hammer_dll.vpc +++ b/hammer/hammer_dll.vpc @@ -113,6 +113,8 @@ $Project "hammer_dll" $File "AutoSelCombo.h" $File "Axes2.cpp" $File "Axes2.h" + $File "$SRCDIR\common\windows\base_dlg.h" + $File "$SRCDIR\common\windows\base_dlg.cpp" $File "BlockArray.h" $File "BoundBox.cpp" $File "BoundBox.h" @@ -206,8 +208,6 @@ $Project "hammer_dll" $File "Keyboard.cpp" $File "Keyboard.h" $File "$SRCDIR\public\KeyFrame\keyframe.h" - $File "ListBoxEx.cpp" - $File "ListBoxEx.h" $File "LoadSave_MAP.cpp" $File "LoadSave_RMF.cpp" $File "lpreview_thread.cpp" diff --git a/hammer/listboxex.cpp b/hammer/listboxex.cpp deleted file mode 100644 index 49fd1e0f6..000000000 --- a/hammer/listboxex.cpp +++ /dev/null @@ -1,431 +0,0 @@ -//========= Copyright Valve Corporation, All rights reserved. ============// -// -// Purpose: -// -// $NoKeywords: $ -// -//=============================================================================// -// ListBoxEx.cpp : implementation file -// - -#include "stdafx.h" -#include "hammer.h" -#include "ListBoxEx.h" - -// memdbgon must be the last include file in a .cpp file!!! -#include - -///////////////////////////////////////////////////////////////////////////// -// CListBoxEx - -CListBoxEx::CListBoxEx() -{ - Items.SetSize(16); - nItems = 0; - iItemHeight = -1; - dwStyle = 0; - bControlActive = FALSE; - bIgnoreChange = FALSE; -} - -CListBoxEx::~CListBoxEx() -{ -} - - -BEGIN_MESSAGE_MAP(CListBoxEx, CListBox) - //{{AFX_MSG_MAP(CListBoxEx) - ON_WM_LBUTTONDOWN() - ON_CONTROL_REFLECT(LBN_SELCHANGE, OnSelchange) - ON_WM_LBUTTONUP() - ON_WM_CHAR() - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CListBoxEx message handlers - -void CListBoxEx::SetStyle(DWORD dwStyle_) -{ - this->dwStyle = dwStyle_; -} - -void CListBoxEx::AddItem(char *pszCaption, int iEditType, PVOID pData, - int iRangeMin, int iRangeMax, const char * pszHelp) -{ - LBEXTITEMSTRUCT lbis; - - memset(&lbis, 0, sizeof lbis); - - strcpy(lbis.szCaption, pszCaption); - lbis.pszSaveCaption = pszCaption; - lbis.iEditType = iEditType; - - switch(iEditType) - { - case lbeYesNo: - case lbeOnOff: - lbis.iDataType = lbdBool; - lbis.iDataValue = PINT(pData)[0]; - break; - case lbeInteger: - lbis.iDataType = lbdInteger; - lbis.iDataValue = PINT(pData)[0]; - break; - case lbeTexture: - case lbeString: - lbis.iDataType = lbdString; - strcpy(lbis.szDataString, LPCTSTR(pData)); - break; - case lbeChoices: - lbis.iDataType = lbdString; - lbis.pChoices = NULL; - break; - } - - lbis.pSaveTo = pData; - - lbis.iRangeMin = iRangeMin; - lbis.iRangeMax = iRangeMax; - lbis.pszHelp = pszHelp; - - Items[nItems++] = lbis; - - AddString(""); // trick windows! muahaha -} - -void CListBoxEx::SetItemChoices(int iItem, CStringArray * pChoices, - int iDefaultChoice) -{ - LBEXTITEMSTRUCT& lbis = Items[iItem]; - - lbis.pChoices = pChoices; - lbis.iDataValue = iDefaultChoice; - V_strcpy_safe( lbis.szDataString, pChoices->GetAt( iDefaultChoice ) ); -} - -void CListBoxEx::MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct) -{ - if(iItemHeight == -1) - { - CDC *pDC = GetDC(); - TEXTMETRIC tm; - pDC->GetOutputTextMetrics(&tm); - iItemHeight = tm.tmHeight + 4; - - CRect r; - GetClientRect(r); - iCaptionWidthPixels = r.Width() / 2; - - ReleaseDC(pDC); - } - - lpMeasureItemStruct->itemHeight = iItemHeight; -} - -void CListBoxEx::GetItemText(int iItem, char *pszText) -{ - LBEXTITEMSTRUCT& lbis = Items[iItem]; - - switch(lbis.iDataType) - { - case lbdBool: - if(lbis.iEditType == lbeYesNo) - strcpy(pszText, lbis.iDataValue ? "Yes" : "No"); - else - strcpy(pszText, lbis.iDataValue ? "On" : "Off"); - break; - case lbdString: - strcpy(pszText, lbis.szDataString); - break; - case lbdInteger: - ltoa(lbis.iDataValue, pszText, 10); - break; - } -} - -void CListBoxEx::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) -{ - CDC dc; - dc.Attach(lpDrawItemStruct->hDC); - dc.SaveDC(); - - RECT& r = lpDrawItemStruct->rcItem; - - if(lpDrawItemStruct->itemID != -1 && - (lpDrawItemStruct->itemAction == ODA_DRAWENTIRE || - lpDrawItemStruct->itemAction == ODA_SELECT)) - { - LBEXTITEMSTRUCT& item = Items[lpDrawItemStruct->itemID]; - dc.SetROP2(R2_COPYPEN); - - int iBackIndex = COLOR_WINDOW; - int iForeIndex = COLOR_WINDOWTEXT; - BOOL bDrawCaptionOnly = FALSE; - - if(lpDrawItemStruct->itemAction == ODA_SELECT && - (lpDrawItemStruct->itemState & ODS_SELECTED)) - { - iBackIndex = COLOR_HIGHLIGHT; - iForeIndex = COLOR_HIGHLIGHTTEXT; - bDrawCaptionOnly = item.iDataType != lbdBool ? TRUE : FALSE; - } - - // draw background - CBrush brush; - brush.CreateSolidBrush(GetSysColor(iBackIndex)); - - if(0)//!bDrawCaptionOnly) - dc.FillRect(&r, &brush); - else - { - CRect r2(&r); - r2.right = iCaptionWidthPixels; - dc.FillRect(r2, &brush); - } - - // first, draw text - dc.SetTextColor(GetSysColor(iForeIndex)); - dc.SetBkColor(GetSysColor(iBackIndex)); - dc.TextOut(r.left + 1, r.top+ 1, item.szCaption, - strlen(item.szCaption)); - - if(!bDrawCaptionOnly) - { - // draw value .. - char szText[128]; - GetItemText(lpDrawItemStruct->itemID, szText); - dc.TextOut(r.left + iCaptionWidthPixels + 1, r.top + 1, - szText, strlen(szText)); - } - - // draw border. - CPen pen(PS_SOLID, 1, RGB(200, 200, 200)); - dc.SelectObject(pen); - dc.MoveTo(r.left, r.bottom-1); - dc.LineTo(r.right, r.bottom-1); - dc.MoveTo(r.left + iCaptionWidthPixels, r.top); - dc.LineTo(r.left + iCaptionWidthPixels, r.bottom-1); - } - else if(lpDrawItemStruct->itemAction == ODA_FOCUS) - { - dc.DrawFocusRect(&r); - } - - dc.RestoreDC(-1); -} - -void CListBoxEx::OnLButtonDown(UINT nFlags, CPoint point) -{ - BOOL bOutside; - int iItem = ItemFromPoint(point, bOutside); - LBEXTITEMSTRUCT& lbis = Items[iItem]; - - if(lbis.iDataType == lbdBool) - { - // toggle bool field - lbis.iDataValue = !lbis.iDataValue; - } - - CListBox::OnLButtonDown(nFlags, point); -} - -int CListBoxEx::CompareItem(LPCOMPAREITEMSTRUCT lpCompareItemStruct) -{ - return 0; -} - -void CListBoxEx::CreateEditControl() -{ - if(IsWindow(EditCtrl.m_hWnd)) - return; - - // create edit control - int iItem = GetCurSel(); - if(iItem == LB_ERR) - return; - - LBEXTITEMSTRUCT& lbis = Items[iItem]; - - if(lbis.iEditType != lbeString && - lbis.iEditType != lbeInteger && - lbis.iEditType != lbeTexture) - return; - - CRect r; - GetItemRect(iItem, r); - r.InflateRect(-1, -1); - r.left += iCaptionWidthPixels; - - // create edit ctrl - EditCtrl.Create(ES_LEFT | ES_LOWERCASE | WS_VISIBLE | WS_TABSTOP, r, this, - IDC_EDITPARAMETER); - // set font - HFONT hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT); - if (hFont == NULL) - hFont = (HFONT)GetStockObject(ANSI_VAR_FONT); - EditCtrl.SendMessage(WM_SETFONT, (WPARAM)hFont); - - // set current text in edit ctrl - char szBuf[128]; - GetItemText(iItem, szBuf); - EditCtrl.SetWindowText(szBuf); - - EditCtrl.SetForegroundWindow(); - EditCtrl.SetSel(0, -1); - - bControlActive = TRUE; - iControlItem = iItem; -} - -void CListBoxEx::CreateComboControl() -{ - if(IsWindow(ComboCtrl.m_hWnd)) - return; - - // create edit control - int iItem = GetCurSel(); - if(iItem == LB_ERR) - return; - - LBEXTITEMSTRUCT& lbis = Items[iItem]; - - if(lbis.iEditType != lbeChoices) - return; - - CRect r; - GetItemRect(iItem, r); - r.left += iCaptionWidthPixels; - r.bottom += 80; - - // create combo ctrl - ComboCtrl.Create(WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWNLIST | - WS_TABSTOP, r, this, IDC_EDITPARAMETER); - // set font - HFONT hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT); - if (hFont == NULL) - hFont = (HFONT)GetStockObject(ANSI_VAR_FONT); - ComboCtrl.SendMessage(WM_SETFONT, (WPARAM)hFont); - - // add strings to combo ctrl - CStringArray * pChoices = lbis.pChoices; - Assert(pChoices); - - for(int i = 0; i < pChoices->GetSize(); i++) - ComboCtrl.AddString(pChoices->GetAt(i)); - - // set current selection in combo ctrl - ComboCtrl.SetCurSel(lbis.iDataValue); - ComboCtrl.SetForegroundWindow(); - - bControlActive = TRUE; - iControlItem = iItem; -} - -void CListBoxEx::DestroyControls() -{ - // get rid of window if there is one - if(::IsWindow(EditCtrl.m_hWnd)) - { - EditCtrl.DestroyWindow(); - } - if(::IsWindow(ComboCtrl.m_hWnd)) - { - ComboCtrl.DestroyWindow(); - } - - bControlActive = FALSE; -} - -void CListBoxEx::OnSelchange() -{ - if(bControlActive) - { - // on combobox/edit controls, save string back to data - LBEXTITEMSTRUCT& lbis = Items[iControlItem]; - - if(lbis.iEditType == lbeChoices) - { - ComboCtrl.GetLBText(ComboCtrl.GetCurSel(), lbis.szDataString); - lbis.iDataValue = ComboCtrl.GetCurSel(); - } - else if(lbis.iDataType == lbdString) - { - EditCtrl.GetWindowText(lbis.szDataString, 128); - } - else if(lbis.iDataType == lbdInteger) - { - EditCtrl.GetWindowText(lbis.szDataString, 128); - lbis.iDataValue = atoi(lbis.szDataString); - } - } - - DestroyControls(); - - int iCurItem = GetCurSel(); - LBEXTITEMSTRUCT& lbis = Items[iCurItem]; - - if(lbis.iEditType == lbeChoices) - { - CreateComboControl(); - } - else - { - CreateEditControl(); - } -} - -void CListBoxEx::OnLButtonUp(UINT nFlags, CPoint point) -{ - CListBox::OnLButtonUp(nFlags, point); - - int iItem = GetCurSel(); - if(iItem == LB_ERR) - return; - - LBEXTITEMSTRUCT& lbis = Items[iItem]; - - if(lbis.iDataType == lbdBool) - { - lbis.iDataValue = !lbis.iDataValue; - Invalidate(); - } -} - -void CListBoxEx::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) -{ - CListBox::OnChar(nChar, nRepCnt, nFlags); - - return; - - int iItem = GetCurSel(); - if(iItem == LB_ERR) - return; - - LBEXTITEMSTRUCT& lbis = Items[iItem]; - - switch(nChar) - { - case VK_RETURN: - if(!(nFlags & 0x8000)) - break; - if(lbis.iDataType == lbdBool) - { - // toggle bool field - lbis.iDataValue = !lbis.iDataValue; - - Invalidate(); - } - else if(lbis.iEditType == lbeChoices) - { - CreateComboControl(); - } - else if(lbis.iEditType == lbeString || - lbis.iEditType == lbeInteger || - lbis.iEditType == lbeTexture) - { - CreateEditControl(); - } - break; - } -} diff --git a/hammer/listboxex.h b/hammer/listboxex.h deleted file mode 100644 index 3065095e7..000000000 --- a/hammer/listboxex.h +++ /dev/null @@ -1,123 +0,0 @@ -//========= Copyright Valve Corporation, All rights reserved. ============// -// -// Purpose: -// -// $NoKeywords: $ -// -//=============================================================================// -// ListBoxEx.h : header file -// - -#ifndef _LISTBOXEX_H -#define _LISTBOXEX_H - -#include - -enum -{ - lbdBool, - lbdString, - lbdInteger -}; - -enum -{ - lbeYesNo, - lbeOnOff, - lbeString, - lbeInteger, - lbeTexture, - lbeChoices -}; - -typedef struct -{ - char szCaption[128]; // field named - char *pszSaveCaption; // save caption to this, if supported - int iDataType; // how to display (lbdxxx) - int iEditType; // how to edit (lbexxx) - - int iDataValue; // int value for integer/bool fields - char szDataString[128]; // str value for string fields - - PVOID pSaveTo; - const char * pszHelp; // help text (ptr or NULL) - int iRangeMin; // ranged value min (-1 if no range) - int iRangeMax; // ranged value max (-1 if no range) - CStringArray* pChoices; // choices, if lbdChoices - -} LBEXTITEMSTRUCT; - -// listboxex styles -enum -{ - LBES_EDITCAPTIONS = 0x01 -}; - -///////////////////////////////////////////////////////////////////////////// -// CListBoxEx window - -class CListBoxEx : public CListBox -{ -// Construction -public: - CListBoxEx(); - -// Attributes -public: - int iCaptionWidthUnits; - int iCaptionWidthPixels; - int iItemHeight; - CEdit EditCtrl; - CComboBox ComboCtrl; - DWORD dwStyle; - BOOL bControlActive; - BOOL bIgnoreChange; - int iControlItem; - - void SetStyle(DWORD dwStyle); - - void AddItem(char * pszCaption, int iEditType, PVOID pData, - int iRangeMin = -1, int iRangeMax = -1, const char * pszHelp = NULL); - void SetItemChoices(int iItem, CStringArray * pChoices, - int iDefaultChoice = 0); - void GetItemText(int iItem, char *pszText); - void CreateEditControl(); - void CreateComboControl(); - void DestroyControls(); - - CArray Items; - unsigned nItems; - -// Operations -public: - BOOL bActivateOnRelease; - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CListBoxEx) - public: - virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct); - virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); - virtual int CompareItem(LPCOMPAREITEMSTRUCT lpCompareItemStruct); - //}}AFX_VIRTUAL - -// Implementation -public: - virtual ~CListBoxEx(); - - // Generated message map functions -protected: - //{{AFX_MSG(CListBoxEx) - afx_msg void OnLButtonDown(UINT nFlags, CPoint point); - afx_msg void OnSelchange(); - afx_msg void OnLButtonUp(UINT nFlags, CPoint point); - afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags); - //}}AFX_MSG - - DECLARE_MESSAGE_MAP() -}; - -///////////////////////////////////////////////////////////////////////////// - -#endif // _LISTBOXEX_H diff --git a/hammer/manifestdialog.cpp b/hammer/manifestdialog.cpp index 08f1064d0..60b707b68 100644 --- a/hammer/manifestdialog.cpp +++ b/hammer/manifestdialog.cpp @@ -14,14 +14,14 @@ // CManifestMove dialog -IMPLEMENT_DYNAMIC(CManifestMove, CDialog) +IMPLEMENT_DYNAMIC(CManifestMove, CBaseDlg) //----------------------------------------------------------------------------- // Purpose: contructor // Input : pParent - the parent window of this dialog //----------------------------------------------------------------------------- CManifestMove::CManifestMove( bool bIsMove, CWnd* pParent /*=NULL*/ ) - : CDialog(CManifestMove::IDD, pParent) + : CBaseDlg(CManifestMove::IDD, pParent) { m_bIsMove = bIsMove; } @@ -49,7 +49,7 @@ void CManifestMove::DoDataExchange(CDataExchange* pDX) } -BEGIN_MESSAGE_MAP(CManifestMove, CDialog) +BEGIN_MESSAGE_MAP(CManifestMove, CBaseDlg) ON_EN_CHANGE(IDC_MANIFEST_FILENAME, &CManifestMove::OnEnChangeManifestFilename) END_MESSAGE_MAP() @@ -904,7 +904,7 @@ void CManifestFilter::OnSize(UINT nType, int cx, int cy) } -IMPLEMENT_DYNAMIC(CManifestMapDlg, CDialog) +IMPLEMENT_DYNAMIC(CManifestMapDlg, CBaseDlg) //----------------------------------------------------------------------------- @@ -913,7 +913,7 @@ IMPLEMENT_DYNAMIC(CManifestMapDlg, CDialog) // pParent - the parent window //----------------------------------------------------------------------------- CManifestMapDlg::CManifestMapDlg( CManifestMap *pManifestMap, CWnd* pParent /*=NULL*/ ) - : CDialog(CManifestMapDlg::IDD, pParent) + : CBaseDlg(CManifestMapDlg::IDD, pParent) { m_pManifestMap = pManifestMap; } @@ -938,7 +938,7 @@ void CManifestMapDlg::DoDataExchange(CDataExchange* pDX) } -BEGIN_MESSAGE_MAP(CManifestMapDlg, CDialog) +BEGIN_MESSAGE_MAP(CManifestMapDlg, CBaseDlg) END_MESSAGE_MAP() @@ -970,7 +970,7 @@ void CManifestMapDlg::OnOK() // CManifestCheckin dialog -IMPLEMENT_DYNAMIC(CManifestCheckin, CDialog) +IMPLEMENT_DYNAMIC(CManifestCheckin, CBaseDlg) //----------------------------------------------------------------------------- // Purpose: @@ -978,7 +978,7 @@ IMPLEMENT_DYNAMIC(CManifestCheckin, CDialog) // Output : //----------------------------------------------------------------------------- CManifestCheckin::CManifestCheckin(CWnd* pParent /*=NULL*/) - : CDialog(CManifestCheckin::IDD, pParent) + : CBaseDlg(CManifestCheckin::IDD, pParent) { } @@ -1007,7 +1007,7 @@ void CManifestCheckin::DoDataExchange(CDataExchange* pDX) } -BEGIN_MESSAGE_MAP(CManifestCheckin, CDialog) +BEGIN_MESSAGE_MAP(CManifestCheckin, CBaseDlg) ON_BN_CLICKED(IDOK, &CManifestCheckin::OnBnClickedOk) END_MESSAGE_MAP() diff --git a/hammer/manifestdialog.h b/hammer/manifestdialog.h index 7629a960b..73a5d7784 100644 --- a/hammer/manifestdialog.h +++ b/hammer/manifestdialog.h @@ -9,15 +9,16 @@ #define MANIFESTDIALOG_H #pragma once -#include "afxcmn.h" -#include "afxwin.h" +#include "windows/base_dlg.h" +#include +#include #include "HammerBar.h" class CManifestMap; // CManifestMove dialog -class CManifestMove : public CDialog +class CManifestMove : public CBaseDlg { DECLARE_DYNAMIC(CManifestMove) @@ -125,7 +126,7 @@ class CManifestFilter : public CHammerBar // CManifestMapDlg dialog -class CManifestMapDlg : public CDialog +class CManifestMapDlg : public CBaseDlg { DECLARE_DYNAMIC(CManifestMapDlg) @@ -156,7 +157,7 @@ class CManifestMapDlg : public CDialog // CManifestCheckin dialog -class CManifestCheckin : public CDialog +class CManifestCheckin : public CBaseDlg { DECLARE_DYNAMIC(CManifestCheckin) diff --git a/hammer/mapcheckdlg.cpp b/hammer/mapcheckdlg.cpp index 692d6b271..a57c9ce07 100644 --- a/hammer/mapcheckdlg.cpp +++ b/hammer/mapcheckdlg.cpp @@ -128,7 +128,7 @@ static void FixOverlayFaceList(MapError *pError); CMapCheckDlg *s_pDlg = NULL; -BEGIN_MESSAGE_MAP(CMapCheckDlg, CDialog) +BEGIN_MESSAGE_MAP(CMapCheckDlg, CBaseDlg) //{{AFX_MSG_MAP(CMapCheckDlg) ON_BN_CLICKED(IDC_GO, OnGo) ON_LBN_SELCHANGE(IDC_ERRORS, OnSelchangeErrors) @@ -176,7 +176,7 @@ void CMapCheckDlg::CheckForProblems(CWnd *pwndParent) // Input : pParent - //----------------------------------------------------------------------------- CMapCheckDlg::CMapCheckDlg(CWnd *pParent) - : CDialog(CMapCheckDlg::IDD, pParent) + : CBaseDlg(CMapCheckDlg::IDD, pParent) { //{{AFX_DATA_INIT(CMapCheckDlg) m_bCheckVisible = FALSE; diff --git a/hammer/mapcheckdlg.h b/hammer/mapcheckdlg.h index 43f4d5f7f..efc903a26 100644 --- a/hammer/mapcheckdlg.h +++ b/hammer/mapcheckdlg.h @@ -17,7 +17,7 @@ struct MapError; class CMapClass; -class CMapCheckDlg : public CDialog +class CMapCheckDlg : public CBaseDlg { public: diff --git a/hammer/maperrorsdlg.cpp b/hammer/maperrorsdlg.cpp index bad8e8639..bd8b68c0a 100644 --- a/hammer/maperrorsdlg.cpp +++ b/hammer/maperrorsdlg.cpp @@ -21,7 +21,7 @@ CMapErrorsDlg::CMapErrorsDlg(CWnd* pParent /*=NULL*/) - : CDialog(CMapErrorsDlg::IDD, pParent) + : CBaseDlg(CMapErrorsDlg::IDD, pParent) { //{{AFX_DATA_INIT(CMapErrorsDlg) // NOTE: the ClassWizard will add member initialization here @@ -38,7 +38,7 @@ void CMapErrorsDlg::DoDataExchange(CDataExchange* pDX) } -BEGIN_MESSAGE_MAP(CMapErrorsDlg, CDialog) +BEGIN_MESSAGE_MAP(CMapErrorsDlg, CBaseDlg) //{{AFX_MSG_MAP(CMapErrorsDlg) ON_BN_CLICKED(IDC_CLEAR, OnClear) ON_LBN_DBLCLK(IDC_ERRORS, OnDblclkErrors) diff --git a/hammer/maperrorsdlg.h b/hammer/maperrorsdlg.h index f7f9b7a99..0088c4cff 100644 --- a/hammer/maperrorsdlg.h +++ b/hammer/maperrorsdlg.h @@ -8,10 +8,12 @@ // MapErrorsDlg.h : header file // +#include "windows/base_dlg.h" + ///////////////////////////////////////////////////////////////////////////// // CMapErrorsDlg dialog -class CMapErrorsDlg : public CDialog +class CMapErrorsDlg : public CBaseDlg { // Construction public: diff --git a/hammer/mapinfodlg.cpp b/hammer/mapinfodlg.cpp index e5cec71f4..27294b53d 100644 --- a/hammer/mapinfodlg.cpp +++ b/hammer/mapinfodlg.cpp @@ -20,7 +20,7 @@ static BOOL CountObject(CMapClass *pobj); -BEGIN_MESSAGE_MAP(CMapInfoDlg, CDialog) +BEGIN_MESSAGE_MAP(CMapInfoDlg, CBaseDlg) //{{AFX_MSG_MAP(CMapInfoDlg) //}}AFX_MSG_MAP END_MESSAGE_MAP() diff --git a/hammer/mapinfodlg.h b/hammer/mapinfodlg.h index 35f4cd09f..259626989 100644 --- a/hammer/mapinfodlg.h +++ b/hammer/mapinfodlg.h @@ -15,8 +15,9 @@ #define MAPINFODLG_H #pragma once +#include "windows/base_dlg.h" -class CMapInfoDlg : public CDialog +class CMapInfoDlg : public CBaseDlg { // Construction public: diff --git a/hammer/materialdlg.cpp b/hammer/materialdlg.cpp index fac2c2d46..3dbca4e8a 100644 --- a/hammer/materialdlg.cpp +++ b/hammer/materialdlg.cpp @@ -16,7 +16,7 @@ // // Face Smoothing Dialog Functions // -BEGIN_MESSAGE_MAP( CFaceSmoothingDlg, CDialog ) +BEGIN_MESSAGE_MAP( CFaceSmoothingDlg, CBaseDlg ) //{{AFX_MSG_MAP(CFaceSmoothingDlg) ON_COMMAND_EX( ID_SMOOTHING_GROUP_1, OnButtonGroup ) ON_COMMAND_EX( ID_SMOOTHING_GROUP_2, OnButtonGroup ) @@ -59,7 +59,7 @@ END_MESSAGE_MAP() //----------------------------------------------------------------------------- // Purpose: Constructor //----------------------------------------------------------------------------- -CFaceSmoothingDlg::CFaceSmoothingDlg( CWnd *pParent ) : CDialog( CFaceSmoothingDlg::IDD, pParent ) +CFaceSmoothingDlg::CFaceSmoothingDlg( CWnd *pParent ) : CBaseDlg( CFaceSmoothingDlg::IDD, pParent ) { InitButtonIDs(); } @@ -312,7 +312,7 @@ void CFaceSmoothingDlg::CheckGroupButtons( int *pGroupCounts, int nFaceCount ) //============================================================================= -BEGIN_MESSAGE_MAP( CFaceSmoothingVisualDlg, CDialog ) +BEGIN_MESSAGE_MAP( CFaceSmoothingVisualDlg, CBaseDlg ) //{{AFX_MSG_MAP(CFaceSmoothingVisualDlg) ON_COMMAND_EX( ID_SG_VISUAL_1, OnButtonGroup ) ON_COMMAND_EX( ID_SG_VISUAL_2, OnButtonGroup ) @@ -352,7 +352,7 @@ END_MESSAGE_MAP() //----------------------------------------------------------------------------- // Purpose: Constructor //----------------------------------------------------------------------------- -CFaceSmoothingVisualDlg::CFaceSmoothingVisualDlg( CWnd *pParent ) : CDialog( CFaceSmoothingDlg::IDD, pParent ) +CFaceSmoothingVisualDlg::CFaceSmoothingVisualDlg( CWnd *pParent ) : CBaseDlg( CFaceSmoothingDlg::IDD, pParent ) { InitButtonIDs(); } diff --git a/hammer/materialdlg.h b/hammer/materialdlg.h index 1a67a6e1d..504693541 100644 --- a/hammer/materialdlg.h +++ b/hammer/materialdlg.h @@ -8,6 +8,7 @@ #define MATERIALDLG_H #pragma once +#include "windows/base_dlg.h" #include "resource.h" #include "smoothinggroupmgr.h" @@ -15,7 +16,7 @@ // // Face Smoothing Group Dialog // -class CFaceSmoothingDlg : public CDialog +class CFaceSmoothingDlg : public CBaseDlg { public: @@ -70,7 +71,7 @@ class CFaceSmoothingDlg : public CDialog // // Face Smoothing Group Visual Dialog // -class CFaceSmoothingVisualDlg : public CDialog +class CFaceSmoothingVisualDlg : public CBaseDlg { public: diff --git a/hammer/newdoctype.cpp b/hammer/newdoctype.cpp index 6116c013a..ff87d7679 100644 --- a/hammer/newdoctype.cpp +++ b/hammer/newdoctype.cpp @@ -20,7 +20,7 @@ CNewDocType::CNewDocType(CWnd* pParent /*=NULL*/) - : CDialog(CNewDocType::IDD, pParent) + : CBaseDlg(CNewDocType::IDD, pParent) { //{{AFX_DATA_INIT(CNewDocType) m_iNewType = -1; @@ -37,7 +37,7 @@ void CNewDocType::DoDataExchange(CDataExchange* pDX) } -BEGIN_MESSAGE_MAP(CNewDocType, CDialog) +BEGIN_MESSAGE_MAP(CNewDocType, CBaseDlg) //{{AFX_MSG_MAP(CNewDocType) // NOTE: the ClassWizard will add message map macros here //}}AFX_MSG_MAP diff --git a/hammer/newdoctype.h b/hammer/newdoctype.h index 4b877f151..41216d19f 100644 --- a/hammer/newdoctype.h +++ b/hammer/newdoctype.h @@ -14,10 +14,12 @@ // NewDocType.h : header file // +#include "windows/base_dlg.h" + ///////////////////////////////////////////////////////////////////////////// // CNewDocType dialog -class CNewDocType : public CDialog +class CNewDocType : public CBaseDlg { // Construction public: diff --git a/hammer/newkeyvalue.cpp b/hammer/newkeyvalue.cpp index 5b37c4e76..e28736669 100644 --- a/hammer/newkeyvalue.cpp +++ b/hammer/newkeyvalue.cpp @@ -20,7 +20,7 @@ CNewKeyValue::CNewKeyValue(CWnd* pParent /*=NULL*/) - : CDialog(CNewKeyValue::IDD, pParent) + : CBaseDlg(CNewKeyValue::IDD, pParent) { //{{AFX_DATA_INIT(CNewKeyValue) m_Key = _T(""); @@ -41,7 +41,7 @@ void CNewKeyValue::DoDataExchange(CDataExchange* pDX) } -BEGIN_MESSAGE_MAP(CNewKeyValue, CDialog) +BEGIN_MESSAGE_MAP(CNewKeyValue, CBaseDlg) //{{AFX_MSG_MAP(CNewKeyValue) // NOTE: the ClassWizard will add message map macros here //}}AFX_MSG_MAP diff --git a/hammer/newkeyvalue.h b/hammer/newkeyvalue.h index a470e579a..a4c4c1f78 100644 --- a/hammer/newkeyvalue.h +++ b/hammer/newkeyvalue.h @@ -8,10 +8,12 @@ // NewKeyValue.h : header file // +#include "windows/base_dlg.h" + ///////////////////////////////////////////////////////////////////////////// // CNewKeyValue dialog -class CNewKeyValue : public CDialog +class CNewKeyValue : public CBaseDlg { // Construction public: diff --git a/hammer/noise.cpp b/hammer/noise.cpp index 538eb38b0..82cb4936d 100644 --- a/hammer/noise.cpp +++ b/hammer/noise.cpp @@ -9,7 +9,7 @@ #include #define OCTAVE_COUNT 4 -#define OCTAVE_COUNT_MINUS_ONE OCTAVE_COUNT - 1 +#define OCTAVE_COUNT_MINUS_ONE (OCTAVE_COUNT - 1) //----------------------------------------------------------------------------- // quick random number generator - returns a value -1.0f to 1.0 diff --git a/hammer/op_entity.h b/hammer/op_entity.h index e8db2db21..e45e1141e 100644 --- a/hammer/op_entity.h +++ b/hammer/op_entity.h @@ -12,7 +12,6 @@ #include "AutoSelCombo.h" #include "ChunkFile.h" -#include "ListBoxEx.h" #include "AngleBox.h" #include "fgdlib/WCKeyValues.h" #include "MapFace.h" diff --git a/hammer/pastespecialdlg.cpp b/hammer/pastespecialdlg.cpp index ae1a41e3f..63f683760 100644 --- a/hammer/pastespecialdlg.cpp +++ b/hammer/pastespecialdlg.cpp @@ -8,7 +8,6 @@ #include "hammer.h" #include "PasteSpecialDlg.h" -#pragma warning(disable:4244) // memdbgon must be the last include file in a .cpp file!!! #include @@ -18,7 +17,7 @@ static LPCTSTR pszIni = "Paste Special"; CPasteSpecialDlg::CPasteSpecialDlg(CWnd* pParent /*=NULL*/, BoundBox* pBox) - : CDialog(CPasteSpecialDlg::IDD, pParent) + : CBaseDlg(CPasteSpecialDlg::IDD, pParent) { //{{AFX_DATA_INIT(CPasteSpecialDlg) m_iCopies = 1; @@ -117,7 +116,7 @@ void CPasteSpecialDlg::DoDataExchange(CDataExchange* pDX) } -BEGIN_MESSAGE_MAP(CPasteSpecialDlg, CDialog) +BEGIN_MESSAGE_MAP(CPasteSpecialDlg, CBaseDlg) //{{AFX_MSG_MAP(CPasteSpecialDlg) ON_BN_CLICKED(IDC_GETOFFSETX, OnGetoffsetx) ON_BN_CLICKED(IDC_GETOFFSETY, OnGetoffsety) diff --git a/hammer/pastespecialdlg.h b/hammer/pastespecialdlg.h index cda8e8ca5..4e049747a 100644 --- a/hammer/pastespecialdlg.h +++ b/hammer/pastespecialdlg.h @@ -4,9 +4,10 @@ // //============================================================================= +#include "windows/base_dlg.h" #include "BoundBox.h" -class CPasteSpecialDlg : public CDialog +class CPasteSpecialDlg : public CBaseDlg { // Construction public: diff --git a/hammer/prefabsdlg.cpp b/hammer/prefabsdlg.cpp index 95ad7412c..5d87f4874 100644 --- a/hammer/prefabsdlg.cpp +++ b/hammer/prefabsdlg.cpp @@ -23,7 +23,7 @@ // CPrefabsDlg dialog CPrefabsDlg::CPrefabsDlg(CWnd* pParent /*=NULL*/) - : CDialog(CPrefabsDlg::IDD, pParent) + : CBaseDlg(CPrefabsDlg::IDD, pParent) { //{{AFX_DATA_INIT(CPrefabsDlg) // NOTE: the ClassWizard will add member initialization here @@ -43,7 +43,7 @@ void CPrefabsDlg::DoDataExchange(CDataExchange* pDX) } -BEGIN_MESSAGE_MAP(CPrefabsDlg, CDialog) +BEGIN_MESSAGE_MAP(CPrefabsDlg, CBaseDlg) //{{AFX_MSG_MAP(CPrefabsDlg) ON_BN_CLICKED(IDC_ADDLIBRARY, OnAddlibrary) ON_BN_CLICKED(IDC_ADDOBJECT, OnAddobject) diff --git a/hammer/prefabsdlg.h b/hammer/prefabsdlg.h index 518fff4d5..ce02a69fb 100644 --- a/hammer/prefabsdlg.h +++ b/hammer/prefabsdlg.h @@ -11,9 +11,10 @@ ///////////////////////////////////////////////////////////////////////////// // CPrefabsDlg dialog +#include "windows/base_dlg.h" #include "Prefabs.h" -class CPrefabsDlg : public CDialog +class CPrefabsDlg : public CBaseDlg { // Construction public: diff --git a/hammer/progdlg.cpp b/hammer/progdlg.cpp index 525d5b65c..83b63e9d1 100644 --- a/hammer/progdlg.cpp +++ b/hammer/progdlg.cpp @@ -84,7 +84,7 @@ void CProgressDlg::DoDataExchange(CDataExchange* pDX) //}}AFX_DATA_MAP } -BEGIN_MESSAGE_MAP(CProgressDlg, CDialog) +BEGIN_MESSAGE_MAP(CProgressDlg, CBaseDlg) //{{AFX_MSG_MAP(CProgressDlg) //}}AFX_MSG_MAP END_MESSAGE_MAP() diff --git a/hammer/progdlg.h b/hammer/progdlg.h index 67e9fa5ac..4f5e79975 100644 --- a/hammer/progdlg.h +++ b/hammer/progdlg.h @@ -15,6 +15,7 @@ #define __PROGDLG_H__ #include "resource.h" +#include "windows/base_dlg.h" class CProgressDlg : public CBaseDlg { diff --git a/hammer/replacetexdlg.cpp b/hammer/replacetexdlg.cpp index e6d6c2e83..0941b82ce 100644 --- a/hammer/replacetexdlg.cpp +++ b/hammer/replacetexdlg.cpp @@ -26,7 +26,7 @@ CReplaceTexDlg::CReplaceTexDlg(int nSelected, CWnd* pParent /*=NULL*/) - : CDialog(CReplaceTexDlg::IDD, pParent) + : CBaseDlg(CReplaceTexDlg::IDD, pParent) { //{{AFX_DATA_INIT(CReplaceTexDlg) m_iSearchAll = nSelected ? FALSE : TRUE; @@ -61,7 +61,7 @@ void CReplaceTexDlg::DoDataExchange(CDataExchange* pDX) } -BEGIN_MESSAGE_MAP(CReplaceTexDlg, CDialog) +BEGIN_MESSAGE_MAP(CReplaceTexDlg, CBaseDlg) //{{AFX_MSG_MAP(CReplaceTexDlg) ON_BN_CLICKED(IDC_BROWSEREPLACE, OnBrowsereplace) ON_BN_CLICKED(IDC_BROWSEFIND, OnBrowsefind) diff --git a/hammer/replacetexdlg.h b/hammer/replacetexdlg.h index 75a062a5e..07fecd783 100644 --- a/hammer/replacetexdlg.h +++ b/hammer/replacetexdlg.h @@ -11,13 +11,13 @@ #pragma once #endif - +#include "windows/base_dlg.h" #include "resource.h" #include "IEditorTexture.h" #include "wndTex.h" -class CReplaceTexDlg : public CDialog +class CReplaceTexDlg : public CBaseDlg { // Construction public: diff --git a/hammer/runmap.cpp b/hammer/runmap.cpp index 7d2f9a23c..36c4106bd 100644 --- a/hammer/runmap.cpp +++ b/hammer/runmap.cpp @@ -17,7 +17,7 @@ static LPCTSTR pszSection = "Run Map"; CRunMap::CRunMap(const CString& mapName, CWnd* pParent /*=NULL*/) - : CDialog(CRunMap::IDD, pParent) + : CBaseDlg(CRunMap::IDD, pParent) { m_strMapName = mapName; m_bSwitchMode = FALSE; @@ -69,7 +69,7 @@ void CRunMap::SaveToIni(void) } -BEGIN_MESSAGE_MAP(CRunMap, CDialog) +BEGIN_MESSAGE_MAP(CRunMap, CBaseDlg) //{{AFX_MSG_MAP(CRunMap) ON_BN_CLICKED(IDC_EXPERT, OnExpert) //}}AFX_MSG_MAP diff --git a/hammer/runmap.h b/hammer/runmap.h index c1cc81aaa..292624349 100644 --- a/hammer/runmap.h +++ b/hammer/runmap.h @@ -5,7 +5,9 @@ //=============================================================================// #include "resource.h" +#include "windows/base_dlg.h" +class CRunMap : public CBaseDlg { // Construction public: diff --git a/hammer/runmapcfgdlg.cpp b/hammer/runmapcfgdlg.cpp index 881ecc4ce..2efa19c2c 100644 --- a/hammer/runmapcfgdlg.cpp +++ b/hammer/runmapcfgdlg.cpp @@ -21,7 +21,7 @@ CRunMapCfgDlg::CRunMapCfgDlg(CWnd* pParent /*=NULL*/) - : CDialog(CRunMapCfgDlg::IDD, pParent) + : CBaseDlg(CRunMapCfgDlg::IDD, pParent) { //{{AFX_DATA_INIT(CRunMapCfgDlg) // NOTE: the ClassWizard will add member initialization here @@ -40,7 +40,7 @@ void CRunMapCfgDlg::DoDataExchange(CDataExchange* pDX) } -BEGIN_MESSAGE_MAP(CRunMapCfgDlg, CDialog) +BEGIN_MESSAGE_MAP(CRunMapCfgDlg, CBaseDlg) //{{AFX_MSG_MAP(CRunMapCfgDlg) ON_BN_CLICKED(IDC_NEW, OnNew) ON_BN_CLICKED(IDC_REMOVE, OnRemove) diff --git a/hammer/runmapcfgdlg.h b/hammer/runmapcfgdlg.h index e5b2f98a0..56b84cd41 100644 --- a/hammer/runmapcfgdlg.h +++ b/hammer/runmapcfgdlg.h @@ -8,12 +8,13 @@ // RunMapCfgDlg.h : header file // +#include "windows/base_dlg.h" #include "resource.h" ///////////////////////////////////////////////////////////////////////////// // CRunMapCfgDlg dialog -class CRunMapCfgDlg : public CDialog +class CRunMapCfgDlg : public CBaseDlg { // Construction public: diff --git a/hammer/runmapexpertdlg.cpp b/hammer/runmapexpertdlg.cpp index e1f33d935..97a02e9cd 100644 --- a/hammer/runmapexpertdlg.cpp +++ b/hammer/runmapexpertdlg.cpp @@ -20,7 +20,7 @@ // CRunMapExpertDlg dialog CRunMapExpertDlg::CRunMapExpertDlg(const CString& mapName, CWnd* pParent /*=NULL*/) - : CDialog(CRunMapExpertDlg::IDD, pParent) + : CBaseDlg(CRunMapExpertDlg::IDD, pParent) { //{{AFX_DATA_INIT(CRunMapExpertDlg) //}}AFX_DATA_INIT @@ -82,7 +82,7 @@ enum }; -BEGIN_MESSAGE_MAP(CRunMapExpertDlg, CDialog) +BEGIN_MESSAGE_MAP(CRunMapExpertDlg, CBaseDlg) //{{AFX_MSG_MAP(CRunMapExpertDlg) ON_BN_CLICKED(IDC_BROWSECOMMAND, OnBrowsecommand) ON_LBN_SELCHANGE(IDC_COMMANDLIST, OnSelchangeCommandlist) diff --git a/hammer/runmapexpertdlg.h b/hammer/runmapexpertdlg.h index 2c53c0baa..d7fcda0bd 100644 --- a/hammer/runmapexpertdlg.h +++ b/hammer/runmapexpertdlg.h @@ -15,6 +15,7 @@ #define RUNMAPEXPERTDLG_H #pragma once +#include "windows/base_dlg.h" #include "RunCommands.h" #include "MyCheckListBox.h" #include "resource.h" @@ -23,7 +24,7 @@ class CCommandSequence; -class CRunMapExpertDlg : public CDialog +class CRunMapExpertDlg : public CBaseDlg { // Construction public: diff --git a/hammer/scaleverticesdlg.cpp b/hammer/scaleverticesdlg.cpp index ed1154097..5491e91c9 100644 --- a/hammer/scaleverticesdlg.cpp +++ b/hammer/scaleverticesdlg.cpp @@ -22,7 +22,7 @@ CScaleVerticesDlg::CScaleVerticesDlg(CWnd* pParent /*=NULL*/) - : CDialog(CScaleVerticesDlg::IDD, pParent) + : CBaseDlg(CScaleVerticesDlg::IDD, pParent) { //{{AFX_DATA_INIT(CScaleVerticesDlg) //}}AFX_DATA_INIT @@ -41,7 +41,7 @@ void CScaleVerticesDlg::DoDataExchange(CDataExchange* pDX) } -BEGIN_MESSAGE_MAP(CScaleVerticesDlg, CDialog) +BEGIN_MESSAGE_MAP(CScaleVerticesDlg, CBaseDlg) //{{AFX_MSG_MAP(CScaleVerticesDlg) ON_EN_CHANGE(IDC_SCALE, OnChangeScale) ON_NOTIFY(UDN_DELTAPOS, IDC_SCALESPIN, OnDeltaposScalespin) diff --git a/hammer/scaleverticesdlg.h b/hammer/scaleverticesdlg.h index a78557182..f8dcf8255 100644 --- a/hammer/scaleverticesdlg.h +++ b/hammer/scaleverticesdlg.h @@ -14,12 +14,13 @@ // ScaleVerticesDlg.h : header file // +#include "windows/base_dlg.h" #include "resource.h" ///////////////////////////////////////////////////////////////////////////// // CScaleVerticesDlg dialog -class CScaleVerticesDlg : public CDialog +class CScaleVerticesDlg : public CBaseDlg { // Construction public: diff --git a/hammer/sculptoptions.cpp b/hammer/sculptoptions.cpp index 357526546..e4b8600cd 100644 --- a/hammer/sculptoptions.cpp +++ b/hammer/sculptoptions.cpp @@ -1030,14 +1030,14 @@ bool CSculptPainter::DoSizing( const Vector2D &vPoint ) // CSculptPushOptions dialog -IMPLEMENT_DYNAMIC(CSculptPushOptions, CDialog) +IMPLEMENT_DYNAMIC(CSculptPushOptions, CBaseDlg) //----------------------------------------------------------------------------- // Purpose: constructor //----------------------------------------------------------------------------- CSculptPushOptions::CSculptPushOptions(CWnd* pParent /*=NULL*/) : - CDialog(CSculptPushOptions::IDD, pParent), + CBaseDlg(CSculptPushOptions::IDD, pParent), CSculptPainter() { m_OffsetMode = OFFSET_MODE_ABSOLUTE; @@ -1145,7 +1145,7 @@ void CSculptPushOptions::DoDataExchange(CDataExchange* pDX) } -BEGIN_MESSAGE_MAP(CSculptPushOptions, CDialog) +BEGIN_MESSAGE_MAP(CSculptPushOptions, CBaseDlg) ON_CBN_SELCHANGE(IDC_IDC_SCULPT_PUSH_OPTION_NORMAL_MODE, &CSculptPushOptions::OnCbnSelchangeIdcSculptPushOptionNormalMode) ON_CBN_SELCHANGE(IDC_SCULPT_PUSH_OPTION_OFFSET_MODE, &CSculptPushOptions::OnCbnSelchangeSculptPushOptionOffsetMode) ON_EN_CHANGE(IDC_SCULPT_PUSH_OPTION_OFFSET_DISTANCE, &CSculptPushOptions::OnEnChangeSculptPushOptionOffsetDistance) @@ -2258,14 +2258,14 @@ void CSculptPushOptions::OnEnKillfocusSculptPushOptionFalloffFinal() // CSculptCarveOptions dialog -IMPLEMENT_DYNAMIC(CSculptCarveOptions, CDialog) +IMPLEMENT_DYNAMIC(CSculptCarveOptions, CBaseDlg) //----------------------------------------------------------------------------- // Purpose: constructor //----------------------------------------------------------------------------- CSculptCarveOptions::CSculptCarveOptions(CWnd* pParent /*=NULL*/) : - CDialog(CSculptCarveOptions::IDD, pParent), + CBaseDlg(CSculptCarveOptions::IDD, pParent), CSculptPainter() { m_OffsetMode = OFFSET_MODE_ABSOLUTE; @@ -2371,7 +2371,7 @@ void CSculptCarveOptions::DoDataExchange(CDataExchange* pDX) } -BEGIN_MESSAGE_MAP(CSculptCarveOptions, CDialog) +BEGIN_MESSAGE_MAP(CSculptCarveOptions, CBaseDlg) ON_CBN_SELCHANGE(IDC_IDC_SCULPT_PUSH_OPTION_NORMAL_MODE, &CSculptCarveOptions::OnCbnSelchangeIdcSculptPushOptionNormalMode) ON_CBN_SELCHANGE(IDC_SCULPT_PUSH_OPTION_OFFSET_MODE, &CSculptCarveOptions::OnCbnSelchangeSculptPushOptionOffsetMode) ON_EN_CHANGE(IDC_SCULPT_PUSH_OPTION_OFFSET_DISTANCE, &CSculptCarveOptions::OnEnChangeSculptPushOptionOffsetDistance) @@ -3513,10 +3513,10 @@ class CSculptRegenerator : public ITextureRegenerator // CSculptProjectOptions dialog -IMPLEMENT_DYNAMIC(CSculptProjectOptions, CDialog) +IMPLEMENT_DYNAMIC(CSculptProjectOptions, CBaseDlg) CSculptProjectOptions::CSculptProjectOptions(CWnd* pParent /*=NULL*/) : - CDialog(CSculptProjectOptions::IDD, pParent), + CBaseDlg(CSculptProjectOptions::IDD, pParent), CSculptTool() { m_FileDialog = new CFileDialog(TRUE, NULL, NULL, OFN_LONGNAMES | OFN_NOCHANGEDIR | OFN_FILEMUSTEXIST, "Image Files (*.tga)|*.tga||"); @@ -3571,7 +3571,7 @@ void CSculptProjectOptions::DoDataExchange(CDataExchange* pDX) } -BEGIN_MESSAGE_MAP(CSculptProjectOptions, CDialog) +BEGIN_MESSAGE_MAP(CSculptProjectOptions, CBaseDlg) ON_BN_CLICKED(IDC_LOAD_IMAGE, &CSculptProjectOptions::OnBnClickedLoadImage) ON_NOTIFY(NM_CUSTOMDRAW, IDC_PROJECT_SIZE, &CSculptProjectOptions::OnNMCustomdrawProjectSize) END_MESSAGE_MAP() diff --git a/hammer/sculptoptions.h b/hammer/sculptoptions.h index 2c7a994f4..1a0ec7966 100644 --- a/hammer/sculptoptions.h +++ b/hammer/sculptoptions.h @@ -13,6 +13,7 @@ #include "disppaint.h" #include "tier1/utlmap.h" #include "resource.h" +#include "windows/base_dlg.h" #include @@ -117,7 +118,7 @@ class CSculptPainter : public CSculptTool float m_OrigBrushSize; }; -class CSculptPushOptions : public CDialog, public CSculptPainter +class CSculptPushOptions : public CBaseDlg, public CSculptPainter { DECLARE_DYNAMIC(CSculptPushOptions) @@ -204,7 +205,7 @@ class CSculptPushOptions : public CDialog, public CSculptPainter }; -class CSculptCarveOptions : public CDialog, public CSculptPainter +class CSculptCarveOptions : public CBaseDlg, public CSculptPainter { DECLARE_DYNAMIC(CSculptCarveOptions) @@ -316,7 +317,7 @@ class ITextureInternal; // CSculptProjectOptions dialog -class CSculptProjectOptions : public CDialog, public CSculptTool +class CSculptProjectOptions : public CBaseDlg, public CSculptTool { DECLARE_DYNAMIC(CSculptProjectOptions) diff --git a/hammer/selectentitydlg.cpp b/hammer/selectentitydlg.cpp index c62efb3f3..6594bc207 100644 --- a/hammer/selectentitydlg.cpp +++ b/hammer/selectentitydlg.cpp @@ -8,7 +8,6 @@ //=============================================================================// #include "stdafx.h" -#include "hammer.h" #include "SelectEntityDlg.h" #include "hammer.h" #include "GlobalFunctions.h" @@ -21,7 +20,7 @@ CSelectEntityDlg::CSelectEntityDlg(const CMapObjectList *pList, CWnd* pParent /*=NULL*/) - : CDialog(CSelectEntityDlg::IDD, pParent) + : CBaseDlg(CSelectEntityDlg::IDD, pParent) { //{{AFX_DATA_INIT(CSelectEntityDlg) // NOTE: the ClassWizard will add member initialization here @@ -42,7 +41,7 @@ void CSelectEntityDlg::DoDataExchange(CDataExchange* pDX) } -BEGIN_MESSAGE_MAP(CSelectEntityDlg, CDialog) +BEGIN_MESSAGE_MAP(CSelectEntityDlg, CBaseDlg) //{{AFX_MSG_MAP(CSelectEntityDlg) ON_LBN_SELCHANGE(IDC_ENTITIES, OnSelchangeEntities) //}}AFX_MSG_MAP diff --git a/hammer/selectentitydlg.h b/hammer/selectentitydlg.h index 3a2aa43f6..8d07456aa 100644 --- a/hammer/selectentitydlg.h +++ b/hammer/selectentitydlg.h @@ -13,12 +13,12 @@ #pragma once - +#include "windows/base_dlg.h" #include "MapClass.h" // dvs: For CMapObjectList #include "resource.h" -class CSelectEntityDlg : public CDialog +class CSelectEntityDlg : public CBaseDlg { // Construction public: diff --git a/hammer/strdlg.cpp b/hammer/strdlg.cpp index e4913a67d..fb01bd4df 100644 --- a/hammer/strdlg.cpp +++ b/hammer/strdlg.cpp @@ -20,7 +20,7 @@ CStrDlg::CStrDlg(DWORD dwFlags, LPCTSTR pszString, LPCTSTR pszPrompt, LPCTSTR pszTitle) - : CDialog(CStrDlg::IDD, NULL) + : CBaseDlg(CStrDlg::IDD, NULL) { //{{AFX_DATA_INIT(CStrDlg) m_string = _T(""); @@ -47,7 +47,7 @@ void CStrDlg::DoDataExchange(CDataExchange* pDX) //}}AFX_DATA_MAP } -BEGIN_MESSAGE_MAP(CStrDlg, CDialog) +BEGIN_MESSAGE_MAP(CStrDlg, CBaseDlg) //{{AFX_MSG_MAP(CStrDlg) //}}AFX_MSG_MAP END_MESSAGE_MAP() diff --git a/hammer/strdlg.h b/hammer/strdlg.h index 08edaffd1..132894ece 100644 --- a/hammer/strdlg.h +++ b/hammer/strdlg.h @@ -8,12 +8,13 @@ // StrDlg.h : header file // +#include "windows/base_dlg.h" #include "resource.h" ///////////////////////////////////////////////////////////////////////////// // CStrDlg dialog -class CStrDlg : public CDialog +class CStrDlg : public CBaseDlg { // Construction public: diff --git a/hammer/texturebrowser.cpp b/hammer/texturebrowser.cpp index b3ae4cbee..52ea3f7c2 100644 --- a/hammer/texturebrowser.cpp +++ b/hammer/texturebrowser.cpp @@ -33,7 +33,7 @@ int CTextureBrowser::m_nFilterHistory; char CTextureBrowser::m_szLastKeywords[MAX_PATH]; -BEGIN_MESSAGE_MAP(CTextureBrowser, CDialog) +BEGIN_MESSAGE_MAP(CTextureBrowser, CBaseDlg) //{{AFX_MSG_MAP(CTextureBrowser) ON_WM_SIZE() ON_CBN_SELENDOK(IDC_TEXTURESIZE, OnSelendokTexturesize) @@ -64,7 +64,7 @@ END_MESSAGE_MAP() // Input : pParent - //----------------------------------------------------------------------------- CTextureBrowser::CTextureBrowser(CWnd* pParent) - : CDialog(IDD, pParent) + : CBaseDlg(IDD, pParent) { m_szNameFilter[0] = '\0'; szInitialTexture[0] = '\0'; diff --git a/hammer/texturebrowser.h b/hammer/texturebrowser.h index 219f31912..b938a6b60 100644 --- a/hammer/texturebrowser.h +++ b/hammer/texturebrowser.h @@ -9,13 +9,13 @@ #define TEXTUREBROWSER_H #pragma once - +#include "windows/base_dlg.h" #include "resource.h" #include "AutoSelCombo.h" #include "texturewindow.h" -class CTextureBrowser : public CDialog +class CTextureBrowser : public CBaseDlg { public: diff --git a/hammer/torusdlg.h b/hammer/torusdlg.h index 49fd3d7ee..537704507 100644 --- a/hammer/torusdlg.h +++ b/hammer/torusdlg.h @@ -16,14 +16,12 @@ #include "mathlib/vector.h" +#include "windows/base_dlg.h" #include "resource.h" ///////////////////////////////////////////////////////////////////////////// // CTorusDlg dialog - -#define ARC_MAX_POINTS 4096 - -class CTorusDlg : public CDialog +class CTorusDlg : public CBaseDlg { // Construction public: diff --git a/hammer/transformdlg.cpp b/hammer/transformdlg.cpp index f3e7a70f4..2856e7fc0 100644 --- a/hammer/transformdlg.cpp +++ b/hammer/transformdlg.cpp @@ -20,7 +20,7 @@ CTransformDlg::CTransformDlg(CWnd* pParent /*=NULL*/) - : CDialog(CTransformDlg::IDD, pParent) + : CBaseDlg(CTransformDlg::IDD, pParent) { //{{AFX_DATA_INIT(CTransformDlg) m_iMode = -1; @@ -43,7 +43,7 @@ void CTransformDlg::DoDataExchange(CDataExchange* pDX) } -BEGIN_MESSAGE_MAP(CTransformDlg, CDialog) +BEGIN_MESSAGE_MAP(CTransformDlg, CBaseDlg) //{{AFX_MSG_MAP(CTransformDlg) //}}AFX_MSG_MAP END_MESSAGE_MAP() diff --git a/hammer/transformdlg.h b/hammer/transformdlg.h index 723e7b86d..bf2a5e228 100644 --- a/hammer/transformdlg.h +++ b/hammer/transformdlg.h @@ -14,10 +14,12 @@ // TransformDlg.h : header file // +#include "windows/base_dlg.h" + ///////////////////////////////////////////////////////////////////////////// // CTransformDlg dialog -class CTransformDlg : public CDialog +class CTransformDlg : public CBaseDlg { // Construction public: