Re: [Ql-Users] I need help!!!
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!!!
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!!!
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