feat: Added option to change radix of numbers in hex editor view

This commit is contained in:
WerWolv
2024-12-30 21:00:43 +01:00
parent 021206e052
commit 0dc1af0747
2 changed files with 61 additions and 11 deletions

View File

@@ -94,6 +94,7 @@ namespace hex::ui {
void setUnknownDataCharacter(char character) { m_unknownDataCharacter = character; }
private:
enum class CellType : u8 { None, Hex, ASCII };
enum class AddressFormat : u8 { Hexadecimal, Decimal, Octal };
void drawCell(u64 address, u8 *data, size_t size, bool hovered, CellType cellType);
void drawSeparatorLine(u64 address, bool drawVerticalConnector);
@@ -107,6 +108,8 @@ namespace hex::ui {
void handleSelection(u64 address, u32 bytesPerCell, const u8 *data, bool cellHovered);
std::optional<color_t> applySelectionColor(u64 byteAddress, std::optional<color_t> color);
std::string formatAddress(u64 address, u32 width = 2, bool prefix = false) const;
public:
void setSelectionUnchecked(std::optional<u64> start, std::optional<u64> end) {
m_selectionStart = start;
@@ -357,6 +360,7 @@ namespace hex::ui {
u16 m_visibleRowCount = 0;
CellType m_editingCellType = CellType::None;
AddressFormat m_addressFormat = AddressFormat::Hexadecimal;
std::optional<u64> m_editingAddress;
bool m_shouldModifyValue = false;
bool m_enteredEditingMode = false;