jovibor / HexCtrl

Fully-featured Hex Control written in C++/MFC.
Other
167 stars 58 forks source link

Extended data interpreter #7

Closed datasynergyuk closed 4 years ago

datasynergyuk commented 4 years ago

Added: Binary, FILETIME, javatime, MS-DOS tiome, Windows SYSTEMTIME, GUID and GUID time

jovibor commented 4 years ago

Overall it seems fine to me, i just have not seen the code for setting/changing the values for the newly added formats. From the user experience perspective it's a bit strange, that you can change some fields and some can't, especially when they are pretty similar.

datasynergyuk commented 4 years ago

I have change the macros to constants. I have partially fixed the data interpreter so it now correct supports change of hex values. Previously it assumed the input was hex (when it could actually be decimal or hex). There is still some inconsistency for the signed values because when displayed as hex they are shown as unsigned. I have added support to change binary and GUID values. There remains more work to do to change the other recently added time values.

jovibor commented 4 years ago

I have partially fixed the data interpreter so it now correct supports change of hex values. Previously it assumed the input was hex (when it could actually be decimal or hex).

This is incorrect. Ability to make input as Hex or Dec should not depend on current view mode. I think it's absolutely logical and convenient. Please revert it.

There is still some inconsistency for the signed values because when displayed as hex they are shown as unsigned.

There's no standard (sprintf) way to convert to signed Hex, only unsigned. I'm aware of that and do think it's not an issue. Hex has always been just a hex, without any signs. And it's arguable which one is more correct.

datasynergyuk commented 4 years ago

Ok. You are correct. In hex mode, there is a 0x prefix displayed. The data is treated as hex if this prefix remains but treated as decimal otherwise. This is more logical. I will change that back. I wasn't very happy with the way that I had to duplicate calls to StrToInt64ExW() for most of the digit types but these was cleaner than multiple nested switch statements.

datasynergyuk commented 4 years ago

Ok. I think initial version of updated data interpreter is complete. An outstanding task is to update the existing timestamp formats to support display/update based upon user locale. That should be quite easy now helper methods are available.

jovibor commented 4 years ago

Merged as of da84be0.