RegisterView: Move FormatSpecifier enum into CRegTable

Considering there's a public method in the class using it, leaving the
definition in the cpp file can cause a linker error if any method outside
that cpp file calls it for one reason or another.
This commit is contained in:
Lioncash 2016-09-30 00:16:14 -04:00
parent 74290e873a
commit 3ef6b51848
2 changed files with 22 additions and 18 deletions

View File

@ -36,16 +36,6 @@ enum
IDM_VIEW_INT IDM_VIEW_INT
}; };
enum class FormatSpecifier
{
Hex8,
Hex16,
Float,
Double,
UInt,
Int
};
constexpr const char* special_reg_names[] = {"PC", "LR", "CTR", "CR", "FPSCR", constexpr const char* special_reg_names[] = {"PC", "LR", "CTR", "CR", "FPSCR",
"MSR", "SRR0", "SRR1", "Exceptions", "Int Mask", "MSR", "SRR0", "SRR1", "Exceptions", "Int Mask",
"Int Cause", "DSISR", "DAR", "PT hashmask"}; "Int Cause", "DSISR", "DAR", "PT hashmask"};
@ -541,27 +531,33 @@ void CRegisterView::OnPopupMenu(wxCommandEvent& event)
Refresh(); Refresh();
break; break;
case IDM_VIEW_HEX8: case IDM_VIEW_HEX8:
m_register_table->SetRegisterFormat(m_selectedColumn, m_selectedRow, FormatSpecifier::Hex8); m_register_table->SetRegisterFormat(m_selectedColumn, m_selectedRow,
CRegTable::FormatSpecifier::Hex8);
Refresh(); Refresh();
break; break;
case IDM_VIEW_HEX16: case IDM_VIEW_HEX16:
m_register_table->SetRegisterFormat(m_selectedColumn, m_selectedRow, FormatSpecifier::Hex16); m_register_table->SetRegisterFormat(m_selectedColumn, m_selectedRow,
CRegTable::FormatSpecifier::Hex16);
Refresh(); Refresh();
break; break;
case IDM_VIEW_INT: case IDM_VIEW_INT:
m_register_table->SetRegisterFormat(m_selectedColumn, m_selectedRow, FormatSpecifier::Int); m_register_table->SetRegisterFormat(m_selectedColumn, m_selectedRow,
CRegTable::FormatSpecifier::Int);
Refresh(); Refresh();
break; break;
case IDM_VIEW_UINT: case IDM_VIEW_UINT:
m_register_table->SetRegisterFormat(m_selectedColumn, m_selectedRow, FormatSpecifier::UInt); m_register_table->SetRegisterFormat(m_selectedColumn, m_selectedRow,
CRegTable::FormatSpecifier::UInt);
Refresh(); Refresh();
break; break;
case IDM_VIEW_FLOAT: case IDM_VIEW_FLOAT:
m_register_table->SetRegisterFormat(m_selectedColumn, m_selectedRow, FormatSpecifier::Float); m_register_table->SetRegisterFormat(m_selectedColumn, m_selectedRow,
CRegTable::FormatSpecifier::Float);
Refresh(); Refresh();
break; break;
case IDM_VIEW_DOUBLE: case IDM_VIEW_DOUBLE:
m_register_table->SetRegisterFormat(m_selectedColumn, m_selectedRow, FormatSpecifier::Double); m_register_table->SetRegisterFormat(m_selectedColumn, m_selectedRow,
CRegTable::FormatSpecifier::Double);
Refresh(); Refresh();
break; break;
} }

View File

@ -28,11 +28,19 @@
#define NUM_SPECIALS 14 #define NUM_SPECIALS 14
enum class FormatSpecifier;
class CRegTable : public wxGridTableBase class CRegTable : public wxGridTableBase
{ {
public: public:
enum class FormatSpecifier
{
Hex8,
Hex16,
Float,
Double,
UInt,
Int
};
CRegTable(); CRegTable();
int GetNumberCols() override { return 9; } int GetNumberCols() override { return 9; }
int GetNumberRows() override { return 32 + NUM_SPECIALS; } int GetNumberRows() override { return 32 + NUM_SPECIALS; }