Re: [Ql-Users] I need help!!!

2009-06-20 Thread John Sadler
You can do almostanything under Tptr with George's help!

Thatismore than you can say for EasyPtr!

On Monday 15 June 2009 16:49, Derek Stewart wrote:
 Hi Dilwyn,

 This is great,  wish there were more posting on Easyptr.

 Do you think the same thing could be done in Turboptr?

 Derek

 Dilwyn Jones wrote:
  It looks like you are reinventing the wheel but you will find much of
  what
  you want in Jonathan Hudson's code (C68) for CView. This is still to be
  found (tho' I haven't checked) on Dilwyn's web site. His handling of
  scrollable/pannable screens provided the basis for MView.
 
  Christopher Cave
 
  This is something I ought to document at some point, as it is not the
  easiest of subjects if you have never used it before. This explanation
  is for use with BASIC or compiled BASIC.
 
  I always use Easyptr 4 for this - earlier Easyptrs should work too
  (unless you want to use GD2).
 
  This is done by using the MAWBAR (and MAWBARR if you want to use the
  arrows, but MAWBAR is easier).
 
  1. set up a suitable window, allowing 8 pixels across the width of a
  vertical scroll bar, and 5 pixels deep for the horizontal pan bars.
  The window does NOT expand to take these bars, they are drawn INSIDE
  the window. So if you want a window to display, say, 480x200 pixels it
  has to actually be 488 wide inside the window border and 485 deep.
 
  2. Set up the pan and scroll bars with a MAWBAR command:
  MAWBAR
  #channel,app_window_number,wide%,high%,x_start%,y_start%,x_grid%,y_grid%
 
  wide% = number of vertical columns (can be bigger than screen)
  high% = number of horizonatl rows (also can be bigger than screen)
  x_start%, y_start% = coordinates of top left corner of the part shown
  x_grid%,y_grid% = grid width and height. Could be 1 if graphics, or
  text might be 6x10 for example
 
  3. To remove the bar later (not explained in manual) use MWINDOW
  #channel,app_window_num:MAWBAR #ch,0,0:mdraw
  #channel,app_window_num,0,0:MDRAW #channel
 
  4. Reading the bars is not as easy and needs a working example.
  Basically, you use the value returned by MCALL to check if the action
  done by the user was on a loose item (negative values), an application
  window (1 to 256), or a special item number (65536). Break down the
  value of MCALL with MAWNUM and take appropriate SELectactions
  depending on the values.
 
  MAWNUM with 4 parameters will break down the composite return value of
  MCALL, which is operation code in bits 0-3 and the pixel position
  information in bits 4 to 15.
 
  action = MCALL(#channel)
  winum = action : REMark temporary value
  mpnum = MAWNUM(#channel,winum,x_st%,y_st%)
 
  this returns mpnum as the action number (see easyptr manual) and winum
  is the window number of the window hit. Then x_st% is the pixel
  position of the hit onthe bar and y_st% is the length of the bar.
 
  action = MCALL(#channel)
  1900 SELect ON action
  1910=-1,-2 : REMark loose items
  1920=1 TO 256 : REMark application windows
  1970 =REMAINDER : REMark check for pan/scroll bars
  1980   winum = num : x_st% = 0 : y_st% = 0
  1990   mpnum = MAWNUM(#0,winum,x_st%,y_st%) : REMark opcode etc
  2000   IF winum = 1 THEN
  2010 REMark app window 1
  2020 IF mpnum = 0 AND x_st% = 0 AND y_st% = 0 THEN
  2030   REMark something in app win 1 itself hit
  2040 ELSE
  2050   REMark one of the pan/scroll bars hit
  2060   REMark x_st% = pixel position of hit on bar
  2070   REMark y_st% = length of the bar
  2080   REMark mpnum is the operation code 0 to 4 (unused ones
  are split/join)
  2090   REMark beware of special case of mpnum=0  x_st%=0 
  y_st%=0 above
  2100   SELect ON mpnum
  2110 =0,8 : REMark hit/do on scroll bar
  2120   oy% = x_st%*ph%/y_st% : REMark SHOW must adjust oy%
  if out of range
  2130 =4,12 : REMark hit/do on pan bar
  2140   ox% = x_st%*ph%/y_st% : REMark SHOW must adjust ox%
  if out of range
  2150   END SELect
  2160 END IF
 
  In this example, ox% and oy% are the co-ordinates of the position
  visible on the screen of the virtual page. pw% and ph% are the page
  width and height of the virtual page.
 
  This is not the easiest of subjects, especially if you start using the
  advanced options with the MCALLT extension.
 
  Hope this helps get you started enough to explore the possibilities
  further.
 
  
 
 
  No virus found in this incoming message.
  Checked by AVG - www.avg.com
  Version: 8.5.339 / Virus Database: 270.12.70/2177 - Release Date:
  06/15/09 05:54:00

 ___
 QL-Users Mailing List
 http://www.q-v-d.demon.co.uk/smsqe.htm

___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] I need help!!!

2009-06-20 Thread Jochen Merz

Yes, Per's article (and much more!) will be in the next QL Today :-)

The issue is currently being proof-read and will be printed and shipped 
next week :-)


Jochen


P Witte wrote:

Bob Spelten writes:


What are these popup help routines? They sound interesting.

It is an example routine, how to make Hint windows popup in EasyPtr 
programs.

It was described in QL Today volume 10, issue 3.
It was on one of the QLT disks and can also be found on Per's site.
(http://www.witteware.com/knoware/)


Sorry, the site is currently down while I search for a cheaper host.

My articles Taking a Hint (pop-up hints and reading lines longer than 
can be displayed in a regular grid), and Pox (using pop-up windows 
larger than, or outside, the main program outline) were intended to 
demonstrate that much of the stuff weve become accustomed to in modern 
mainstream programs are relatively easily achievable on QL systems too. 
Most of the techniques used wont be news for many of the contributors to 
this thread. Anyone else can simply use and modify the S*Basic routines 
listed.


An upcoming article (Ive been told it will appear in the next QLT), 
Resz, is about interactive resizing of windows It was inspired by Ralf 
Reköndt's comment on this list: ..how nice [it would be] to use the 
Windows facility of changing a window size in the lower right edge of a 
window.. - and the subsequent discussion.


My demo in the latter article shows up an annoying (lack of?) feature in 
ptrgen that it doesnt recognise that a mouse button is pressed when it 
initialises: it assumes buttons are up :o(


And while we are at it: It would be great if ptrgen would be extended to 
allow registering a keystroke modifier, such as ALT, CTRL and SHIFT 
together with a mousebutton press. A couple of spare bits in the pointer 
record might be available for this? That would allow mass selects and 
toggles, as in Windows etc.


Thanks to Dilwyn and others for the brief demo on using scrollbars!

Per
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm



___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] I need help!!!

2009-06-20 Thread gdgqler


On 20 Jun 2009, at 09:08, John Sadler wrote:


You can do almostanything under Tptr with George's help!



I hope that anyone can use TurboPTR without my help! However I'm  
always willing to give help, or even change TurboPTR to make it do a  
bit more than almost anything.



Thatismore than you can say for EasyPtr!


It is true that I can't help anyone with EasyPtr.

However, here's an indication of how TurboPTR gets a window to pop up.  
It uses the vector WM.WRPTRT which allows a timeout to be set, and  
also job events to be noted. The TurboPTR function using this is  
WRPTRP(working definition address,timeout,events). This function  
returns a long word showing why the function returned.


Here is a small example:

1640 REPeat lp
1650 k=WRPTRT(wwd,300,255)
1660  r=255get_x%(k)
1670  REMark ***
1680  REMark *   r is the code extracted from k   *
1690  REMark *   255 - a loose item*
1700  REMark *   254 - an event  *
1710  REMark *   252 - timed out *
1720  REMark  
*  *

1730  REMark *  get_y%(k) is the bottom word of k  *
1740  REMark *   and is the item or event number   *
1750  REMark ***
1760  SELect ON r
1770   =255:REMark loose items
1780 IF do_loose%(get_y%(k)):EXIT lp
1790   =254:REMark event
1800 IF do_event%(get_y%(k)):EXIT lp
1810   =252:REMark timed out
1820 IF Do_Timeout%:EXIT lp
1830  END SELect
1840 END REPeat lp
1850 STOP
2080 DEFine FuNction Do_Timeout%
2090 
REMark 
 ***
2100 
REMark 
 *If on a loose item  *
2110  LOCal  
stadr,x:REMark  
*   - Do_Indic%  *
2120  stadr=PEEK_L(wwd):   REMark  
* -status area*
2130  IF PEEK_W(stadr+12)-1:RETurn 0:   REMark *   Not in  
main window *
2140  x=PEEK_W(stadr+$30):   REMark *  
x = loose item number (?)  *
2150  IF x0:RETurn 0:ELSE RETurn Do_Indic% :REMark * If  x  0 not a  
loose item *
2160 
:REMark 
 ***

2170 END DEFine
2530 DEFine FuNction Do_Indic%
2540 :
2550
REMark *
2560  wwd1=M_SETUP(#0,wd(x+1),-1):REMark *   Set the working  
definition. *
2570  chid1=M_PULLD(wwd1,-1):  REMark * Make the  
window appear.   *
2580  do_sec:  REMark  
*  Process this window until . .   *
2590  BUNST wwd1:  REMark  
*. .  it disappears . .   *
2600  CLOS chid1: REMark * . .  
and its channel is closed. *
2610  BRCHP wwd1: REMark *   
Returns the space for working*
2620  IF acty0:RETurn 0:REMark *  
definition. *

2630  IF acty=0:D_LDRW 128*65536,wwd
2640  RETurn do_loose%(acty): REMark *The action  
set by do_sec  *
2650   
REMark *

2660 END DEFine

George


___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] I need help!!!

2009-06-19 Thread François Van Emelen

gdgqler schreef:


On 15 Jun 2009, at 18:37, Dilwyn Jones wrote:


Per Witte has also written some good stuff, like his popup help routines.


What are these popup help routines? They sound interesting.

George
Small windows that popup when the pointer hoovers over a selectable 
object like loose items,application windows, application objects.

François Van Emelen


___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] I need help!!!

2009-06-19 Thread Bob Spelten

Op Fri, 19 Jun 2009 15:17:50 +0200 schreef gdgqler gdgq...@gmail.com:


What are these popup help routines? They sound interesting.

It is an example routine, how to make Hint windows popup in EasyPtr  
programs.

It was described in QL Today volume 10, issue 3.
It was on one of the QLT disks and can also be found on Per's site.
(http://www.witteware.com/knoware/)

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


Re: [Ql-Users] I need help!!!

2009-06-19 Thread P Witte

Bob Spelten writes:


What are these popup help routines? They sound interesting.

It is an example routine, how to make Hint windows popup in EasyPtr 
programs.

It was described in QL Today volume 10, issue 3.
It was on one of the QLT disks and can also be found on Per's site.
(http://www.witteware.com/knoware/)


Sorry, the site is currently down while I search for a cheaper host.

My articles Taking a Hint (pop-up hints and reading lines longer than 
can be displayed in a regular grid), and Pox (using pop-up windows 
larger than, or outside, the main program outline) were intended to 
demonstrate that much of the stuff weve become accustomed to in modern 
mainstream programs are relatively easily achievable on QL systems 
too. Most of the techniques used wont be news for many of the 
contributors to this thread. Anyone else can simply use and modify the 
S*Basic routines listed.


An upcoming article (Ive been told it will appear in the next QLT), 
Resz, is about interactive resizing of windows It was inspired by 
Ralf Reköndt's comment on this list: ..how nice [it would be] to use 
the Windows facility of changing a window size in the lower right edge 
of a window.. - and the subsequent discussion.


My demo in the latter article shows up an annoying (lack of?) feature 
in ptrgen that it doesnt recognise that a mouse button is pressed when 
it initialises: it assumes buttons are up :o(


And while we are at it: It would be great if ptrgen would be extended 
to allow registering a keystroke modifier, such as ALT, CTRL and SHIFT 
together with a mousebutton press. A couple of spare bits in the 
pointer record might be available for this? That would allow mass 
selects and toggles, as in Windows etc.


Thanks to Dilwyn and others for the brief demo on using scrollbars!

Per
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] I need help!!!

2009-06-19 Thread P Witte


I wrote:

An upcoming article (Ive been told it will appear in the next QLT), 
Resz, is about interactive resizing of windows 


That should be Wresz, not that its important..




Thanks to Dilwyn and others for the brief demo on using scrollbars!


By others I meant Bob Spelten, of course ;o)

Per

___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] I need help!!!

2009-06-18 Thread gdgqler


On 14 Jun 2009, at 00:22, Frank-Guido Dibowski wrote:



I want to manage for example a QL-Screen picture (512x256) or a text- 
file on a
application subwindow (200x100) with pan and scroll bars (like  
QDesign or QD

(Sorry Jochen, not with QMenu ;-)) but i don't know how.
I work with EasyPtr4, C68 and a little bit assembler.
Can everybody help me?



Application Windows

Pan and scroll bars can be produced as part of an application window  
by the use of the PE software window manager vectors WM.INDEX and  
WM.MDRAW. If SETW is used to produce a window definition (for  
TurboPTR, CPTR and EayPEasy) containing an application window with  
items, scroll bars and arrows are automatically produced when the  
working definition is set up if the application window is too small to  
show all the items.


Sometimes you may want to set items to an application window after the  
program has started. An example is showing the directory of FLP1. In  
this case TurboPTR has the function set_ap which does this, with  
scroll bars and arrows if needed. The same can be done in assembler  
using EasyPEasy which provides the subroutine set_ap. The example  
EX2 is available in TurboPTR and EasyPEasy. This shows in detail how  
it works.


QD Type Scrolling

The movement of text in QD can be done by using the vertical scroll  
bar. There are no arrows. I have done this in my programs  by  using  
the Trap IO.RPTR to read the pointer instead of the vector WM.RPTR. I  
detect when the left mouse key is pressed when the pointer is inside a  
scroll bar. I make the icon invisible until the key is lifted and move  
the scroll bar as the mouse is moved. The way this is done is shown in  
the example EX4 in TurboPTR and in EasyPEasy.


One problem with using IOP.RPTR instead of WM.RPTR is that you have to  
program for the detection of loose items both to draw  and undraw  
borders round them when the pointer is on them or has moved away from  
them and also to activate the loose items when the mouse key is clicked.


In CPTR, the example EX2 shows text being displayed with scroll bars  
when  the window is too small.



George
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] I need help!!!

2009-06-17 Thread Bob Spelten

Op Mon, 15 Jun 2009 19:37:22 +0200 schreef Dilwyn Jones
dil...@evans1511.fsnet.co.uk:


Per Witte has also written some good stuff, like his popup help routines.
And Bob Spelten and Wolfgang Uhlig are two other names who I can think of
who have used it extensively who might be able to document some examples
perhaps.


Dilwyn, thanks for your example.

Per's popup ended up in SuQcess. Wolfgang's sources revealed what I could
not get out of the EasyPtr manual.
We also pushed the MAWDRAW command to its limits in SuQcess, revealing
some bugs that were promptly dealt with by Marcel in the latest EasyPtr4.
But I must confess never to have used the MAWBAR command because MAWDRAW
does bars  arrows automagically.
Strictly speaking, the bars are drawn outside the Appl. Window and the
arrows inside it. EP4 will adjust the AW size to make room but anything
printed inside the AW must then be offset by 12 pixels from the left and 6
pixels from the top not to overwrite the arrows.

I managed to produce a simple SBASIC PIC viewer on the basis of your
example (I spotted 2 typos).
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?

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


Re: [Ql-Users] I need help!!!

2009-06-17 Thread Dilwyn Jones

Bob Spelten wrote:


Dilwyn, thanks for your example.

Per's popup ended up in SuQcess. Wolfgang's sources revealed what I could
not get out of the EasyPtr manual.
We also pushed the MAWDRAW command to its limits in SuQcess, revealing
some bugs that were promptly dealt with by Marcel in the latest EasyPtr4.
But I must confess never to have used the MAWBAR command because MAWDRAW
does bars  arrows automagically.
Yes, indeed it does. When MAWDRAW is used to display an array, of course it 
adds pan/scroll bars automatically as required. I only meant that if you 
were using MAWBAR on app windows where there is no MAWDRAW menu present, 
e.g. a graphics viewer.


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))



Strictly speaking, the bars are drawn outside the Appl. Window and the
arrows inside it. EP4 will adjust the AW size to make room but anything
printed inside the AW must then be offset by 12 pixels from the left and 6
pixels from the top not to overwrite the arrows.
I never use the arrows drawn by MAWBARR, I find them too difficult to 
handle and a little unpredictable in their actions. I did use them in an old 
Graphics Viewer program, but programming was a real struggle, trying to 
predict where and when bars and arrows would appear and the area of the 
window I could use. In particular, when the graphics was only a few pixels 
larger or smaller than the window. I can't remember the details, but after 
that little saga I stopped using MAWBARR (my brain hurt).


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.


Here is how I pan and scroll by clicking on the window itself:
1) test for hit on the application window itself: action=MCALL(#channel):IF 
action=1 THEN

(when MCALL return is pure application window number 0,1,2...)
2) DIM r%(15):PVAL #channel,r% :REM get pointer result for this channel
3) Check if return was by mouse button press (r%(5)=1 or 2 for hit or do)
4) Check r%(3) and r%(4) for pointer position within window
5) if within, say, 10% of the edge as tested by r%(8) and r%(9) for width 
and height of the window:

IF r%(3)  (r%(8)/10) THEN REM pan left (inside left hand 10% of window)
IF r%(3)  (9*r%(8)/10) THEN REM pan right (inside bottom 10% of window)
IF r%(4)  (r%(9)/10) THEN REM scroll up
IF r%(4)  (9*r%(9)/10) THEN REM scroll down

Obviously, be careful of where the horizontal and vertical strips overlap if 
you don't want diagonal movement.



I managed to produce a simple SBASIC PIC viewer on the basis of your
example (I spotted 2 typos).

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


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.


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).

--
Dilwyn Jones 



___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] I need help!!!

2009-06-17 Thread Bob Spelten
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


Re: [Ql-Users] I need help!!!

2009-06-17 Thread Marcel Kilgus
Dilwyn Jones wrote:

 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 found it amazing that after all these years of EasyPtr existing and
clearly being used you still found bug after bug in the code ;-)

But the MAW... code could give anybody nightmares. I prefer to never
ever touch it again.

 Marcel has made some changes to MCALLT in particular

Yeah, I just read some of the comments I made in the code and the
MCALLT one was particularly nice: [...] I do not even know the
purpose why the flag used to be changed here. It doesn't make sense!
(MK) ;-)

Marcel

___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] I need help!!!

2009-06-16 Thread gdgqler


On 15 Jun 2009, at 18:37, Dilwyn Jones wrote:



Do you think the same thing could be done in Turboptr?
I don't know enough about TurboPtr, I'm sure George Gwilt will tell  
us?




TurboPTR can certainly do this. In my program PMOVE, written using  
TurboPTR,  an image which is too big to be shown in the window can be  
moved about using scroll bars. This program and its source is in the  
zipped files  svscrp06_zip and svscrs06_zip in


http://web.ukonline.co.uk/george.gwilt/page2.htm


George


___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


[Ql-Users] I need help!!!

2009-06-15 Thread Christopher Cave
In-Reply-To: 200906140122.47702.frank-dibow...@t-online.de
Frank

It looks like you are reinventing the wheel but you will find much of what 
you want in Jonathan Hudson's code (C68) for CView. This is still to be 
found (tho' I haven't checked) on Dilwyn's web site. His handling of 
scrollable/pannable screens provided the basis for MView.

Christopher Cave

___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] I need help!!!

2009-06-15 Thread Derek Stewart

Hi Dilwyn,

This is great,  wish there were more posting on Easyptr.

Do you think the same thing could be done in Turboptr?

Derek

Dilwyn Jones wrote:
It looks like you are reinventing the wheel but you will find much of 
what

you want in Jonathan Hudson's code (C68) for CView. This is still to be
found (tho' I haven't checked) on Dilwyn's web site. His handling of
scrollable/pannable screens provided the basis for MView.

Christopher Cave

This is something I ought to document at some point, as it is not the 
easiest of subjects if you have never used it before. This explanation 
is for use with BASIC or compiled BASIC.


I always use Easyptr 4 for this - earlier Easyptrs should work too 
(unless you want to use GD2).


This is done by using the MAWBAR (and MAWBARR if you want to use the 
arrows, but MAWBAR is easier).


1. set up a suitable window, allowing 8 pixels across the width of a 
vertical scroll bar, and 5 pixels deep for the horizontal pan bars. 
The window does NOT expand to take these bars, they are drawn INSIDE 
the window. So if you want a window to display, say, 480x200 pixels it 
has to actually be 488 wide inside the window border and 485 deep.


2. Set up the pan and scroll bars with a MAWBAR command:
MAWBAR 
#channel,app_window_number,wide%,high%,x_start%,y_start%,x_grid%,y_grid%


wide% = number of vertical columns (can be bigger than screen)
high% = number of horizonatl rows (also can be bigger than screen)
x_start%, y_start% = coordinates of top left corner of the part shown
x_grid%,y_grid% = grid width and height. Could be 1 if graphics, or 
text might be 6x10 for example


3. To remove the bar later (not explained in manual) use MWINDOW 
#channel,app_window_num:MAWBAR #ch,0,0:mdraw 
#channel,app_window_num,0,0:MDRAW #channel


4. Reading the bars is not as easy and needs a working example. 
Basically, you use the value returned by MCALL to check if the action 
done by the user was on a loose item (negative values), an application 
window (1 to 256), or a special item number (65536). Break down the 
value of MCALL with MAWNUM and take appropriate SELectactions 
depending on the values.


MAWNUM with 4 parameters will break down the composite return value of 
MCALL, which is operation code in bits 0-3 and the pixel position 
information in bits 4 to 15.


action = MCALL(#channel)
winum = action : REMark temporary value
mpnum = MAWNUM(#channel,winum,x_st%,y_st%)

this returns mpnum as the action number (see easyptr manual) and winum 
is the window number of the window hit. Then x_st% is the pixel 
position of the hit onthe bar and y_st% is the length of the bar.


action = MCALL(#channel)
1900 SELect ON action
1910=-1,-2 : REMark loose items
1920=1 TO 256 : REMark application windows
1970 =REMAINDER : REMark check for pan/scroll bars
1980   winum = num : x_st% = 0 : y_st% = 0
1990   mpnum = MAWNUM(#0,winum,x_st%,y_st%) : REMark opcode etc
2000   IF winum = 1 THEN
2010 REMark app window 1
2020 IF mpnum = 0 AND x_st% = 0 AND y_st% = 0 THEN
2030   REMark something in app win 1 itself hit
2040 ELSE
2050   REMark one of the pan/scroll bars hit
2060   REMark x_st% = pixel position of hit on bar
2070   REMark y_st% = length of the bar
2080   REMark mpnum is the operation code 0 to 4 (unused ones 
are split/join)
2090   REMark beware of special case of mpnum=0  x_st%=0  
y_st%=0 above

2100   SELect ON mpnum
2110 =0,8 : REMark hit/do on scroll bar
2120   oy% = x_st%*ph%/y_st% : REMark SHOW must adjust oy% 
if out of range

2130 =4,12 : REMark hit/do on pan bar
2140   ox% = x_st%*ph%/y_st% : REMark SHOW must adjust ox% 
if out of range

2150   END SELect
2160 END IF

In this example, ox% and oy% are the co-ordinates of the position 
visible on the screen of the virtual page. pw% and ph% are the page 
width and height of the virtual page.


This is not the easiest of subjects, especially if you start using the 
advanced options with the MCALLT extension.


Hope this helps get you started enough to explore the possibilities 
further.





No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.5.339 / Virus Database: 270.12.70/2177 - Release Date: 06/15/09 05:54:00


  

___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] I need help!!!

2009-06-15 Thread Dilwyn Jones

This is great,  wish there were more posting on Easyptr.
Actually, there's one small mistake (a typo) I'm aware of in it, let's see 
who spots it ;-)


I suppose that Easyptr is one of the main ways of writing modern QL 
software. Trouble is, Easyptr has never really been documented well beyond 
what's in the manual (which I was never really happy with) and the absolute 
beginner stuff in Norman Dunbar's Easyptr beginners guide and tutorial.


This intermediate Easyptr stuff like my example is something I've been 
meaning to do for a while, but never really had the time apart from the 
examples I've printed in QL Today, which was GD2 specific. If I get the time 
I can rip these working examples from my programs to perhaps write something 
which fills the gaps between Norman's tutorial and the cold hard facts 
(without many examples) in the manual.


Per Witte has also written some good stuff, like his popup help routines. 
And Bob Spelten and Wolfgang Uhlig are two other names who I can think of 
who have used it extensively who might be able to document some examples 
perhaps.



Do you think the same thing could be done in Turboptr?

I don't know enough about TurboPtr, I'm sure George Gwilt will tell us?

--
Dilwyn Jones 



___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] I need help!!!

2009-06-15 Thread Malcolm Cadman
In message 43aea6fddbc84c2f9d778aa6f4dcd...@donna, Dilwyn Jones 
dil...@evans1511.fsnet.co.uk writes


Hi Dilwyn,

Your knowledge and experience with Easyptr would make a useful series of 
articles  for QL Today.




This is great,  wish there were more posting on Easyptr.
Actually, there's one small mistake (a typo) I'm aware of in it, let's 
see who spots it ;-)


I suppose that Easyptr is one of the main ways of writing modern QL 
software. Trouble is, Easyptr has never really been documented well 
beyond what's in the manual (which I was never really happy with) and 
the absolute beginner stuff in Norman Dunbar's Easyptr beginners guide 
and tutorial.


This intermediate Easyptr stuff like my example is something I've 
been meaning to do for a while, but never really had the time apart 
from the examples I've printed in QL Today, which was GD2 specific. If 
I get the time I can rip these working examples from my programs to 
perhaps write something which fills the gaps between Norman's tutorial 
and the cold hard facts (without many examples) in the manual.


Per Witte has also written some good stuff, like his popup help 
routines. And Bob Spelten and Wolfgang Uhlig are two other names who I 
can think of who have used it extensively who might be able to document 
some examples perhaps.



Do you think the same thing could be done in Turboptr?

I don't know enough about TurboPtr, I'm sure George Gwilt will tell us?


--
Malcolm Cadman
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm