English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 31 January 2014, 15:56   #1
AGS
XoXo/Tasko Developer
 
AGS's Avatar
 
Join Date: Dec 2013
Location: Munich
Age: 48
Posts: 450
Happy 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)
And the other way, set the window content based on the scroller pos, when scrolled, d0 is pot value:

Code:
move.l    d0,gv_offset(a4)
add.l    gv_start(a4),d0
move.l    d0,gv_current(a4)
Somehow all this works, somehow not. The window content jumps around horizontally and yet if I resize the window sometimes the scroller draws partially off it's box (means, pot is too big).
AGS is offline  
 


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 17:31.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07778 seconds with 16 queries