31 January 2014, 15:56 | #1 |
XoXo/Tasko Developer
Join Date: Dec 2013
Location: Munich
Age: 48
Posts: 450
|
Codin' a HEX-Editor
Hi,
i decided to add a hex/asc viewing window to my tool. Scrolling with the keyboard or mousewheel works. But now I want to add scrollbar and have problems with calculating the propper pot, body, max values to set the scroller and also to set the hex/asc field pos correctly to what the scroller was scrolled to. I need help with the logic behind this idea. Probably somebody around here has once solved this problem, so I ask. The difficulties are: when scrolling up or down with the bar the hex/asc content jumps horizontally, while I want it to jump only vertically. So if you are at pos. c0 for example, and scolling down, the pos value should also end with c0 and not with c2, c4, c6, c8 and so on. Here is my approach to set pot, body and max of the scroller: Code:
; window visible lines, 4 longs per line move.w gv_mon_lines(a4),d0 mulu.w #16,d0 ext.l d0 move.l d0,oxPI_body(a1) ; set scroller pot to file offset move.l gv_offset(a4),oxPI_pot(a1) ; set scroller max to filesize move.l gv_size(a4),oxPI_max(a1) Code:
move.l d0,gv_offset(a4) add.l gv_start(a4),d0 move.l d0,gv_current(a4) |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Hex | Hanzu | HOL contributions | 2 | 13 November 2013 16:57 |
Hex Comp | mai | support.Other | 2 | 28 May 2010 20:00 |
Hex Editor | Retro1234 | request.Other | 9 | 24 October 2006 11:03 |
Hex to Decimal | -Rob- | Coders. General | 8 | 21 June 2006 19:22 |
Hex Editor Help | misguided_fool | request.Apps | 5 | 22 March 2006 09:53 |
|
|