Skip to content

Show hex values for Block Size #79

@chuckeng-isp

Description

@chuckeng-isp

When working through a file in hex, and an offset in the file appears, you can highlight the range, but the value appears in as a decimal value. So, you have to do the math in your head to convert. Instead, I would like to see both the decimal and hexadecimal values. (like "Block Size: 212 (0xD4)"

I have this coded up, and was going to push a branch and issue a PR, but I don't have perms. Here is the diff:

$ git log --oneline -1
33577c0 Add hex version of block size to make it easier when looking at hex offsets in files.
$ git show 33577c0
commit 33577c0cf91e132997afb307ca07abdbf43ed807
Author: Chuck England crystal_bit@hotmail.com
Date: Wed Sep 27 09:40:45 2017 -0700

Add hex version of block size to make it easier when looking at hex offsets in files.

diff --git a/src/HexEditor.cpp b/src/HexEditor.cpp
index fa1422a..2c24717 100644
--- a/src/HexEditor.cpp
+++ b/src/HexEditor.cpp

@@ -1415,7 +1415,7 @@ void HexEditor::UpdateCursorLocation( bool force ) {
                        }
                else {
                        statusbar->SetStatusText(wxString::Format(_("Selected Block: %" wxLongLongFmtSpec "u -> %" wxLongLongFmtSpec "u"),select->GetStart(),select->GetEnd()), 3);
-                       statusbar->SetStatusText(wxString::Format(_("Block Size: %" wxLongLongFmtSpec "u"), select->GetSize()), 4);
+                       statusbar->SetStatusText(wxString::Format(_("Block Size: %" wxLongLongFmtSpec "u" " (0x%" wxLongLongFmtSpec "X)"), select->GetSize(), select->GetSize()), 4);
                        }
                }
 #endif // wxUSE_STATUSBAR

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions