Skip to content

Commit

Permalink
[hammer] Derive dailog windows from CBaseDialog to add DPI support an…
Browse files Browse the repository at this point in the history
…d main icon
  • Loading branch information
dimhotepus committed Dec 23, 2024
1 parent cf4b4af commit dff7668
Show file tree
Hide file tree
Showing 81 changed files with 193 additions and 714 deletions.
4 changes: 2 additions & 2 deletions hammer/MapDiffDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion hammer/MapDiffDlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

// MapDiffDlg dialog

class CMapDiffDlg : public CDialog
class CMapDiffDlg : public CBaseDlg
{
public:
static void MapDiff(CWnd *pwndParent, CMapDoc *p_CurrentMap);
Expand Down
6 changes: 3 additions & 3 deletions hammer/ModelBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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" );
Expand Down Expand Up @@ -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()
Expand Down
3 changes: 2 additions & 1 deletion hammer/ModelBrowser.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
#pragma once

#include "windows/base_dlg.h"
#include "resource.h"
#include "VGuiWnd.h"

Expand All @@ -17,7 +18,7 @@ class CModelBrowserPanel;
class CMDLPicker;


class CModelBrowser : public CDialog
class CModelBrowser : public CBaseDlg
{
DECLARE_DYNAMIC(CModelBrowser)

Expand Down
4 changes: 2 additions & 2 deletions hammer/NewVisGroupDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;

Expand Down
3 changes: 2 additions & 1 deletion hammer/NewVisGroupDlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions hammer/ScenePreviewDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
#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
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;
Expand Down
3 changes: 2 additions & 1 deletion hammer/ScenePreviewDlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions hammer/SearchReplaceDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -326,7 +326,7 @@ END_MESSAGE_MAP()
// Input : pParent -
//-----------------------------------------------------------------------------
CSearchReplaceDlg::CSearchReplaceDlg(CWnd *pParent)
: CDialog(CSearchReplaceDlg::IDD, pParent)
: CBaseDlg(CSearchReplaceDlg::IDD, pParent)
{
m_bNewSearch = true;

Expand Down
3 changes: 2 additions & 1 deletion hammer/SearchReplaceDlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#pragma once
#endif

#include "windows/base_dlg.h"
#include "resource.h"
#include "utlvector.h"
#include "MapClass.h"
Expand All @@ -28,7 +29,7 @@ enum FindReplaceIn_t
};


class CSearchReplaceDlg : public CDialog
class CSearchReplaceDlg : public CBaseDlg
{
// Construction
public:
Expand Down
4 changes: 2 additions & 2 deletions hammer/SoundBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions hammer/TorusDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions hammer/archdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion hammer/archdlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
20 changes: 10 additions & 10 deletions hammer/dispdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -43,7 +43,7 @@ extern CToolDisplace* GetDisplacementTool();
// Purpose: constructor
//-----------------------------------------------------------------------------
CDispCreateDlg::CDispCreateDlg( CWnd *pParent ) :
CDialog( CDispCreateDlg::IDD, pParent )
CBaseDlg( CDispCreateDlg::IDD, pParent )
{
m_Power = 0;
}
Expand Down Expand Up @@ -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 )
Expand All @@ -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;
}
Expand Down Expand Up @@ -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 )
Expand Down Expand Up @@ -231,7 +231,7 @@ END_MESSAGE_MAP()
// Purpose: constructor
//-----------------------------------------------------------------------------
CDispPaintDistDlg::CDispPaintDistDlg( CWnd *pParent ) :
CDialog( CDispPaintDistDlg::IDD, pParent )
CBaseDlg( CDispPaintDistDlg::IDD, pParent )
{
}

Expand Down Expand Up @@ -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()
Expand All @@ -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;
Expand Down Expand Up @@ -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 )
Expand All @@ -1435,7 +1435,7 @@ END_MESSAGE_MAP()
// Purpose: constructor
//-----------------------------------------------------------------------------
CDispPaintDataDlg::CDispPaintDataDlg( CWnd *pParent ) :
CDialog( CDispPaintDataDlg::IDD, pParent )
CBaseDlg( CDispPaintDataDlg::IDD, pParent )
{
}

Expand Down
11 changes: 6 additions & 5 deletions hammer/dispdlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#define DISPDLG_H
#pragma once

#include "windows/base_dlg.h"
#include "resource.h"
#include "IconComboBox.h"
#include "mathlib/vector.h"
Expand All @@ -18,7 +19,7 @@
//
// Displacement Create Dialog
//
class CDispCreateDlg : public CDialog
class CDispCreateDlg : public CBaseDlg
{
public:

Expand Down Expand Up @@ -50,7 +51,7 @@ class CDispCreateDlg : public CDialog
//
// Displacement Noise Dialog
//
class CDispNoiseDlg : public CDialog
class CDispNoiseDlg : public CBaseDlg
{
public:

Expand Down Expand Up @@ -85,7 +86,7 @@ class CDispNoiseDlg : public CDialog
//
// Displacement Paint Dist Dialog
//
class CDispPaintDistDlg : public CDialog
class CDispPaintDistDlg : public CBaseDlg
{
public:

Expand Down Expand Up @@ -180,7 +181,7 @@ class CSculptPushOptions;
class CSculptCarveOptions;
class CSculptProjectOptions;

class CPaintSculptDlg : public CDialog
class CPaintSculptDlg : public CBaseDlg
{
public:

Expand Down Expand Up @@ -248,7 +249,7 @@ class CPaintSculptDlg : public CDialog
//
// Displacement Paint Dist Dialog
//
class CDispPaintDataDlg : public CDialog
class CDispPaintDataDlg : public CBaseDlg
{
public:

Expand Down
2 changes: 1 addition & 1 deletion hammer/dynamicdialogwnd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Loading

0 comments on commit dff7668

Please sign in to comment.