Op Wed, 17 Jun 2009 14:28:49 +0200 schreef Dilwyn Jones <dil...@evans1511.fsnet.co.uk>:

I think I pestered Marcel a bit with the app window stuff and I rather think he got a bit fed up of me finding obscure little oddities happending! Fair play, Marcel has laboured long and hard with Easyptr to make it the great programming tool that it is. Marcel never could resist a challenge ... :o))

I am on his black list too.;)

I find it easier to use just pan/scroll bars without arrows, then either add a couple of arrows as loose items outside the app window, or just scroll by testing where the pointer is within the window (using PVAL), so that if you click near the edges of a window, scrolling takes place. It is a bit fiddly to program (see my BMP program or the Launchpad graphics viewer for example
of how it works) but easier than trying to use MAWBARR. Maybe I am not
understanding that command properly. Marcel has made some changes to MCALLT in particular and even Albin Hessler had made some changes to how MAWBAR and
MAWBARR work, so you need the info in IMPORTANT_TXT on the Easyptr disk.

Since I was just trying to see what MAWBAR was all about I had to test MAWBARR too, making some sense of the IMPORTANT_TXT document.

Err, yes, I spotted one (ph%), not even spotted the second myself yet!

Check the first line of my Basic.

I also added the arrows (MAWBARR) but the bar sections don't move when the picture is moved with the arrows.
Do you know of any trick to make this happen?
No I don't, it's one of the reasons I hate MAWBARR because you can move a
few pixels by clicking on the arrows then you have to update the values of the MAWBAR bars to make them reflect the new position. I find it too hard to predict when the bars will disappear (if the entire picture fits inside the window) and thus change the size of the viewable area. Hard to explain.

I found that calling MAWBAR[R] when the pic fits inside the AW the bars/arrows are not drawn!

The other thing I find hard to handle is when you DO IIRC on a scroll bar
and split the sections, what to do with this when there is no menu (e.g. a graphics viewer).

I argee, splitting is not needed then. Anyway, I found that enabling splitting does not work but disabling does disable the action on DO (mpnum=8 or 12).

Handling the arrows proved not that difficult.
This is how I adapted your example. The parameters x_st% and y_st% can have 3 states:
If both are zero the AW window is hit.
If one of them is >0 then the bars are hit.
if both are -1 the arrows are hit and the mpnum values have different meanings.

     winum=action: x_st%=0: y_st%=0
     mpnum=MAWNUM(#ch%,winum,x_st%,y_st%) : REM *** get opcode etc
     IF winum=1
       IF mpnum=0 AND x_st%=0 AND y_st%=0: NEXT loop%
       REM *** something in app win 1 itself hit
       IF x_st% >=0
         SELect ON mpnum
           =0,8: oy%=x_st% *ysz% /y_st% : REM *** hit/do on scroll bar
           =4,12: ox%=x_st% *xsz% /y_st%: REM *** hit/do on pan bar
         END SELect
       ELSE
         SELect ON mpnum
           =0: oy%=oy% -4 *(oy% >=4): REM >>> arrow up, not past zero
           =2: oy%=oy% +4           : REM >>> arrow down
           =4: ox%=ox% -4 *(ox% >=4): REM >>> arrow left, not past zero
           =6: ox%=ox% +4           : REM >>> arrow right
         END SELect
       END IF
       IF ox% >xsz% -awx% : ox%=xsz% -awx%: REM >>> not past the buffer end
       IF oy% >ysz% -awy% : oy%=ysz% -awy%: REM >>> not past the buffer end
       WSARS #ch%,sbase\xvw%,yvw%,xscl%,yscl%,ox%,oy%: REM >>> redraw scr
       MAWBARR #ch%,xsz%,ysz%,ox%,oy%,1,1: REM >>> this solves my problem!
     END IF

Adding or subtracting 4 from the picture pointers gives a reasonable smooth scroll. When the arrows are used, window splitting is not possible, which as said is not a problem on a picture viewing window. Awx% & awy% are the sizes of the AW minus the arrows and bars, xvw% & yvw% equal these if there are arrows and bars but will match the real sizes xsz% & ysz% if there are no bars (pic fits the AW). I have not tested what happens if only 1 of the dimensions fall ouside the AW, more testing needed but my library of _pic files is still very small. I used your BMP converter to make some for this test.

Normally the MAWBAR[R] command is used just after loading the pic and before showing it but I just found that repeating it after the adjusted view here, updates the bars and solved my problem.

Bob

--
Gemaakt met Opera's revolutionaire e-mailprogramma: http://www.opera.com/mail/
_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

Reply via email to