Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show hex values for Block Size #79

Closed
chuckeng-isp opened this issue Sep 27, 2017 · 2 comments · May be fixed by #103
Closed

Show hex values for Block Size #79

chuckeng-isp opened this issue Sep 27, 2017 · 2 comments · May be fixed by #103
Assignees
Milestone

Comments

@chuckeng-isp
Copy link

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 [email protected]
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
@EUA EUA self-assigned this Sep 30, 2017
@EUA EUA added this to the v0.25 milestone Sep 30, 2017
@EUA
Copy link
Owner

EUA commented Sep 30, 2017

Hi,
I got better idea. What about if there are switchable hex/dec notation for every statistics?

If you want hex notation at that bank, clicking it converts dec notation to hex notation for that bank, permanently. Also good option for "selected block" and and "showing page" banks.

@chuckeng-isp
Copy link
Author

That works for me. Note that I was just showing both. And arguably, I could have done for each of the statistics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants