From be9b0e6bc5044ad1f2f06b4f202c4ce2aeb0bf07 Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 1 Mar 2018 18:12:16 +1100 Subject: [PATCH] [Debugger] Some clean up of Debugger-RegisterTabs.h header --- .../Debugger/Debugger-RegisterTabs.cpp | 8 +++ .../Debugger/Debugger-RegisterTabs.h | 70 +++++++++++-------- 2 files changed, 47 insertions(+), 31 deletions(-) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-RegisterTabs.cpp b/Source/Project64/UserInterface/Debugger/Debugger-RegisterTabs.cpp index 9353f4bd1..fbe2ad5a0 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-RegisterTabs.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-RegisterTabs.cpp @@ -16,6 +16,14 @@ bool CRegisterTabs::m_bColorsEnabled = false; +CRegisterTabs::CRegisterTabs() +{ +} + +CRegisterTabs::~CRegisterTabs() +{ +} + void CRegisterTabs::Attach(HWND hWndNew) { CTabCtrl::Attach(hWndNew); diff --git a/Source/Project64/UserInterface/Debugger/Debugger-RegisterTabs.h b/Source/Project64/UserInterface/Debugger/Debugger-RegisterTabs.h index 57de3d02d..3370119eb 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-RegisterTabs.h +++ b/Source/Project64/UserInterface/Debugger/Debugger-RegisterTabs.h @@ -34,7 +34,46 @@ class CRegisterTabs : public CTabCtrl, public CDebugSettings { + enum TAB_ID + { + TabDefault, + TabGPR, + TabFPR + }; + +public: + CRegisterTabs(void); + ~CRegisterTabs(); + + void Attach(HWND hWndNew); + HWND Detach(); + + CWindow AddTab(char* caption, int dialogId, DLGPROC dlgProc); + void ShowTab(int nPage); + CRect GetPageRect(); + void RedrawCurrentTab(); + void RefreshEdits(); + void SetColorsEnabled(bool bColorsEnabled); + private: + CRegisterTabs(const CRegisterTabs&); // Disable copy constructor + CRegisterTabs& operator=(const CRegisterTabs&); // Disable assignment + + static void RegisterChanged(HWND hDlg, TAB_ID srcTabId, WPARAM wParam); + + static INT_PTR CALLBACK TabProcDefault(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); + static INT_PTR CALLBACK TabProcGPR(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); + static INT_PTR CALLBACK TabProcFPR(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); + + static void InitRegisterEdit(CWindow& tab, CEditNumber32& edit, WORD ctrlId); + static void InitRegisterEdits(CWindow& tab, CEditNumber32* edits, const WORD* ctrlIds, uint32_t ctrlIdsCount); + static void InitRegisterEdit64(CWindow& tab, CEditReg64& edit, WORD ctrlId); + static void InitRegisterEdits64(CWindow& tab, CEditReg64* edits, const WORD* ctrlIds, uint32_t ctrlIdsCount); + static void ZeroRegisterEdit(CEditNumber32& edit); + static void ZeroRegisterEdits(CEditNumber32* edits, uint32_t ctrlIdsCount); + static void ZeroRegisterEdit64(CEditReg64& edit); + static void ZeroRegisterEdits64(CEditReg64* edits, uint32_t ctrlIdsCount); + typedef union { uint32_t intval; @@ -52,13 +91,6 @@ private: }; } CAUSE; - enum TAB_ID - { - TabDefault, - TabGPR, - TabFPR - }; - static constexpr WORD GPREditIds[] = { IDC_R0_EDIT, IDC_R1_EDIT, IDC_R2_EDIT, IDC_R3_EDIT, @@ -255,28 +287,4 @@ private: CWindow m_DDTab; CEditNumber32 m_DDEdits[sizeof(DDEditIds) / sizeof(DDEditIds[0])]; - static void RegisterChanged(HWND hDlg, TAB_ID srcTabId, WPARAM wParam); - - static INT_PTR CALLBACK TabProcDefault(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); - static INT_PTR CALLBACK TabProcGPR(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); - static INT_PTR CALLBACK TabProcFPR(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); - - static void InitRegisterEdit(CWindow& tab, CEditNumber32& edit, WORD ctrlId); - static void InitRegisterEdits(CWindow& tab, CEditNumber32* edits, const WORD* ctrlIds, uint32_t ctrlIdsCount); - static void InitRegisterEdit64(CWindow& tab, CEditReg64& edit, WORD ctrlId); - static void InitRegisterEdits64(CWindow& tab, CEditReg64* edits, const WORD* ctrlIds, uint32_t ctrlIdsCount); - static void ZeroRegisterEdit(CEditNumber32& edit); - static void ZeroRegisterEdits(CEditNumber32* edits, uint32_t ctrlIdsCount); - static void ZeroRegisterEdit64(CEditReg64& edit); - static void ZeroRegisterEdits64(CEditReg64* edits, uint32_t ctrlIdsCount); - -public: - void Attach(HWND hWndNew); - HWND Detach(); - CWindow AddTab(char* caption, int dialogId, DLGPROC dlgProc); - void ShowTab(int nPage); - CRect GetPageRect(); - void RedrawCurrentTab(); - void RefreshEdits(); - void SetColorsEnabled(bool bColorsEnabled); }; \ No newline at end of file