Introduce common CDialog parent for CAboutDialog and CMainDialog

This commit is contained in:
Anonymous Maarten 2024-02-07 07:21:54 +01:00
parent 0a7e6f51d2
commit ffd23424a6
7 changed files with 59 additions and 20 deletions

View File

@ -444,6 +444,7 @@ if (ISLE_BUILD_CONFIG)
LEGO1/mxdirectx/mxdirect3d.cpp
CONFIG/config.cpp
CONFIG/ConfigCommandLineInfo.cpp
CONFIG/common.cpp
CONFIG/AboutDlg.cpp
CONFIG/MainDlg.cpp
CONFIG/detectdx5.cpp

View File

@ -6,25 +6,14 @@ DECOMP_SIZE_ASSERT(CDialog, 0x60)
DECOMP_SIZE_ASSERT(CAboutDialog, 0x60)
// FUNCTION: CONFIG 0x00403c20
CAboutDialog::CAboutDialog() : CDialog(IDD)
CAboutDialog::CAboutDialog() : CCommonDialog(IDD)
{
}
// FUNCTION: CONFIG 0x00403c90
void CAboutDialog::BeginModalState()
{
::EnableWindow(m_hWnd, FALSE);
}
// FUNCTION: CONFIG 0x00403ca0
void CAboutDialog::EndModalState()
{
::EnableWindow(m_hWnd, TRUE);
}
// FUNCTION: CONFIG 0x00403d20
void CAboutDialog::DoDataExchange(CDataExchange* pDX)
{
}
BEGIN_MESSAGE_MAP(CAboutDialog, CDialog)
END_MESSAGE_MAP()

View File

@ -1,13 +1,15 @@
#if !defined(AFX_ABOUTDLG_H)
#define AFX_ABOUTDLG_H
#include "common.h"
#include "afxwin.h"
#include "compat.h"
#include "res/resource.h"
// VTABLE: CONFIG 0x00406308
// SIZE 0x60
class CAboutDialog : public CDialog {
class CAboutDialog : public CCommonDialog {
public:
CAboutDialog();
// Dialog Data
@ -22,8 +24,6 @@ class CAboutDialog : public CDialog {
protected:
void DoDataExchange(CDataExchange* pDX) override;
void BeginModalState() override;
void EndModalState() override;
//}}AFX_VIRTUAL
// void UpdateInterface();
// void SwitchToAdvanced(BOOL p_advanced);

View File

@ -10,7 +10,7 @@ DECOMP_SIZE_ASSERT(CDialog, 0x60)
DECOMP_SIZE_ASSERT(CMainDialog, 0x70)
// FUNCTION: CONFIG 0x00403d50
CMainDialog::CMainDialog(CWnd* pParent) : CDialog(IDD, pParent)
CMainDialog::CMainDialog(CWnd* pParent) : CCommonDialog(IDD, pParent)
{
afxCurrentWinApp;
m_icon = LoadIconA(AfxFindResourceHandle(MAKEINTRESOURCE(IDI_CONFIG), RT_GROUP_ICON), MAKEINTRESOURCE(IDI_CONFIG));

View File

@ -1,6 +1,8 @@
#if !defined(AFX_MAINDLG_H)
#define AFX_MAINDLG_H
#include "common.h"
#include "afxwin.h"
#include "compat.h"
#include "decomp.h"
@ -8,7 +10,7 @@
// VTABLE: CONFIG 0x004063e0
// SIZE 0x70
class CMainDialog : public CDialog {
class CMainDialog : public CCommonDialog {
public:
CMainDialog(CWnd* pParent);
// Dialog Data
@ -23,8 +25,6 @@ class CMainDialog : public CDialog {
protected:
void DoDataExchange(CDataExchange* pDX) override;
void BeginModalState() override {}
void EndModalState() override {}
//}}AFX_VIRTUAL
void UpdateInterface();
void SwitchToAdvanced(BOOL p_advanced);

26
CONFIG/common.cpp Normal file
View File

@ -0,0 +1,26 @@
#include "common.h"
// FUNCTION: CONFIG 0x00402ca0
void CSerializer::Serialize(CArchive& ar) {
}
// FUNCTION: CONFIG 0x00402cb0
void CSerializer::AssertValid() const {
}
// FUNCTION: CONFIG 0x00402cc0
void CSerializer::Dump(CDumpContext& dc) const {
}
// FUNCTION: CONFIG 0x00403c90
void CCommonDialog::BeginModalState()
{
::EnableWindow(m_hWnd, FALSE);
}
// FUNCTION: CONFIG 0x00403ca0
void CCommonDialog::EndModalState()
{
::EnableWindow(m_hWnd, TRUE);
}

23
CONFIG/common.h Normal file
View File

@ -0,0 +1,23 @@
#ifndef AFX_COMMON_H
#define AFX_COMMON_H
#include <afxwin.h>
#include "compat.h"
class CSerializer {
public:
void Serialize(CArchive& ar);
void AssertValid() const;
void Dump(CDumpContext& dc) const;
};
class CCommonDialog : public CDialog {
public:
CCommonDialog(UINT nIDTemplate, CWnd* pParentWnd = NULL) : CDialog(nIDTemplate, pParentWnd) { }
void BeginModalState() override;
void EndModalState() override;
};
#endif