[Debugger] Some clean up of Debugger-RegisterTabs.h header

This commit is contained in:
zilmar 2018-03-01 18:12:16 +11:00
parent 151c435b97
commit be9b0e6bc5
2 changed files with 47 additions and 31 deletions

View File

@ -16,6 +16,14 @@
bool CRegisterTabs::m_bColorsEnabled = false; bool CRegisterTabs::m_bColorsEnabled = false;
CRegisterTabs::CRegisterTabs()
{
}
CRegisterTabs::~CRegisterTabs()
{
}
void CRegisterTabs::Attach(HWND hWndNew) void CRegisterTabs::Attach(HWND hWndNew)
{ {
CTabCtrl::Attach(hWndNew); CTabCtrl::Attach(hWndNew);

View File

@ -34,7 +34,46 @@ class CRegisterTabs :
public CTabCtrl, public CTabCtrl,
public CDebugSettings 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: 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 typedef union
{ {
uint32_t intval; uint32_t intval;
@ -52,13 +91,6 @@ private:
}; };
} CAUSE; } CAUSE;
enum TAB_ID
{
TabDefault,
TabGPR,
TabFPR
};
static constexpr WORD GPREditIds[] = static constexpr WORD GPREditIds[] =
{ {
IDC_R0_EDIT, IDC_R1_EDIT, IDC_R2_EDIT, IDC_R3_EDIT, IDC_R0_EDIT, IDC_R1_EDIT, IDC_R2_EDIT, IDC_R3_EDIT,
@ -255,28 +287,4 @@ private:
CWindow m_DDTab; CWindow m_DDTab;
CEditNumber32 m_DDEdits[sizeof(DDEditIds) / sizeof(DDEditIds[0])]; 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);
}; };