News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

ShineInHex - hex view/edit control

Started by ramguru, January 14, 2006, 06:33:09 PM

Previous topic - Next topic

ramguru

Here is my hex view/edit control that I made for my bigger project. Source code and test-app are included in attachment...



UPDATE:

  • Fixed clipboard bug
  • Fixed little drawing bug
  • Added char indicator in ASCII view
  • Now complete customization regarding colors (is up to you)
  • Added Find dialog (check right-click menu)
  • Added Selection dialog (check right-click menu)
  • Fixed when last byte could not be selected using mouse (from bottom to up)
  • Added ability to copy bytecode in masm format: db 020h,073h,074h,061h,06eh,064h
  • Added ability to copy bytecode in C format: "\x20\x73\x74\x61\x6e\x64"
  • Added ability to copy bytecode of either selected data or all excluding selected data
[/color]
RECENT UPDATE:

  • Improved boundaries check
  • More dynamic memory allocation in use, which fixes problem with a big screen resolution
  • Changed layout of select / find dialogs to more resemble standard window interface
  • ** All above thanks to Wojciech Stryjewski who made these fixes **
[/color]
FAQ

  • What is selection filling?
    It's when you select a pile of data & try to enter some numbers: meaning if you enter 'A' while '06-98-78-67' is selected, data will change respectively 'A6-A8-A8-A7' enter one more number & you'll have a group of clones, say you entered '7' - you got 'A7-A7-A7-A7'
  • I cannot find "Find Next" in Find dialog?
    Press Find button second time...
  • I cannot select more than I can see on screen?
    Try to use Select dialog for now

New version 27/06/2010 +
ShineInHex documentation Offline is attached below
[/font]

[attachment deleted by admin]

Mincho Georgiev

Hi, Ramguru, it's been a while. I like that. And regards for non-flickering surface :) I've say many times how mutch i hate flickering, welldone.

ramguru

Thanks for feedback, shaka_zulu! I hate flicker more than you :) Thanks to James Brown (http://www.catch22.net/) we can all get rid of it...  :cheekygreen:

zooba

Hey,

Just had a play with the test app. Seems like the hit-testing may be off by a little bit in the ASCII part, the selecting doesn't select the bits I'm clicking on.

Also, can you make it accept lowercase hex letters? It can convert them to uppercase, theres no issue there, but it's easier to type without having to go to the shift key every second character :wink

Good work :U

ramguru

Thanks for reply, zooba.
1. Mouse selection for ASCII part wasn't implemented actually. But you mentioned it, so I've added this feature...
2. ..case with lowercase letters. I've moved input part from WM_KEYDOWN (no difference between lower/uppercase... ) to WM_CHAR and forgot to add some extra code lines...
  I have more code to add, so new upload will be a little later... :wink

ramguru

New upload!
*What's new..
--now you can fill selection with whatever number
--new message that sets offset (instead of 00000000,00000008...)
--fixed lower/uppercase, mouse selection, caret position after resizing
--added VK_UP, VK_DOWN support
*TODO list:
--Figure out why copy to clipboard "works, works not, works, works not, works, works not"..and so on
--Add mouse scrolling (using WM_TIMER) support
--Add some tooltips


Jupiter

hi ramguru
congratulations, very nice control!
I like it's automatic resizing, but some very useful functions are missing:
scrolling with mouse and correct data copy (dunno if it really works).

if you have any internal non-published version with fixes, pls share it.

TIA
EnJoy!

ramguru

Thanks Jupiter,
"Copy Hex" works OK for me, "Copy Text" is supposed to copy ANSI string (that you probably well know is zero terminated), so if you try to copy Unicode string, you'll only get first character. Regarding scrolling using mouse - I know it's a TODO thing. At the moment I'm working on other project, I will only post an update here, when there will be serious changes...yet I don't know when that's going to happen  :wink

Jupiter

hi ramguru

a bug(feature?) found:
* Window is not scrolled _properly_ when using keyboard to scroll selected block
1. Select block of symbols (some rows)
2. Hold arrow down key to move cursor (current selection) down and to scroll block selection
Result:
Block scrolls down and disappears from screen coz in your VK_DOWN handler you don't check selection block length.
I think that the whole selection block must be visible while scrolling, not only first byte.
EnJoy!

ramguru

Thanks again, I haven't noticed that :toothy Yep, VK_DOWN/UP/LEFT/RIGHT should make selection disappear. OK I will make new update as soon as I can (hope not too late), yet I'm thinking of remaking my control so that it can support any font (be patient and report bugs of course  :U new version is coming soon...)

Jupiter

thank you for answer
good luck in finding time for development ;)
EnJoy!

ramguru

Update

Briefly (what's new):

  • got rid of blinking cursor, that caused more trouble than gave benefit
  • added "Page Up/Down" support
  • added scrolling using mouse

Not going to release newer version very soon, unless new bugs would be discovered or new features implemented...

Jupiter

hi ramguru
thank you for update!

scrolling using mouse work ok. any plans to implement WM_MOUSEWHEEL ?

in this release when I scroll with VK_UP | VK_DOWN | VK_PGUP | VK_PGDN, current selection is lost.
what about keeping selection block while scrolling using keyboard?

P.S. you changed default colors, why? old colors scheme looks nice ;)
EnJoy!

ramguru

Update:

Briefly (What's new):

  • Added mouse-wheel support
  • Fixed couple serious bugs
  • Changed default colors for selection
  • :bg

Jupiter, page down, page up, up, down should change cursor's position, IMHO selection should disappear after any of those is pressed, that's how most of editors work.