Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add #define BASE_DIALOG_CLASS CDialog to be able to switch to the new… #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions ResizableLib/ResizableDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ CResizableDialog::CResizableDialog()
}

CResizableDialog::CResizableDialog(UINT nIDTemplate, CWnd* pParentWnd)
: CDialog(nIDTemplate, pParentWnd)
: BASE_DIALOG_CLASS(nIDTemplate, pParentWnd)
{
PrivateConstruct();
}

CResizableDialog::CResizableDialog(LPCTSTR lpszTemplateName, CWnd* pParentWnd)
: CDialog(lpszTemplateName, pParentWnd)
: BASE_DIALOG_CLASS(lpszTemplateName, pParentWnd)
{
PrivateConstruct();
}
Expand All @@ -56,7 +56,7 @@ CResizableDialog::~CResizableDialog()
}


BEGIN_MESSAGE_MAP(CResizableDialog, CDialog)
BEGIN_MESSAGE_MAP(CResizableDialog, BASE_DIALOG_CLASS)
//{{AFX_MSG_MAP(CResizableDialog)
ON_WM_GETMINMAXINFO()
ON_WM_SIZE()
Expand All @@ -71,7 +71,7 @@ END_MESSAGE_MAP()

BOOL CResizableDialog::OnNcCreate(LPCREATESTRUCT lpCreateStruct)
{
if (!CDialog::OnNcCreate(lpCreateStruct))
if (!BASE_DIALOG_CLASS::OnNcCreate(lpCreateStruct))
return FALSE;

// child dialogs don't want resizable border or size grip,
Expand Down Expand Up @@ -103,12 +103,12 @@ void CResizableDialog::OnDestroy()
ResetAllRects();
PrivateConstruct();

CDialog::OnDestroy();
BASE_DIALOG_CLASS::OnDestroy();
}

void CResizableDialog::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
BASE_DIALOG_CLASS::OnSize(nType, cx, cy);

if (nType == SIZE_MAXHIDE || nType == SIZE_MAXSHOW)
return; // arrangement not needed
Expand Down Expand Up @@ -145,7 +145,7 @@ BOOL CResizableDialog::OnEraseBkgnd(CDC* pDC)
{
ClipChildren(pDC, FALSE);

BOOL bRet = CDialog::OnEraseBkgnd(pDC);
BOOL bRet = BASE_DIALOG_CLASS::OnEraseBkgnd(pDC);

ClipChildren(pDC, TRUE);

Expand All @@ -155,11 +155,11 @@ BOOL CResizableDialog::OnEraseBkgnd(CDC* pDC)
LRESULT CResizableDialog::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
if (message != WM_NCCALCSIZE || wParam == 0)
return CDialog::WindowProc(message, wParam, lParam);
return BASE_DIALOG_CLASS::WindowProc(message, wParam, lParam);

LRESULT lResult = 0;
HandleNcCalcSize(FALSE, (LPNCCALCSIZE_PARAMS)lParam, lResult);
lResult = CDialog::WindowProc(message, wParam, lParam);
lResult = BASE_DIALOG_CLASS::WindowProc(message, wParam, lParam);
HandleNcCalcSize(TRUE, (LPNCCALCSIZE_PARAMS)lParam, lResult);
return lResult;
}
3 changes: 2 additions & 1 deletion ResizableLib/ResizableDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@
#include "ResizableMinMax.h"
#include "ResizableWndState.h"

#define BASE_DIALOG_CLASS CDialog
/////////////////////////////////////////////////////////////////////////////
// CResizableDialog window

class CResizableDialog : public CDialog, public CResizableLayout,
class CResizableDialog : public BASE_DIALOG_CLASS, public CResizableLayout,
public CResizableGrip, public CResizableMinMax,
public CResizableWndState
{
Expand Down