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

Jupiter

great, you added mouse-weel support ;)
Quoteselection should disappear after any of those is pressed, that's how most of editors work.
WinHex doesn't unselect
UltaEdit[Studio] unselect

let me explain:
when I want to add some bytes to selection, I hold Shift and scroll cursor with keyboard
to implement selection with keyboard:
* check if Shift is pressed while scrolling with keyboard
* check scroll direction

suggestion: show just changed bytes with another color

a little optimization:
.elseif eax==WM_MOUSEWHEEL
mov eax, wParam
shr eax, 16
xor ecx,ecx ; SB_LINEUP
cmp ax,0
jge @F
inc ecx ; SB_LINEDOWN
@@:
invoke SendMessage,hWin,WM_VSCROLL,ecx,0

instead of
.elseif eax==WM_MOUSEWHEEL
mov    eax, wParam
shr    eax, 16
cmp    ax, 0
jl     @F
invoke SendMessage, hWin, WM_VSCROLL, SB_LINEUP,   0
jmp    @pos_set
  @@:
invoke SendMessage, hWin, WM_VSCROLL, SB_LINEDOWN, 0
  @pos_set:
EnJoy!

six_L

 

  • new file edit.
  • in the Hex region edit, the data of ASCII region will change; in ASCII region edit, the data of the Hex region will change.
  • if the file changed, note to save while it will be exited.
  • auto-cteated a bak file.
regards

ramguru

Quote from: Jupiter on January 17, 2007, 12:33:48 PM
let me explain:
when I want to add some bytes to selection, I hold Shift and scroll cursor with keyboard
to implement selection with keyboard:
* check if Shift is pressed while scrolling with keyboard
* check scroll direction
I know what you mean (selection using keyboard), this is easy to accomplish, I will definitely add that feature.

Quote from: Jupiter on January 17, 2007, 12:33:48 PM
suggestion: show just changed bytes with another color
This feature could cause a headache from one point of view, and be neatly implemented - from other. Let's say you opened 4Gb ISO file, changed all bytes - now what ?! Does the control should allocate 4Gb for tracing what bytes where changed  :dazzled: Now how I'm thinking about this problem is to have 8 DWORDS buffer to store only pointers of 8 recently changed bytes location. I also could have 32 DWORDS buffer for 32 BYTES, but with 4 color options: col1 - 8 most recenlty changed bytes, col2 - 8 recently changed bytes, 8 not so recently changed bytes etc. Of course this feature would decrease a little bit drawing performance...

And thanks for the hint regarding "optimization" (it will be changed in next version)


Quote from: six_L on January 17, 2007, 01:49:18 PM

  • new file edit.
  • in the Hex region edit, the data of ASCII region will change; in ASCII region edit, the data of the Hex region will change.
  • if the file changed, note to save while it will be exited.
  • auto-cteated a bak file.

Hello six_L,

You surely are able express your ideas in mysterious way  :bg
As I suspect these are features you wanna see in ShineInHex.

Let's think  :wink about them

Quote from: six_L on January 17, 2007, 01:49:18 PM

  • new file edit.

I don't want to disappoint you, but ShineInHex is supposed to be a control that could be used in other applications, and only those "other applications" are responsible for memory management, ShineInHex accepts only [pointer,size_of_data] combination. And I don't think I ever will implement insert capability.
I made Test_ShineInHex just so you know how to use my control and as title says it's just a test.

Quote from: six_L on January 17, 2007, 01:49:18 PM

  • in the Hex region edit, the data of ASCII region will change; in ASCII region edit, the data of the Hex region will change.

If I understand correctly you want to be able to edit not only from Hex part (entering 0..F), but also from ANSI part (entering ANSI characters). If so - this isn't easy, but possible, probably will add this features later.

Quote from: six_L on January 17, 2007, 01:49:18 PM

  • if the file changed, note to save while it will be exited.
  • auto-cteated a bak file.

Again I think this is responsibility of application that uses my control.

six_L

hey,ramguru
thanks your response.

though i expressed some strange, but i think you entirely understood my meanings.
UltraEdit maybe powerful, but has a bit of complexity.
i like some efficacious tools as the ShineInHex.
regards

Jupiter

QuoteI know what you mean (selection using keyboard), this is easy to accomplish, I will definitely add that feature.
I mean that selection must not be cleared when scrolling via keyboard!
another scenario:
I select a block, then scroll cursor down (selection is intact), then I select 'Block End here" via shortcut or menu.

about changed bytes:
I supposed that you just paint changed byte with different color and forget about w/o checking it later

now my contribution:

tester now supports drag-n-drop

ShineInHex:

Legend:
[!] Info
[*] Change
[+] Addition
[-] Removal/Fix

--------------------------------------
v1.0 January 17, 2007
--------------------------------------
[+] Dynamic hex table generation (Static table was ~1.2 KB)
[+] Display national characters (cyrillic support)
[*] Uninitialized variables are now located in correct segment
[!] File size: 12 800 bytes (Old: 14 848 bytes)
[+] WinAsm studio project added
[!] by Jupiter

[attachment deleted by admin]
EnJoy!

ramguru

Your thoughts and ideas are welcome  :U
Feel free to repost updates/modifications or spread the word "ShineInHex" in other boards
With my new version of ShineInHex I'll include all your proposes (if you permit me) except the one with cyrilic charset  :8)

I really would show better initiative (at this time) if I had not serious problem with mathematics in my university   :( ....

Jupiter

well feel free to use all modifications ;)
I started History.txt, add updates there.

why you don't want to extend displayed charset (to support non-english letters)?
may be create message in callback to set character ranges?
EnJoy!

ramguru

Quote from: Jupiter on January 17, 2007, 06:03:49 PM
why you don't want to extend displayed charset (to support non-english letters)?
may be create message in callback to set character ranges?
Jupiter, you know I'm not Russian (your native is Cyrillic charset, my - Baltic). It could be implemented, but it should be general-purpose, f.e. using Alt+Shift control could automatically switch among any charset you (this would be more like IT).

Regarding ShineInHex development:
I won't post new version today, may be tomorrow, but so you know I've made major changes:
Now ClearType fonts are appropriately  supported (I will add "Courier New", "Lucida Console")
Now there are two input modes: 0..F and ASCII (thanks to six_L)
I've "remastered" the drawing procedure: now theoretically any byte can be highlighted with different text, background color w/o big performance loss. (I have future ideas about special ShineInHex edition that will highlight separate PEcoff parts differently, so new drawing method will make that possible )
Fixed bug where control lost scroll pos after it was minimized
Now I'm only working on highlighting modified bytes...

Just wait for new version  :U (if any-one waits  :lol )

Ehtyar

I will most certainly be waiting. You're doing an incredible job ramguru, the highlight modified bytes and PEcoff sections ideas sound great. Thank you for such an awesome control.

Ehtyar.

Jupiter

#24
ok, whil you work on control, I'll improve test app.
I really like your ToDo list ;)
EnJoy!

ramguru

Update :) finally
I've changed list of supported messages, some constants changed...so don't stick to the old one
Made some improvements in properties dialog (in test.exe)
Of course all changes I've mentioned in my last post...apply to the current version, also made selection using keyboard possible...
Now if you allow me  :lol I'm going to sleep  :bg

Jupiter

oh damn... when changed characters become darker... I hope that wasn't my brain damage ;)
anyway nice idea ;)

well... it seems that you can go sleep now ;)))))
EnJoy!

ramguru

It seems that selection is kinda slow  :( On my usual development environment (lenovo laptop) it looks OK, but screen update rate is only - 60Hz. Now if I test it with desktop box where update rate is 75Hz, I can fractionally see flicker, which is mother of evil. I can only imagine how badly control looks where screen update rate is 100Hz or more. I will have to work on selection update (probably combining regions and invalidating them). It would be nice to hear from all of you who use my control (or tried at least once) what features could make ShineInHex better tool, while I'm still on the wave of development...

Jupiter

on my laptop all looks ok, no flickering
about features:
moving/deleting and copy/paste
EnJoy!

ramguru

Jupiter,
Forget deleting, moving (sorry) ShineInHex is designed to accept a pointer, not handle file management.
Regarding Copy - the control already does Copy pretty well, I'm just thinking about adding "Copy Ansi", "Copy Unicode" commands
I'm also thinking of implementing a statusbar in non-client area, that will add faster search opportunity, various status information.
I'm also thinking of implementing folding, meaning you'll be able to collapse/expand a range of data...what do you think?