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

A few minor fixes & new property's I added #4

Open
Hogflash opened this issue Jul 5, 2021 · 8 comments
Open

A few minor fixes & new property's I added #4

Hogflash opened this issue Jul 5, 2021 · 8 comments

Comments

@Hogflash
Copy link
Contributor

Hogflash commented Jul 5, 2021

First off, thanks for an excellent control, this is very nicely done & documented! I found the following two bugs which were easily corrected:

  1. verticalScrollBar.LargeChange = MaxVisibleRows; is set before MaxVisibleRows is determined, and thus is zero. I moved this to the UpdateMaxVisibleRowsAndColumns() function, and it appears to work as intended now.

  2. In the function ReadFormattedData() case DataType.FloatingPoint where DataWidth == 8 correctly extracts 8 bytes, but converts them to a single. I think this should be a double.


I also added a few new properties:

  1. DataEndianProperty : This allows specifying big or little endian for the stream. This is implemented using an extension method for the BinaryReader that handles the byte order swaps as needed. I modified the code in the ReadFormattedData to use this property. I also added Big/Little Endian checkbox in the context menu.

  2. AddressDisplayFormatProperty : This configures the address column format allowing various alternate widths and formats, 16, 24, 32, 48 and 64 bit. This just improves readability for the more common small files, if desired. Required a new function GetFormattedAddressText(ulong Addr64) and modification to CalculateAddressColumnCharWidth()


Interestingly, I was able to back-port this to NET Framework 4.0 with minimal issues (mostly namespace changes). This lets me incorporate the control into some older projects! It IS a bit slower, but still performs well.

Now, one more thing I would like to do is programmatically select a block of data based on a start and end address. I'm not seeing any easy way to implement this, do you have any suggestions of how this should be approached?

Thanks, Gary

EDIT:
I WAS able to programmatically select a block; I had accidently specified the same start and end address which results in NO selection! I assume the reason the properties are private is because some validation is desired before externally setting them.

One other item: I added an OnMouseEnter event override that sets the focus to the control. Otherwise, if the control is hosted in a form that can receive focus, the control's keyboard events will be lost and not reconnected once the host takes the focus. Of course, there are other ways to handle this but this works!

@ttrfanatic
Copy link

Hi,

I was wondering if there was a way to easily get your changes to this project? I'm not sure if you had pushed anything up that just wasn't merged or not but based on the dates of the project it does not look like your changes have been incorporated.

Thanks,
Dan

@Hogflash
Copy link
Contributor Author

Hogflash commented Aug 11, 2021 via email

@ttrfanatic
Copy link

ttrfanatic commented Aug 12, 2021 via email

@Hogflash
Copy link
Contributor Author

Hogflash commented Aug 16, 2021 via email

@Hogflash
Copy link
Contributor Author

Hogflash commented Aug 16, 2021 via email

@ttrfanatic
Copy link

ttrfanatic commented Aug 16, 2021 via email

@Hogflash
Copy link
Contributor Author

Hogflash commented Aug 16, 2021 via email

@fjeremic
Copy link
Owner

@Hogflash / @ttrfanatic feel free to submit a PR with your changes. I'm happy to merge them into the repository. Thanks! Also apologies as I somehow had custom notifications on this repo and I wasn't aware of the discussion here.

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

No branches or pull requests

3 participants