Home » Archimedes archive » Archimedes World » AW-1992-05.adf » May92 » !AWMay92/Goodies/Video/!Video/!RunImage
!AWMay92/Goodies/Video/!Video/!RunImage
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » Archimedes archive » Archimedes World » AW-1992-05.adf » May92 |
Filename: | !AWMay92/Goodies/Video/!Video/!RunImage |
Read OK: | ✔ |
File size: | FC64 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
10REM>!RunImage 20REM 30REM LEN Mark Bright. 40: 50Version$="1.00 (05-Mar-92)" 60: 70DIM Block% 1024*4 :REM General purpose WIMP workspace! 80 90PROC_Initialise_WIMP_System 100: 110PROC_SetIconText(3,Info%,Version$) 120PROC_SetIconText(4,Save%,"BoffBright") 130: 140ON ERROR PROC_Wimp_Error 150PROC_Initialise_Program_Variables 160PROC_SetIconText(TapeNumber%,Main%,TapeNumber$) 170: 180ON ERROR PROC_Wimp_Error 190: 200REM ******************************************************************************************************** 210REM All RISCOS/WIMP Specific Proceedures First, !Video8 Proc'S after.... Makes for a better skeleton prog! 220REM ******************************************************************************************************** 230 240REPEAT 250 SYS "Wimp_Poll",Mask%,Block% TO A% 260 CASE A% OF 270 WHEN 2 : SYS "Wimp_OpenWindow",,Block% : REM allows auto Drag 280 WHEN 3 : SYS "Wimp_CloseWindow",,Block% : REM allows auto Close 290 : IF Block%!0=Main% THEN MainWindowOpen%=FALSE 300 WHEN 6 : PROC_ButtonPressed 310 WHEN 7 : PROC_DragBoxEnd(FN_ReadIconText(Save%,4,FALSE)) 320 WHEN 8 : PROC_ProcessKey(Block%!24) 330 WHEN 9 : PROC_MenuSelection 340 WHEN 16,17,18 : PROC_DecodeMessage(Block%!16) 350 ENDCASE 360UNTIL FALSE 370: 380REM ***************************************** 390REM This is the WIMP Error handling routine ! 400REM ***************************************** 410DEF PROC_Wimp_Error 420 LOCAL Error$ 430 SYS "OS_Byte",3,0 440 SYS "Wimp_DragBox",,-1 450 !Block%=ERR 460 Error$ = REPORT$ 470 IF ERR<>2001 THEN Error$ += "Internal Error ("+STR$(ERL)+"). OK to continue, CANCEL to abort" 480 $(Block%+4)=Error$ + CHR$0 490 SYS "Wimp_ReportError",Block%,%001 - (2*(ERR<>2001)),MyTaskName$ TO ,Result% 500 IF Result%=2 THEN PROC_CloseDown 510ENDPROC 520: 530REM ************************************ 540REM Mouse 'Click' Whilst Over Menu Item. 550REM ************************************ 560DEF PROC_MenuSelection 570 IF IconBarMenuActive% THEN 580 CASE Block%!0 OF 590 WHEN 0 : PROC_OpenSubMenu(Info%) : IconBarMenuActive%=FALSE 600 WHEN 1 : PROC_OpenSubMenu(Options%) : IconBarMenuActive%=FALSE 610 WHEN 2 : Old$=InlayType$ : InlayType$="Video_8" 620 IF Old$="VHS_C" OR Old$="DAT" THEN 630 menu%!(28+24*2)=Ticked% 640 menu%!(28+24*3)=NotTicked% : REM Tick Item 2, Untick Items 3 & 4 650 menu%!(28+24*4)=NotTicked% OR Underlined% 660 PROC_SetIconText(Format%,Main%,"Video_8") 670 PROC_Redraw(Main%,Format%) 680 PROC_ChangeWindowTitle(Main%,WindowTitle$) 690 PROC_NotSelectable(Main%,TitleLastLine%,FALSE) 700 ENDIF 710 WHEN 3 : Old$=InlayType$ : InlayType$="VHS_C" 720 IF Old$="Video_8" OR Old$="DAT" THEN 730 menu%!(28+24*2)=NotTicked% 740 menu%!(28+24*3)=Ticked% : REM Tick Item 3, Untick Items 2 & 4 750 menu%!(28+24*4)=NotTicked% OR Underlined% 760 PROC_SetIconText(Format%,Main%,"VHS_C") 770 PROC_Redraw(Main%,Format%) 780 PROC_ChangeWindowTitle(Main%,WindowTitle$) 790 PROC_NotSelectable(Main%,TitleLastLine%,FALSE) 800 ENDIF 810 WHEN 4 : Old$=InlayType$ : InlayType$="DAT" 820 IF Old$="Video_8" OR Old$="VHS_C" THEN 830 menu%!(28+24*2)=NotTicked% 840 menu%!(28+24*3)=NotTicked% : REM Tick Item 4, Untick Items 3 & 2 850 menu%!(28+24*4)=Ticked% OR Underlined% 860 PROC_SetIconText(Format%,Main%,"DAT") 870 PROC_Redraw(Main%,Format%) 880 PROC_ChangeWindowTitle(Main%,DatTitle$) 890 PROC_NotSelectable(Main%,TitleLastLine%,TRUE) 900 ENDIF 910 WHEN 5 : PROC_CloseDown : REM <Select> on "quit" causes shutdown 920 ENDCASE 930 ENDIF 940 950 IF MainWindowMenuActive% THEN 960 CASE Block%!0 OF 970 WHEN 0 : PROC_OpenSubMenu(Info%) : MainWindowMenuActive%=FALSE 980 WHEN 1 : PROC_OpenSubMenu(Save%) : MainWindowMenuActive%=FALSE 990 WHEN 2 : PROC_OpenSubMenu(Options%) : MainWindowMenuActive%=FALSE 1000 WHEN 3 : PROC_FormatIconText 1010 WHEN 4 : PROC_WipeIconText 1020 ENDCASE 1030 ENDIF 1040 1050 SYS "Wimp_GetPointerInfo",,Block% 1060 IF (Block%!8 AND 1) THEN 1070 IF IconBarMenuActive% THEN SYS "Wimp_CreateMenu",,menu% 1080 IF MainWindowMenuActive% THEN SYS "Wimp_CreateMenu",,MainMenu% 1090 ENDIF 1100ENDPROC 1110: 1120REM ******************************** 1130REM Mouse Button Status Has Changed. 1140REM ******************************** 1150DEF PROC_ButtonPressed 1160LOCAL MouseX%,MouseY%,Button%,Window%,Icon% 1170 MouseX%=Block%!00 : REM Block%!00 = Mouse X (Screen Co-ordinates) 1180 MouseY%=Block%!04 : REM Block%!04 = Mouse Y (Screen Co-ordinates) 1190 Button%=Block%!08 : REM Block%!08 = Buttons 1200 Window%=Block%!12 : REM Block%!12 = Window Handle (BackGround = -1, IconBar = -2) 1210 Icon% =Block%!16 : REM Block%!16 = Icon Handle ( Work Area BackGround = -1) 1220 1230 IF Window%=Options% AND Icon%=OptionsOKF% THEN 1240 PROC_ButtonPress(Options%, OptionsOKF%, OptionsOKL%, OptionsOKD%) 1250 PROC_StoreUserData 1260 ENDIF 1270 1280 IF Window%=IconBar% AND Icon%=IconBarIconHandle% THEN 1290 CASE Button% OF 1300 WHEN %001 : PROC_OpenMainWindow(FALSE) 1310 WHEN %100 : PROC_OpenMainWindow(TRUE) 1320 WHEN %010 : MainWindowMenuActive%=FALSE : IconBarMenuActive%=TRUE 1330 SYS "Wimp_CreateMenu",,menu%,Block%!0-64,(40*7)+104 1340 ENDCASE 1350 ENDIF 1360 1370 IF Button%<> %010 AND Window%=Main% AND Icon%=PrintF% THEN 1380 PROC_ButtonPress(Main%, PrintF%, PrintL%, PrintD%) 1390 PROC_PrintOut 1400 ENDIF 1410 1420 IF Button%=%010 AND Window%=Main% THEN 1430 IF InlayType$="Video_8" OR InlayType$="VHS_C" THEN 1440 Postfix$=RIGHT$(InlayType$,2) 1450 ELSE 1460 Postfix$="_D" 1470 ENDIF 1480 Temp$=FN_ReadIconText(Save%,4,FALSE) : Temp2$=FN_ReadIconText(Main%,TapeNumber%,FALSE)+Postfix$ 1490 IF RIGHT$(Temp$,10)="BoffBright" OR OldName$<>Temp2$ THEN 1500 NewSaveName$=FN_ConvertSoftToHardSpaces(Temp2$) 1510 IF LEN(Temp$)>LEN(Temp2$) THEN 1520 Pointer%=LEN(Temp$) 1530 WHILE MID$(Temp$,Pointer%,1)<>"." AND Pointer%>0:Pointer%-=1:ENDWHILE 1540 PROC_SetIconText(4,Save%,LEFT$(Temp$,Pointer%)+NewSaveName$) 1550 ELSE 1560 PROC_SetIconText(4,Save%,NewSaveName$) 1570 ENDIF 1580 OldName$=Temp2$ 1590 ENDIF 1600 PROC_CreateMainWindowMenu(MouseX%,MouseY%,Icon%) 1610 ENDIF 1620 1630 IF Window%=Save% AND Icon%=SaveIcon% THEN PROC_DragSave 1640 IF Window%=Save% AND Icon%=SaveOKF% THEN 1650 PROC_ButtonPress(Save%, SaveOKF%, SaveOKL%, SaveOKD%) 1660 PROC_SaveTo(FN_ReadIconText(Save%,4,FALSE)) 1670 ENDIF 1680 1690 IF Button%<> %010 AND Window%=Options% THEN 1700 CASE Icon% OF 1710 WHEN 0,1,5 : PROC_SetIconText(DriverName%,Main%,PDriver$(FN_ReadESGSelected(Options%,9)+1)) 1720 ENDCASE 1730 PROC_Redraw(Main%,DriverName%) 1740 ENDIF 1750ENDPROC 1760: 1770REM ******************************************************************************************************* 1780REM Change all occurances of <SPACE> in the tape number to <ALT-SPACE> to stop the filer throwing a wobbly. 1790REM ******************************************************************************************************* 1800DEF FN_ConvertSoftToHardSpaces(Name$) 1810 Pointer%=LEN(Name$) 1820 REPEAT 1830 Char$=MID$(Name$,Pointer%,1) 1840 IF Char$=" " THEN 1850 Char$="�" 1860 MID$(Name$,Pointer%,1)=Char$ 1870 ENDIF 1880 Pointer%-=1 1890 UNTIL Pointer%=1 1900=Name$ 1910: 1920******************************** 1930REM 'Press' a button in a window 1940******************************** 1950DEF PROC_ButtonPress(Window%, Front%, Light%, Dark%) 1960 LOCAL TimeNow% 1970 PROC_SetIconColour(Window%, Light%, 4) 1980 PROC_SetIconColour(Window%, Dark%, 0) 1990 PROC_SetIconColour(Window%, Front%, 14) 2000 TimeNow% = TIME 2010 REPEAT 2020 UNTIL TIME > TimeNow%+25 2030 PROC_SetIconColour(Window%, Light%, 0) 2040 PROC_SetIconColour(Window%, Dark%, 4) 2050 PROC_SetIconColour(Window%, Front%, 1) 2060ENDPROC 2070: 2080******************************************** 2090REM Change the colour of an icon in a window 2100******************************************** 2110DEF PROC_SetIconColour(Window%, Icon%, Colour%) 2120 Block%!0 = Window% 2130 Block%!4 = Icon% 2140 Block%!8 = Colour% << 28 2150 Block%!12 = %1111 << 28 2160 SYS "Wimp_SetIconState",, Block% 2170ENDPROC 2180: 2190REM ******************************************************************* 2200REM When a key is pressed, Check if it concerns me. If not, Pass it on! 2210REM ******************************************************************* 2220DEF PROC_ProcessKey(KeyPressed) 2230 LOCAL Icon%,Index%,Window% 2240 Window%=Block%!0 2250 Icon%=Block%!4 2260 Index%=Block%!20 2270 CASE KeyPressed OF 2280 2290 WHEN &180 : PROC_ButtonPress(Main%, PrintF%, PrintL%, PrintD%) 2300 PROC_PrintOut 2310 REM <Print> 2320 2330 WHEN &18A 2340 REM <Tab> 2350 IF Icon%<=BtmSetItemEnd% THEN 2360 PROC_SetCaretPosition(Icon%-((Icon% MOD 2)=0)+((Icon% MOD 2)=1),Index%) 2370 ENDIF 2380 IF Icon%>=TitleFirstLine% AND Icon%<TitleLastLine% THEN PROC_SetCaretPosition(TapeNumber%,0) 2390 IF Icon%=TapeNumber% THEN PROC_SetCaretPosition(TitleFirstLine%,0) 2400 2410 WHEN &0D 2420 REM <Return> 2430 IF Window%=Main% AND Icon%<=BtmSetItemEnd% THEN 2440 IF ((Icon% MOD 2)=1) THEN PROC_MoveDownOneBackOne 2450 IF ((Icon% MOD 2)=0) THEN PROC_SetCaretPosition(Icon%+1,0) 2460 ENDIF 2470 IF Window%=Main% AND Icon%>=TitleFirstLine% AND Icon%<=TitleLastLine% THEN PROC_MoveDownAnEntry 2480 IF Window%=Main% AND Icon%=TapeNumber% THEN PROC_SetCaretPosition(UserNote%,0) 2490 IF Window%=Save% THEN 2500 PROC_ButtonPress(Save%, SaveOKF%, SaveOKL%, SaveOKD%) 2510 PROC_SaveTo(FN_ReadIconText(Save%,4,FALSE)) 2520 ENDIF 2530 2540 WHEN &1E 2550 REM <Home> 2560 IF Icon%<=BtmSetItemEnd% THEN PROC_SetCaretPosition(BtmSetIndexEnd%,0) 2570 2580 WHEN &18F 2590 REM <Cursor Up> 2600 PROC_MoveUpAnEntry 2610 2620 WHEN &18E 2630 REM <Cursor Down> 2640 PROC_MoveDownAnEntry 2650 2660 WHEN &199 2670 REM <Shift><f9> 2680 PROC_WipeIconText 2690 2700 WHEN &1CA 2710 REM <f10> 2720 PROC_SwapCase(Main%,Icon%,Index%) 2730 2740 WHEN &1CB 2750 REM <f11> - Delete to end of line 2760 Text$=LEFT$(FN_ReadIconText(Main%,Icon%,FALSE),Index%) 2770 PROC_SetIconText(Icon%,Main%,Text$) 2780 PROC_Redraw(Main%,Icon%) 2790 2800 OTHERWISE SYS "Wimp_ProcessKey",Block%!24 2810 2820 ENDCASE 2830ENDPROC 2840: 2850REM ***************************************************************** 2860REM Set which icon the caret is in, scrolling the window as required. 2870REM ***************************************************************** 2880DEF PROC_SetCaretPosition(Icon%,Index%) 2890 LOCAL CaretX%, CaretY%, Top%, Btm%, Left%, Right% 2900 IconLength%=LEN(FN_ReadIconText(Main%,Icon%,FALSE)) 2910 IF Index%>IconLength% THEN Index%=IconLength% 2920 SYS "Wimp_SetCaretPosition",Main%,Icon%,,,-1,Index% 2930 SYS "Wimp_GetCaretPosition",,Block% 2940 CaretX%=Block%!8 : CaretY%=Block%!12 2950 Block%!0=Main% 2960 SYS "Wimp_GetWindowState",,Block% 2970 Top% =Block%!24 : Btm% =Top% -(Block%!16-Block%!8) 2980 Left%=Block%!20 : Right%=Left%+(Block%!12-Block%!4) 2990 REM Since caret co-ordinates locate the bottom of the caret, there is a fudge of 64 above and 32 below (32=1 char) 3000 IF (Top%-64 < CaretY%) THEN 3010 Block%!24=CaretY%+64 3020 SYS "Wimp_OpenWindow",,Block% 3030 ENDIF 3040 IF (Btm%+32 > CaretY%) THEN 3050 Block%!24=Block%!24-(Btm%-(CaretY%-32)) 3060 SYS "Wimp_OpenWindow",,Block% 3070 ENDIF 3080ENDPROC 3090: 3100REM ******************************* 3110REM Redraw the specifiied icon (v2) 3120REM ******************************* 3130DEF PROC_Redraw(Window%,Icon%) 3140 Block%!0=Window% 3150 Block%!4=Icon% 3160 Block%!8=0 3170 Block%!12=0 3180 SYS "Wimp_SetIconState",,Block% 3190ENDPROC 3200: 3210REM *************************************************************** 3220REM When a message is received, Control is passed to here for decoding 3230REM *************************************************************** 3240DEF PROC_DecodeMessage(Request%) 3250 CASE Request% OF 3260 WHEN msg_quit% : PROC_CloseDown 3270 WHEN msg_datasave% : Block%!0=(48+LEN("<Wimp$Scrap> "))AND NOT 3 3280 Block%!12=Block%!8 3290 Block%!16=2 3300 $(Block%+44)="<Wimp$Scrap>" 3310 SaveRef%=Block%!12 3320 SYS "Wimp_SendMessage",usr_message%,Block%,Block%!4 3330 WHEN msg_dsaveACK% : PROC_HandleMessage_DataSaveAck 3340 WHEN msg_dataload% : PROC_FileDroppedOnMe 3360 WHEN msg_help% : PROC_GiveHelp(Block%!32,Block%!36,Block%!20,Block%!24) 3370 WHEN msg_taskinit% : IF FN_ReadString(Block%+28)=MyTaskName$ AND Block%!4<> My_id% THEN 3380 REM Another !Video8 is trying to start up, I am closing down! 3390 PROC_CloseDown 3400 ENDIF 3410 ENDCASE 3420ENDPROC 3430: 3440REM ******************************************************** 3450REM Start Up program as a task with name "Video Inlay Printer" 3460REM And put icon on the Icon bar 3470REM ******************************************************** 3480DEF PROC_Initialise_WIMP_System 3490 MyTaskName$="Video Inlay Printer" 3500 SYS "Wimp_Initialise",200,&4B534154,MyTaskName$ TO ver%,My_id% 3510 IconBarIconHandle%=FN_CreateIconBarIcon 3520 PROC_Initialise_Sprites 3530 PROC_Initialise_Templates 3540 Mask%=%1100000110001 : REM Mask Out codes for Gain/Lose Caret, Pointer Enter/Leave Window & Null Event 3550ENDPROC 3560: 3570REM *********************************************************** 3580REM All WIMP Programs should be able to shut themselves down!!! 3590REM *********************************************************** 3600DEF PROC_CloseDown 3610 SYS "Wimp_CloseDown",My_id%,&4B534154 3620 SYS "OS_Exit" 3630ENDPROC 3640: 3650REM **************************************************************** 3660REM Opens up the template file, Fondles it, and then creates Windows 3670REM **************************************************************** 3680DEF PROC_Initialise_Templates 3690 maxws%=&900 : DIM ws% maxws% : curws%=ws% 3700 SYS"Wimp_OpenTemplate",,"<Video$Dir>.Resources.Templates" 3710 SYS"Wimp_LoadTemplate",,Block%,ws%,ws%+maxws%,-1,"info",0 TO ,,curws% 3720 SYS"Wimp_CreateWindow",,Block% TO Info% 3730 SYS"Wimp_LoadTemplate",,Block%,curws%,ws%+maxws%,-1,"save",0 TO ,,curws% 3740 SYS"Wimp_CreateWindow",,Block% TO Save% 3750 SYS"Wimp_LoadTemplate",,Block%,curws%,ws%+maxws%,-1,"Main",0 TO ,,curws% 3760 SYS"Wimp_CreateWindow",,Block% TO Main% 3770 SYS"Wimp_LoadTemplate",,Block%,curws%,ws%+maxws%,-1,"Print_Opt",0 TO ,,curws% 3780 Block%!64 = SpriteArea% 3790 SYS"Wimp_CreateWindow",,Block% TO Options% 3800 SYS"Wimp_CloseTemplate" 3810ENDPROC 3820: 3830REM ******************************************************************* 3840REM This writes over the text in the Icon, and it should not be done!!! 3850REM Only Works With Indirected Text Strings! 3860REM ******************************************************************* 3870DEF PROC_SetIconText(IconHandle%,WindowHandle%,Text$) 3880 LOCAL Pointer% 3890 Block%!0=WindowHandle% 3900 Block%!4=IconHandle% 3910 SYS "Wimp_GetIconState",,Block% 3920 IF (Block%!24 AND (1<<8))<>0 THEN 3930 Pointer%=Block%!28 3940 ELSE 3950 Pointer%=Block%+28 3960 ENDIF 3970 $Pointer%=Text$ 3980ENDPROC 3990: 4000REM ************************************** 4010REM The name sort of says it all really!!! 4020REM ************************************** 4030DEF PROC_SetUpIconBarMenu 4040 LOCAL m% 4050 DIM menu% 28+6*24 4060 $menu%="Video" 4070 menu%?12=`black 4080 menu%?13=`grey2 4090 menu%?14=`black 4100 menu%?15=`white 4110 menu%!16=128 4120 menu%!20=40 4130 menu%!24=0 4140 4150 m%=menu%+28 4160 m%!0=&0 4170 m%!4=Info% :REM name from template open. 4180 m%!8=(7<<24) OR %10001 4190 $(m%+12)="Info" 4200 4210 m%=m%+24 4220 m%!0=&02 4230 m%!4=Options% 4240 m%!8=(7<<24) OR %10001 4250 $(m%+12)="Options" 4260 4270 m%=m%+24 4280 IF InlayType$="Video_8" THEN m%!0=&01 ELSE m%!0=&00 4290 m%!4=0 4300 m%!8=(7<<24) OR %10001 4310 $(m%+12)="Video 8" 4320 4330 m%=m%+24 4340 IF InlayType$="VHS_C" THEN m%!0=&01 ELSE m%!0=&00 4350 m%!4=0 4360 m%!8=(7<<24) OR %10001 4370 $(m%+12)="VHS C" 4380 4390 m%=m%+24 4400 IF InlayType$="DAT" THEN m%!0=&03 ELSE m%!0=&02 4410 m%!4=0 4420 m%!8=(7<<24) OR %10001 : REM to grey icon out add 'OR 1<<22' to the end of the line 4430 $(m%+12)="DAT" 4440 4450 m%=m%+24 4460 m%!0=&80 4470 m%!4=0 4480 m%!8=(7<<24)OR %10001 4490 $(m%+12)="Quit" 4500ENDPROC 4510: 4520REM ************************************************************* 4530REM This takes a Sprite and makes it into an Icon For the IconBar 4540REM ************************************************************* 4550DEF FN_CreateIconBarIcon 4560 LOCAL Icon% 4570 Block%!0=-1 4580 Block%!4=0 4590 Block%!8=0 4600 Block%!12=68 4610 Block%!16=68 4620 Block%!20=%10000000000010 4630 $(Block%+24)="!Video" 4640 SYS "Wimp_CreateIcon",,Block% TO Icon% 4650=Icon% 4660: 4670REM ********************************************* 4680REM Read Info for Window Main, and then open it ! 4690REM ********************************************* 4700DEF PROC_OpenMainWindow(WipeTemplateIconText%) 4710 IF WipeTemplateIconText% AND New% THEN PROC_WipeIconText 4720 !Block%=Main% 4730 SYS "Wimp_GetWindowState",,Block% 4740 SYS "Wimp_OpenWindow",,Block% 4750 New%=FALSE 4760 PROC_SetCaretPosition(BtmSetIndexEnd%,0) 4770 MainWindowOpen%=TRUE 4780ENDPROC 4790: 4800REM ********************************************************************** 4810REM This reads the text from the writable Icon specified in the parameters 4820REM and if Pad%<>FALSE TRUE then pads out the result to required size. 4830REM ********************************************************************** 4840DEF FN_ReadIconText(WindowHandle%,IconHandle%,Pad%) 4850 LOCAL Result$ 4860 Block%!0=WindowHandle% 4870 Block%!4=IconHandle% 4880 SYS "Wimp_GetIconState",,Block% 4890 IF (Block%!24 AND (1<<8))<>0 THEN 4900 Result$=$(Block%!28) 4910 ELSE 4920 Result$=$(Block%+28) 4930 ENDIF 4940 IF Pad%>0 THEN =LEFT$(Result$+STRING$(Pad%," "),Pad%) 4950=Result$ 4960: 4970REM ***************************************** 4980REM Wipe the text from all the writable icons 4990REM ***************************************** 5000DEF PROC_WipeIconText 5010 LOCAL ItemText$,IndexText$,TapeNumberText$,Loop% 5020 ItemText$="" : IndexText$="" 5030 FOR Loop%=TopSetIndexStart% TO BtmSetItemEnd% STEP 2 5040 PROC_SetIconText(Loop%,Main%,IndexText$) : PROC_SetIconText(Loop%+1,Main%,ItemText$) 5050 PROC_Redraw(Main%,Loop%) : PROC_Redraw(Main%,Loop%+1) 5060 NEXT 5070 FOR Loop%=TitleFirstLine% TO TitleLastLine% 5080 PROC_SetIconText(Loop%,Main%,ItemText$) : PROC_Redraw(Main%,Loop%) 5090 NEXT 5100 PROC_SetIconText(TapeNumber%,Main%,TapeNumber$) 5110 PROC_SetIconText(UserNote%,Main%,ItemText$) 5120 PROC_Redraw(Main%,TapeNumber%) 5130 PROC_Redraw(Main%,UserNote%) 5140ENDPROC 5150: 5160REM ************************************** 5170REM The name sort of says it all really!!! 5180REM ************************************* 5190DEF PROC_CreateMainWindowMenu(X%,Y%,Icon%) 5200 LOCAL m%,Flags%,Pointer%,Sel%,IconFlag%,Item$ 5210 MainWindowMenuActive%=TRUE : IconBarMenuActive%=FALSE 5220 DIM MainMenu% 29+7*24 5230 $MainMenu%="Main" 5240 MainMenu%?12=`black 5250 MainMenu%?13=`grey2 5260 MainMenu%?14=`black 5270 MainMenu%?15=`white 5280 MainMenu%!16=16*16 5290 MainMenu%!20=40 5300 MainMenu%!24=0 5310 m%=MainMenu%+28 5320 REPEAT 5330 READ Flags%,Pointer%,Sel%,IconFlag%,Item$ 5340 m%!0=Flags% :REM Menu Flags 5350 m%!4=Pointer% :REM Pointer to Sub-Menu (-1 If None) 5360 m%!8=IconFlag% OR (Sel%<<22) OR (7<<24) :REM Menu Icon Flags 5370 $(m%+12)=Item$ :REM Item Name (12 Bytes Max.) 5380 m%=m%+24 5390 UNTIL Flags%=&80 5400 : 5410 RESTORE +0 5420 DATA &00,Info%,0,%10001,"Info" 5430 DATA &00,Save%,0,%10001,"Save data" 5440 DATA &00,Options%,0,%10001,"Options" 5450 DATA &00,-1,0,%10001,"Format" 5460 DATA &80,-1,0,%10001,"Wipe all" 5470 : 5480 SYS "Wimp_CreateMenu",,MainMenu%,X%-96,Y% 5490ENDPROC 5500: 5510REM ****************************************************************************** 5520REM Control Comes To Here When The User Has Dragged The Save Icon And Released It. 5530REM ****************************************************************************** 5540DEF PROC_DragBoxEnd(LeafName$) 5550 Pointer%=LENLeafName$ 5560 WHILE Pointer%>0 AND MID$(LeafName$,Pointer%,1)<>"." 5570 Pointer%-=1 5580 ENDWHILE 5590 LeafName$=MID$(LeafName$,Pointer%+1) 5600 SYS "Wimp_GetPointerInfo",,Block% 5610 SenderWindow%=Block%!12 5620 SenderIcon%=Block%!16 5630 Block%!20=SenderWindow% 5640 Block%!24=SenderIcon% 5650 Block%!28=Block%!0 5660 Block%!32=Block%!4 5670 Block%!0=44+LENLeafName$ 5680 Block%!0+=4-(Block%!0 MOD 4) 5690 Block%!4=0 5700 Block%!8=0 5710 Block%!12=0 5720 Block%!16=1 : REM Message_DataSave 5730 Block%!36=0 : REM Length of proposed save 5740 Block%!40=MyFileType% 5750 $(Block%+44)=LeafName$+CHR$0 5760 IF NOT ((SenderWindow%=Save%) OR (SenderWindow%=Main%) OR (SenderWindow%=IconBar% AND SenderIcon%=IconBarIconHandle%)) THEN 5770 SYS "Wimp_SendMessage",usr_message%,Block%,SenderWindow%,SenderIcon% 5780 ENDIF 5790ENDPROC 5800: 5810REM ****************************************************** 5820REM A Data Save Acknowlegement Message Has Been Received! 5830REM ****************************************************** 5840DEF PROC_HandleMessage_DataSaveAck 5850 LOCAL PathName$,Pointer% 5860 Pointer%=Block%+44 5870 REPEAT 5880 PathName$+=CHR$?Pointer% 5890 Pointer%+=1 5900 UNTIL ?Pointer%=0 5910 PROC_SaveTo(PathName$) 5920 Block%!0=40+LENPathName$+4 5930 Block%!0+=4-(Block%!0 MOD 4) 5940 Block%!16=msg_dataload% 5950 Block%!36=0 5960 Block%!40=MyFileType% 5970 $(Block%+44)=PathName$+CHR$(0) 5980 SYS "Wimp_SendMessage",usr_msgrecorded%,Block%,SenderWindow%,SenderIcon% 5990ENDPROC 6000: 6150REM ***************************************************** 6160REM Read a string from a pointer, using a zero-terminator 6170REM ***************************************************** 6180DEF FN_ReadString(Pointer%) 6190 LOCAL String$ 6200 WHILE ?Pointer%<>0 6210 String$+=CHR$?Pointer% 6220 Pointer%+=1 6230 ENDWHILE 6240=String$ 6250: 6260REM ************************************************************************ 6270REM This Bit Does The Actual Saving Of The Data When Requested By The Filer. 6280REM ************************************************************************ 6290DEF PROC_SaveTo(PathName$) 6300 Pointer%=LENPathName$ 6310 WHILE Pointer%>1 AND MID$(PathName$,Pointer%,1)<>"." 6320 Pointer%-=1 6330 ENDWHILE 6340 IF Pointer%=1 THEN ERROR 2001,"To save: Drag the icon to a directory viewer" 6350 SYS "Wimp_CreateMenu",,-1 6360 SYS "OS_Byte",3,2 6370 OSCLI("SPOOL "+PathName$) 6380 REM First print out an identifier, so I can tell if it is my file! 6390 PRINT MyFileIdentifier$;CHR$(10); 6400 REM Open Out A File And Print Out All the information! 6410 FOR Loop%=TopSetIndexStart% TO TapeNumber% 6420 PRINT FN_ReadIconText(Main%,Loop%,FALSE);CHR$(10); 6430 NEXT 6440 PRINT FN_ReadIconText(Main%,UserNote%,FALSE);CHR$(10); 6450 REM Then Close the file again 6460 *SPOOL 6470 SYS "OS_Byte",3,0 6480 OSCLI "SetType "+PathName$+" "+STR$~(MyFileType%) 6490 REM Overwrite leafname text with "BoffBright" to enable auto insertion of the tape number for the file name! 6500 PathName$=LEFT$(PathName$,Pointer%)+"BoffBright" 6510 PROC_SetIconText(4,Save%,PathName$) 6520ENDPROC 6530: 6540REM ********************************************************* 6550REM This Handles The Dragging Of THe Outline Of The Save Box. 6560REM ********************************************************* 6570DEF PROC_DragSave 6580 !Block%=Save% 6590 SYS "Wimp_GetWindowState",,Block% 6600 OffsetX%=Block%!4-Block%!20 6610 OffsetY%=Block%!16-Block%!24 6620 Block%!0=Save% 6630 Block%!4=0 6640 SYS "Wimp_GetIconState",,Block% 6650 !Block%=Save% 6660 Block%!4=5 6670 Block%!8=Block%!8+OffsetX% 6680 Block%!12=Block%!12+OffsetY% 6690 Block%!16=Block%!16+OffsetX% 6700 Block%!20=Block%!20+OffsetY% 6710 Block%!24=0 6720 Block%!28=0 6730 Block%!32=&7FFFFFFF 6740 Block%!36=&7FFFFFFF 6750 SYS "Wimp_DragBox",,Block% 6760ENDPROC 6770: 6780REM ********************************************************** 6790REM When A File Is Dropped Onto My Icon Bar Icon, I Come Here! 6800REM ********************************************************** 6810DEF PROC_FileDroppedOnMe 6820 IF Block%!40 =MyFileType% THEN 6830 SaveName$=FN_ReadString(Block%+44) 6840 Block%!12=Block%!8 6850 Block%!16=4 6860 SYS "Wimp_SendMessage",usr_message%,Block%,Block%!4 6870 PROC_DoActualLoadThing(SaveName$) 6880 ENDIF 6890 IF Block%!40 =ConfigFile% THEN 6900 PROC_ReadUserData 6910 IF InlayType$="Video_8" THEN 6920 menu%!(28+24*2)=Ticked% 6930 menu%!(28+24*3)=NotTicked% : REM Tick Item 2, Untick Item 3 6940 menu%!(28+24*4)=NotTicked% OR Underlined% 6950 ENDIF 6960 IF InlayType$="VHS_C" THEN 6970 menu%!(28+24*2)=NotTicked% 6980 menu%!(28+24*3)=Ticked% : REM Tick Item 3, Untick Item 2 6990 menu%!(28+24*3)=NotTicked% OR Underlined% 7000 ENDIF 7010 IF InlayType$="DAT" THEN 7020 menu%!(28+24*2)=NotTicked% 7030 menu%!(28+24*3)=NotTicked% : REM Tick Item 3, Untick Item 2 7040 menu%!(28+24*3)=Ticked% OR Underlined% 7050 ENDIF 7060 ENDIF 7070ENDPROC 7080: 7090REM ******************************************************************************* 7100REM Control Comes Here When A Valid File Type Has Been Dropped Onto My Application. 7110REM ******************************************************************************* 7120DEF PROC_LoadData(FileName$) 7130 LoadFile%=OPENIN(FileName$) 7140 TempText$=GET$#(LoadFile%) 7150 IF TempText$<>MyFileIdentifier$ THEN CLOSE #LoadFile% : ERROR 2001,"Not a !Video saved file." 7160 FOR LoadLoop%=TopSetIndexStart% TO TapeNumber% 7170 TempText$=GET$#(LoadFile%) 7180 PROC_SetIconText(LoadLoop%,Main%,TempText$) 7190 PROC_Redraw(Main%,LoadLoop%) 7200 NEXT 7210 TempText$=GET$#(LoadFile%) 7220 PROC_SetIconText(UserNote%,Main%,TempText$) 7230 PROC_Redraw(Main%,UserNote%) 7240 CLOSE #LoadFile% 7250ENDPROC 7260: 7270REM ********************************************************************* 7280REM Reads State Of Icons in Window Stated and Returns The First Selected 7290REM Icon In The Give Exclusive Selection Group. (-1 = None Selected) 7300REM ******************************************************************** 7310DEF FN_ReadESGSelected(WindowHandle%,Esg%) 7320 LOCAL Mask%,Pattern% 7330 Mask% = (1<<21)+(31<<16) : REM Bit 21 and Bits 16-20 7340 Pattern%= (1<<21)+(Esg%<<16) : REM Selected and ESG X 7350 SYS "Wimp_WhichIcon",WindowHandle%,Block%+200,Mask%,Pattern% 7360=Block%!200 7370: 7380: 7390REM *************************************************************************************************** 7400REM ALTHOUGH A LOT OF THE ABOVE CODE IS STILL VERY SPECIFIC TO THIS PROGRAM, IT CAN BE EASILY ADAPTED 7410REM ALL CODE BELOW THIS LINE IS UNLIKELY TO BE OF MUCH USE TO ANY OTHER APPLICATION 7420REM *************************************************************************************************** 7430: 7440: 7450REM ************************************************ 7460REM Move Caret Up To The Next Entry, With Wrap-round 7470REM ************************************************ 7480DEF PROC_MoveUpAnEntry 7490 LOCAL I% 7500 IF Icon%<=(BtmSetItemEnd%-2) THEN I%=Icon%+2 7510 IF Icon%=BtmSetIndexEnd% OR Icon%=BtmSetItemEnd% THEN I%=Icon%-48 7520 IF Icon%>TitleFirstLine% AND Icon%<=TitleLastLine% THEN I%=Icon%-1 7530 IF Icon%=TitleFirstLine% THEN I%=TitleLastLine% 7540 IF Icon%=TitleFirstLine% AND CantGoToLastTitle% THEN I%=Icon%+1 7550 PROC_SetCaretPosition(I%,Index%) 7560ENDPROC 7570: 7580REM ********************************************** 7590REM Move Caret Down To Next Entry, With Wrap-round 7600REM ********************************************** 7610DEF PROC_MoveDownAnEntry 7620 LOCAL I% 7630 IF Icon%>=(TopSetIndexStart%+2) THEN I%=Icon%-2 7640 IF Icon%=TopSetIndexStart% OR Icon%=TopSetItemStart% THEN I%=Icon%+48 7650 IF Icon%<TitleLastLine% AND Icon%>=TitleFirstLine% THEN I%=Icon%+1 7660 IF Icon%=TitleLastLine% THEN I%=TitleFirstLine% 7670 IF Icon%=TitleFirstLine%+1 AND CantGoToLastTitle% THEN I%=TitleFirstLine% 7680 PROC_SetCaretPosition(I%,Index%) 7690ENDPROC 7700: 7710DEF PROC_MoveDownOneBackOne 7720 IF Icon%>(TopSetIndexStart%+2) THEN PROC_SetCaretPosition(Icon%-3,0) 7730 IF Icon%=TopSetItemStart% THEN PROC_SetCaretPosition(Icon%+47,0) 7740ENDPROC 7750: 7760REM ********************************************************** 7770REM Printout the contents of the writable icons!!! 7780REM ********************************************************** 7790DEF PROC_PrintOut 7800 CASE FN_ReadESGSelected(Options%,9) OF 7810 WHEN 0 : PROC_PrintTextMode(NlqON$,InlayType$) 7820 WHEN 1 : PROC_PrintTextMode(NlqOFF$,InlayType$) 7830 WHEN 5 : PROC_PrintGraphicsMode(InlayType$) 7840 OTHERWISE ERROR 2001, "ModeErr" 7850 ENDCASE 7860ENDPROC 7870: 7880REM ***************************************************** 7890REM Print out the label in text mode (non Risc OS) 7900REM Parameter is an optional control string (ie NLQ etc.) 7910REM ***************************************************** 7920DEF PROC_PrintTextMode(Prelog$,InlayType$) 7930 LOCAL L% 7940 IF FN_Printer_NotOnLine THEN ENDPROC 7950 SYS "Hourglass_On" 7960 : 7970 SYS "OS_Byte",3,10 :REM SCREEN OFF, PRINTER ON. 7980 PROC_SendData(Prelog$) :REM Set NLQ Mode 7990 : 8000 PROC_DoPrinting(InlayType$) 8010 : 8020 FOR L%=0 TO VAL(FormLength$) 8030 PRINT :REM short Form Feed 8040 NEXT 8050 : 8060 SYS "OS_Byte",3,00 :REM SCREEN ON, PRINTER OFF. 8070 SYS "Hourglass_Off" 8080ENDPROC 8090: 8100DEF FN_Centre(Text$,Width%) 8110NewText$=STRING$((Width%-LEN(Text$))/2," ")+Text$ 8120NewText$=NewText$+STRING$(Width%-LEN(NewText$)," ") 8130=NewText$ 8140: 8150REM ********************************************************** 8160REM Function to check if printer is on line, 8170REM If printer is not online TRUE is returned, otherwise FALSE 8180REM ********************************************************** 8190DEF FN_Printer_NotOnLine 8200 SYS "Hourglass_On" 8210 REPEAT 8220 PrinterOnLine=TRUE : What%=0 8230 Now%=TIME 8240 Before%=ADVAL(-4) 8250 VDU 2,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,3 8260 Now%=TIME : REPEAT UNTIL TIME>Now%+100 8270 After%=ADVAL(-4) 8280 IF Before%<>After% THEN 8290 SYS "Hourglass_Off" 8300 PrinterOnLine=FALSE 8310 $Block%="The printer is not responding. Please check it has paper, it is switched on and on-line. Try again?" 8320 SYS "Wimp_ReportError",Block%,%10011,MyTaskName$ TO ,What% 8330 SYS "Hourglass_On" 8340 ENDIF 8350 UNTIL PrinterOnLine OR (NOT PrinterOnLine AND What%=2) 8360 SYS "Hourglass_Off" 8370 IF What%=2 THEN =TRUE 8380=FALSE 8390: 8400REM ****************************************************************** 8410REM Prints contents of Icon(Icon%) right justified in a field of Chars 8420REM ****************************************************************** 8430DEF FN_RightJustify(Icon%,Char%) 8440 Text$=FN_ReadIconText(Main%,Icon%,FALSE) 8450=STRING$(Char%-LEN(Text$)," ")+Text$ 8460: 8470REM ********************************************************************** 8480REM This is purely for program variables and is nothing to do with Risc_OS 8490REM ********************************************************************** 8500DEF PROC_Initialise_Program_Variables 8510 REM Initailise Global variables first, These are usable in all RISCOS WIMP programs. 8520 `white = 0 : `grey1 = 1 : `grey2 = 2 : `grey3 = 3 : `grey4 = 4 : `grey5 = 5 : `grey6 = 6 : `black = 7 8530 `dark_blue = 8 : `yellow = 9 : `green = 10 : `red = 11 : `cream = 12 : `army_green = 13 : `orange = 14 : `light_blue = 15 8540 msg_quit% = 0 : msg_datasave% = 1 : msg_dsaveACK% = 2 : msg_dataload% = 3 : msg_dloadACK% = 4 8550 msg_RAMfetch% = 6 : msg_RAMtrans% = 7 : usr_message% = 17 : usr_msgrecorded% = 18 : msg_taskinit% = &400C2 8560 msg_help% = &502 : msg_helpACK% = &503 8570 : 8580 REM Variables to do with RiscOS PDriver InterFace 8590 Box%=Box% : IF Box%<>0 THEN ENDPROC 8600 DIM Box% 16 : DIM Box2% 16 8610 ScaleX%=1 : ScaleY%=1 :REM For Future Expansion? 8620 DIM Matrix% 16 8630 Matrix%!04=0 : Matrix%!00=2^16*ScaleX% 8640 Matrix%!08=0 : Matrix%!12=2^16*ScaleY% 8650 DIM Origin% 8 8660: 8670 REM Global variables, specific to this program. 8680 LongEqual_8$ = "|"+STRING$(44,"=")+"|" : LongEqual_C$ = "|"+STRING$(42,"=")+"|" 8690 LongMinus_8$ = "|"+STRING$(44,"-")+"|" : LongMinus_C$ = "|"+STRING$(42,"-")+"|" 8700 BlankLine_8$ = "|"+STRING$(44," ")+"|" : BlankLine_C$ = "|"+STRING$(42," ")+"|" 8710 New% = TRUE 8720 NLQ% = TRUE 8730 NlqON$ = "27,120,1" 8740 NlqOFF$ = "27,120,0" 8750 EliteON$ = "27,77" : REM Set 12 Characters per Inch 8760 EmphasisedON$ = "27,69" : REM Select Emphasised Mode 8770 EmphasisedOFF$ = "27,70" : REM Deselect Emphasised Mode 8780 PrintFile$ = "PrintOut" 8790 InlayType$ = "Video_8" : REM Default to Video_8 format 8800 LatestVer% = 4 : REM Version Number Of Config File. Change If File Is Made Incompatable..... 8810 MainWindowOpen% = FALSE 8820 WindowTitle$ = " Video Inlay Printer " : DatTitle$ = " DAT Inlay Printer " 8830 CantGoToLastTitle%=FALSE 8840 OldName$ = "" 8850: 8860 REM Give names to some of the icons etc. to make the program more readable 8870 MyFileType%=&FFF : ConfigFile%=&D0B 8880 MyFileIdentifier$="!Video Saved Inlay File. � M.S.Bright 1992" 8890 BackGround%= -1 : IconBar%= -2 8900 TopSetIndexStart%=00 : TopSetIndexEnd%=22 : TopSetItemStart%=01 : TopSetItemEnd%=23 8910 BtmSetIndexStart%=24 : BtmSetIndexEnd%=48 : BtmSetItemStart%=25 : BtmSetItemEnd%=49 8920 TitleFirstLine%=51 : TitleLastLine%=53 8930 NumberOfLines%=56 : Format%=66 8940 TapeNumber%=54 : UserNote% =67 : DriverName%=59 8950 PrintF% =65 : PrintL% =64 : PrintD% =63 8960 OptionsOKF%=28 : OptionsOKL%=26 : OptionsOKD%=27 8970 NlqON%=12 : NlqOFF%=16 : FormLength%=20 : EliteON%=34 8980 SaveOKF% =11 : SaveOKL% =9 : SaveOKD% =10 : SaveIcon%= 0 8990 Ticked%=%1 : NotTicked%=0 : Underlined%=%10 9000 DIM PDriver$(6) 9010 PDriver$(0)="Null:" : PDriver$(1)="NLQ Printer" 9020 PDriver$(2)="Draft Printer" : PDriver$(6)="RiscOS Driver" 9030 PROC_ReadUserData 9040 PROC_SetUpIconBarMenu 9050: 9060 REM Get SWI Numbers for font calls to speed up bottleneck in code 9070 SYS "OS_SWINumberFromString",,"Font_FindFont" TO Find% 9080 SYS "OS_SWINumberFromString",,"Font_LoseFont" TO Lose% 9090 SYS "OS_SWINumberFromString",,"Font_SetFont" TO Set% 9100 SYS "OS_SWINumberFromString",,"Font_Paint" TO Paint% 9110: 9120 BaseFont$=FN_ConvertSystemToString("Video$BaseFont") 9130 EdgeFont$=FN_ConvertSystemToString("Video$EdgeFont") 9140 BoldFont$=FN_ConvertSystemToString("Video$BoldFont") 9150 TapeNumber$=FN_ConvertSystemToString("Tape$Prefix") 9160 IF LEN(TapeNumber$)>3 THEN 9170 Clipped$=LEFT$(TapeNumber$,3) 9180 !Block%=9090 9190 Error$="Tape$Prefix is set to longet than 3 characters. OK to clip to "+Clipped$+" Cancel to abort program" 9200 $(Block%+4)=Error$ + CHR$0 9210 SYS "Wimp_ReportError",Block%,%011,MyTaskName$ TO ,Result% 9220 IF Result%=2 THEN PROC_CloseDown 9230 TapeNumber$=Clipped$+" 00" 9240 ELSE 9250 TapeNumber$=TapeNumber$+" 00" 9260 ENDIF 9270ENDPROC 9280: 9290DEF FN_ConvertSystemToString(Variable$) 9300 LOCAL Loop% 9310 FOR Loop%=100 TO 150 STEP 4 : Block%!Loop%=0 : NEXT 9320 SYS "OS_ReadVarVal",Variable$,Block%+100,50,0,3 9330=FN_ReadString(Block%+100) 9340 : 9350REM ***************************************************************************** 9360REM Store User Configurable Settings In Config File Within !Video8 Application. 9370REM ***************************************************************************** 9380DEF PROC_StoreUserData 9390 DataFile%=OPENOUT"<Video$Dir>.Resources.Config" 9400 BPUT #DataFile%,LatestVer% 9410 PRINT #DataFile%,FN_ReadIconText(Options%,NlqON%,FALSE) 9420 PRINT #DataFile%,FN_ReadIconText(Options%,NlqOFF%,FALSE) 9430 PRINT #DataFile%,FN_ReadIconText(Options%,FormLength%,FALSE) 9440 PRINT #DataFile%,FN_ReadIconText(Options%,EliteON%,FALSE) 9450 PRINT #DataFile%,FN_ReadIconText(Main%,Format%,FALSE) 9460 PRINT #DataFile%,FN_ReadESGSelected(Options%,9) 9470 CLOSE #DataFile% 9480 SYS "Wimp_CreateMenu",,-1 9490ENDPROC 9500: 9510REM **************************************************************************** 9520REM Read User Configurable Settings In Config File Within !Video8 Application. 9530REM **************************************************************************** 9540DEF PROC_ReadUserData 9550 DataFile%=OPENIN"<Video$Dir>.Resources.Config" 9560 IF DataFile%=0 THEN ENDPROC 9570 Ver%=BGET#DataFile% 9580 INPUT #DataFile%,NlqON$ 9590 INPUT #DataFile%,NlqOFF$ 9600 INPUT #DataFile%,FormLength$ 9610 INPUT #DataFile%,EliteON$ 9620 INPUT #DataFile%,InlayType$ 9630 INPUT #DataFile%,SelectedPrinterIcon 9640 CLOSE #DataFile% 9650 IF Ver%<LatestVer% THEN ERROR 1000,"ConfigErr" 9660 IF SelectedPrinterIcon=15 THEN SelectedPrinterIcon=5 : REM Fudge for template change - Stu 9670 PROC_SetIconText(20,Options%,FormLength$) 9680 PROC_Redraw(Options%,20) 9690 PROC_SetIconText(12,Options%,NlqON$) 9700 PROC_Redraw(Options%,12) 9710 PROC_SetIconText(16,Options%,NlqOFF$) 9720 PROC_Redraw(Options%,16) 9730 PROC_SetIconText(DriverName%,Main%,PDriver$(SelectedPrinterIcon+1)) 9740 PROC_Redraw(Main%,DriverName%) 9750 PROC_SetIconText(Format%,Main%,InlayType$) 9760 PROC_Redraw(Main%,Format%) 9770 PROC_SelectIcon(Options%,0,SelectedPrinterIcon=0) 9780 PROC_SelectIcon(Options%,1,SelectedPrinterIcon=1) 9790 PROC_SelectIcon(Options%,5,SelectedPrinterIcon=5) 9800ENDPROC 9810: 9820DEF PROC_SelectIcon(Window%,Icon%,Flag%) 9830 Block%!0=Window% 9840 Block%!4=Icon% 9850 Block%!8=(-1*Flag%)<<21 9860 Block%!12=1<<21 9870 SYS "Wimp_SetIconState",,Block% 9880ENDPROC 9890: 9900DEF PROC_NotSelectable(Window%,Icon%,Flag%) 9910 Block%!0=Window% 9920 Block%!4=Icon% 9930 REM Make unselectable / Selectable 9940 Block%!8=(-1*Flag%)<<22 9950 Block%!12=1<<22 9960 SYS "Wimp_SetIconState",,Block% 9970 REM Make non-writable / Writable 9980 IF Flag%=TRUE THEN Block%!8=%0000<<12 ELSE Block%!8=%1111<<12 9990 Block%!12=%1111<<12 10000 SYS "Wimp_SetIconState",,Block% 10010 CantGoToLastTitle%=Flag% 10020 IF Flag% AND MainWindowOpen% THEN PROC_SetCaretPosition(TitleFirstLine%,0) 10030ENDPROC 10040: 10050REM **************************************************************************************** 10060REM This Takes A 'Numeric' String, Breaks it Down, And Sends The Value To The Output Device. 10070REM **************************************************************************************** 10080DEF PROC_SendData(Data$) 10090 LOCAL Finish%,Count% 10100 Count%=0 : Finish%=LEN(Data$) 10110 Data$=Data$+"," : REM This is cheating...See WHILE Condition!!!!!! 10120 REPEAT 10130 Sub$="" 10140 Pointer%=1 10150 WHILE MID$(Data$,Pointer%,1)<>"," 10160 Sub$=Sub$+MID$(Data$,Pointer%,1) 10170 Pointer%+=1 10180 ENDWHILE 10190 Data$=MID$(Data$,Pointer%+1) 10200 PRINT CHR$(VAL(Sub$)); 10210 Count%=Count%+LEN(Sub$)+1 10220 UNTIL Count%>=Finish% 10230ENDPROC 10240: 10250*************************************************************************************************** 10260REM Sets The Save Name In The Save Icon To The Full Pathname Of The Loaded File, And Then Loads It. 10270*************************************************************************************************** 10280DEF PROC_DoActualLoadThing(FileName$) 10290 PROC_SetIconText(4,Save%,FileName$) 10300 PROC_LoadData(FileName$) 10310 PROC_OpenMainWindow(FALSE) 10320ENDPROC 10330: 10340**************************************************************** 10350REM Initialises User Sprite Area, and Loads sprite file into it. 10360**************************************************************** 10370DEF PROC_Initialise_Sprites 10380 Temp%=OPENUP "<Video$Dir>.Resources.Sprites" 10390 FileLength%=4+(EXT#Temp%) 10400 CLOSE #Temp% 10410 DIM SpriteArea% FileLength% 10420 SpriteArea%!0=FileLength% 10430 SpriteArea%!4=0 10440 SpriteArea%!8=16 10450 SpriteArea%!12=16 10460 SYS "OS_SpriteOp",&10A,SpriteArea%,"<Video$Dir>.Resources.Sprites" 10470ENDPROC 10480: 10490******************************************* 10500REM Communicate with RiscOS Printer Driver. 10510******************************************* 10520DEF PROC_PrintGraphicsMode(InlayType$) 10530 REM Check For Presence Of PrinterDriver Modules 10540 SYS "XOS_SWINumberFromString",,"PDriver_Info" TO ;Flag% 10550 IF Flag% AND 1 THEN ERROR 2001,"No Printer Driver, Please Load and Try Again" 10560: 10570 LOCAL PrintFile%,OldJob% 10580 LOCAL White%, PageToPrint% 10590 White%=&FFFFFF00 : E%=0 : Usage%=0 10600 PrintFile%=OPENOUT"printer:" 10610 LOCAL ERROR 10620 ON ERROR LOCAL : RESTORE ERROR : F%=ERL : F$=REPORT$ : CLOSE #PrintFile% : IF E%=0 THEN ERROR F%,F$ ELSE ERROR E%,F$ 10630 SYS "PDriver_SelectJob",PrintFile%,"Boffin Print Job" TO OldJob% 10640 SYS "Hourglass_On" 10650 LOCAL ERROR 10660 ON ERROR LOCAL : RESTORE ERROR : E%=ERL : E$=REPORT$ : SYS "Hourglass_Off" : SYS "PDriver_AbortJob",PrintFile% : SYS "PDriver_SelectJob",OldJob% : ERROR E%,E$ 10670 IF InlayType$="Video_8" THEN PROC_GetDocumentSize_8(Box%) 10680 IF InlayType$="VHS_C" THEN PROC_GetDocumentSize_C(Box%) 10690 IF InlayType$="DAT" THEN PROC_GetDocumentSize_D(Box%) 10700 PROC_FitToPage(Height%,Width%) : SYS "PDriver_GiveRectangle",,Box%,Matrix%,Origin%,White% 10710 SYS "PDriver_DrawPage",1,Box2%,0,0 TO CopiesLeft% 10720 WHILE CopiesLeft% 10730 PROC_DrawInlay(Box2%) 10740 SYS "PDriver_GetRectangle",,Box% TO CopiesLeft% 10750 ENDWHILE 10760 SYS "PDriver_EndJob",PrintFile% 10770 RESTORE ERROR 10780 SYS "Hourglass_Off" 10790 SYS "PDriver_SelectJob",OldJob% 10800 RESTORE ERROR 10810 CLOSE #PrintFile% 10820ENDPROC 10830: 10840DEF PROC_OpenSubMenu(Window%) 10850 SYS "Wimp_GetPointerInfo",,Block% 10860 SYS "Wimp_CreateMenu",,Window%,Block%!0-64,Block%!4+48 10870ENDPROC 10880: 10890DEF PROC_FitToPage(Height%,Width%) 10900 LOCAL Left%,Bottom%,Right%,Top% 10910 REM Returns values in Millipoints, Height% & Width% are in OS Units. 1 OS Unit = 400 Millipoints 10920 SYS "PDriver_PageSize" TO ,,,Left%,Bottom%,Right%,Top% 10930 OriginX%=((Right%+Left%)-(Width%*400))/2 : OriginY%=Top%-(Height%*400) 10940 Origin%!0=OriginX% : Origin%!4=OriginY% 10950ENDPROC 10960: 10970DEF PROC_CentreProp(Text$,Y%,Postfix$,Length%) 10980 IF Postfix$="" THEN SYS "Font_SetFont",BaseFontHandle% 10990 IF Postfix$="Bold" THEN SYS "Font_SetFont",BoldFontHandle% 11000 IF Postfix$="Title" THEN SYS "Font_SetFont",EdgeFontHandle% 11010 SYS "Font_StringBBox",,Text$ TO ,,,StringLengthInMillipoints% 11020 IF StringLengthInMillipoints%>(Length%/25.4)*72000 THEN 11030 SYS "Font_StringWidth",,Text$,(Length%/25.4)*72000,15000,-1,LEN(Text$) TO ,,,,NumberOfPrintableCharacters% 11040 TextToPrint$=LEFT$(Text$,NumberOfPrintableCharacters%) 11050 Continue%=FN_WarnAboutClipping(Text$,TextToPrint$) 11060 IF Continue%=FALSE THEN ERROR 2001,"Aborting Printout. OK to Continue" 11070 ENDIF 11080 LengthInMM%=(StringLengthInMillipoints%/72000)*25.4 : X%=(Length%-LengthInMM%)*7.1/2 11090 PROC_FontPaint(Postfix$,Text$,X%,Y%) 11100ENDPROC 11110: 11120***************************************************************** 11130REM Select required Font and colour, then print Message$ at X%,Y% 11140***************************************************************** 11150DEF PROC_FontPaint(PostFix$,Message$,X%,Y%) 11160 LOCAL FontHandle% 11170 IF Message$="" THEN ENDPROC 11180 REM Dont Waste Time Messing about if nothing to print! 11190 IF PostFix$="" THEN SYS "Font_SetFont",BaseFontHandle% 11200 IF PostFix$="Bold" THEN SYS "Font_SetFont",BoldFontHandle% 11210 IF PostFix$="Title" THEN SYS "Font_SetFont",EdgeFontHandle% 11220 SYS "ColourTrans_SetFontColours",0,&FFFFFF00,&00000000 11230 : 11240 REM Don't bother trimming the user-Note as this has got more space to work in than the other icons. 11250 IF PostFix$<>"Bold" THEN Text$=FN_TrimToFit(Message$) 11260 SYS Paint%,,Text$,&10,X%,Y% 11270ENDPROC 11280: 11290REM ***************************************************************************** 11300REM Prints the tape number in a smaller point size at a fixed place on the inlay. 11310REM ***************************************************************************** 11320DEF PROC_PrintTapeNumber 11330 LOCAL Text$,FontHandle% 11340 SYS Find%,,BaseFont$,10*16,10*16,0,0 TO FontHandle% 11350 SYS "ColourTrans_SetFontColours",0,&FFFFFF00,&00000000 11360 : 11370 Text$=FN_ReadIconText(Main%,TapeNumber%,7) 11380 IF InlayType$="VHS_C" THEN SYS Paint%,,Text$,&10,X3%-100,Y3%+130 11390 IF InlayType$="Video_8" THEN SYS Paint%,,Text$,&10,X3%-100,Y3%+82 11400 IF InlayType$="DAT" THEN SYS Paint%,,Text$,&10,X3%-95,Y3%+60 11410 : 11420 SYS Lose%,FontHandle% 11430ENDPROC 11440: 11450REM ***************************************************************************************** 11460REM Check the printed length of the text against the size in pixels, and shorten if required. 11470REM Uses : FN_WarnAboutClipping 11480REM ***************************************************************************************** 11490DEF FN_TrimToFit(Text$) 11500 LOCAL NumberOfPrintableCharacters% 11510 Continue%=TRUE 11520 IF InlayType$="Video_8" THEN Max_X_Size%=(74/25.4)*72000 11530 IF InlayType$="VHS_C" THEN Max_X_Size%=(73/25.4)*72000 11540 IF InlayType$="DAT" THEN Max_X_Size%=(60/25.4)*72000 11550 SYS "Font_StringWidth",,Text$,Max_X_Size%,15000,-1,LEN(Text$) TO ,,,,NumberOfPrintableCharacters% 11560 TextToPrint$=LEFT$(Text$,NumberOfPrintableCharacters%) 11570 IF NumberOfPrintableCharacters%<LEN(Text$) THEN Continue%=FN_WarnAboutClipping(Text$,TextToPrint$) 11580 IF Continue%=FALSE THEN ERROR 2001,"PrintKill" 11590=TextToPrint$ 11600: 11610REM ************************************************************************************ 11620REM If Clipping will occour, then display Warning message and allow user option to abort. 11630REM Uses: NONE 11640REM ************************************************************************************ 11650DEF FN_WarnAboutClipping(IconText$,TextToPrint$) 11660 LOCAL Error$ 11670 !Block%=0 11680 Error$="This text "+IconText$+" does not fit. Clipping to "+TextToPrint$+" OK to continue, CANCEL to abort" 11690 $(Block%+4)=Error$ + CHR$0 11700 SYS "Wimp_ReportError",Block%,%10011,MyTaskName$ TO ,Result% 11710 IF Result%=2 THEN Continue%=FALSE ELSE Continue%=TRUE 11720 SYS "Wimp_ReportError",Block%,1<<6,MyTaskName$ 11730=Continue% 11740: 11750REM ************************************************************ 11760REM Give help to the interactive help by sending a message to it 11770REM ************************************************************ 11780DEF PROC_GiveHelp(Window%,Icon%,MouseX%,MouseY%) 11790 IF Window%=-2 AND Icon%=IconBarIconHandle% THEN 11800 Message$="Video Label Printer|MUtility to print out cassette inlay sleeves for Video camera cassettes, (Video 8 or VHS_C Format only) and DAT audio tapes." 11810 IF New% THEN 11820 Message$+="|<SELECT> to start with blank screen|M|<ADJUST> to start with on-screen hints." 11830 ELSE 11840 Message$+="|<SELECT> or |<ADJUST> to show current Inlay" 11850 ENDIF 11860 PROC_SendHelp(Message$) 11870 ENDIF 11880 IF Window%=Main% THEN 11890 Track%=24-(Icon% DIV 2)+1 11900 CASE Icon% OF 11910 WHEN -13 11920 PROC_SendHelp("This is the Archimedes Video cassette Label Printer.|MDesigned and coded by Mark Bright.|MYou are using version "+Version$+".|M") 11930 WHEN PrintF% 11940 PROC_SendHelp("Click any mouse button to send the contents of the window to the printer.|MPressing the |<PRINT> Key performs the same function.") 11950 WHEN 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48 11960 IF Icon%=00 THEN 11970 Up$="|<CURSOR UP> to move to Index for item 1.|M" 11980 ELSE 11990 Up$="|<CURSOR UP> to move to Index for item "+STR$(Track%+1)+".|M" 12000 ENDIF 12010 IF Icon%=BtmSetIndexEnd% THEN 12020 Down$="|<CURSOR DOWN> to move to Index for item 25.|M" 12030 ELSE 12040 Down$="|<CURSOR DOWN> to move to Index for item "+STR$(Track%-1)+".|M" 12050 ENDIF 12060 Tab$="|<TAB> to move to Title for Item "+STR$(Track%)+".|M" 12070 PROC_SendHelp("Enter the Index for item number "+STR$(Track%)+".|M"+Up$+Down$+Tab$) 12080 WHEN 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49 12090 IF Icon%=01 THEN 12100 Up$="|<CURSOR UP> to move to Title for item 1.|M" 12110 ELSE 12120 Up$="|<CURSOR UP> to move to Title for item "+STR$(Track%+1)+".|M" 12130 ENDIF 12140 IF Icon%=49 THEN 12150 Down$="|<CURSOR DOWN> to move to Title for item 25.|M" 12160 ELSE 12170 Down$="|<CURSOR DOWN> to move to Title for item "+STR$(Track%-1)+".|M" 12180 ENDIF 12190 Tab$="|<TAB> to move to Index for item "+STR$(Track%)+".|M" 12200 PROC_SendHelp("Enter the Title of track number "+STR$(Track%)+".|M"+Up$+Down$+Tab$) 12210 WHEN 51,52,53 12220 Up$ ="|<CURSOR UP> to move to previous line of tape title.|M" 12230 Down$="|<CURSOR DOWN> to move to next line of tape title.|M" 12240 IF Icon%=53 THEN Down$="|<CURSOR DOWN> to move to first line of tape title.|M" 12250 IF Icon%=51 THEN Up$="|<CURSOR UP> to move to third line of tape title.|M" 12260 PROC_SendHelp("Enter the title of the tape.|M"+Up$+Down$) 12270 WHEN TapeNumber% 12280 PROC_SendHelp("This is the Index number for this cassette!") 12290 WHEN DriverName% 12300 PROC_SendHelp("This is the Current Installed Printer - See Options Menu") 12310 WHEN UserNote% 12320 PROC_SendHelp("Enter any notes you wish here, eg Video8 / VideoHI8 / VHS_C format, dates Etc|MIf this is left blank a standard copywrite message will be put in its place") 12330 WHEN Format% 12340 PROC_SendHelp("Display which print format you have currently selected. Note: This is saved with your configuration") 12350 OTHERWISE 12360 PROC_SendHelp("Misc. Help :|M|<f10> - Swap case |<f11> - Delete to end of line|M|<Shift>|<f9> - Wipe all fields. |<Home> - Go to Index #1|M") 12370 12380 ENDCASE 12390 ENDIF 12400 IF Window%=Options% THEN 12410 CASE Icon% OF 12420 WHEN 01 : PROC_SendHelp("Select Draft printing mode") 12430 WHEN 00 : PROC_SendHelp("Select NLQ printing mode") 12440 WHEN 05 : PROC_SendHelp("Select RiscOS printer driver printing mode") 12450 WHEN 12 : PROC_SendHelp("Enter your printer code for NLQ ON if it is different from the code shown.") 12460 WHEN 16 : PROC_SendHelp("Enter your printer code for NLQ OFF if it is different from the code shown.") 12470 WHEN 34 : PROC_SendHelp("Enter your printer code for 12 CPI ON if it is different from the code shown.") 12480 WHEN 20 : PROC_SendHelp("Enter how many lines you want the paper to feed after character mode printing to clear the tear off bar") 12490 WHEN 28 : PROC_SendHelp("Save all the above preferences to the configuration file.") 12500 ENDCASE 12510 ENDIF 12520ENDPROC 12530: 12540REM **************************************************** 12550REM Send the help-giving message to the help application 12560REM **************************************************** 12570DEF PROC_SendHelp(Message$) 12580 Block%!12=Block%!8 12590 Block%!16=msg_helpACK% 12600 !Block%=(LEN(Message$)+25)AND NOT 3 12610 $(Block%+20)=Message$+CHR$0 12620 SYS "Wimp_SendMessage",usr_message%,Block%,Block%!4 12630ENDPROC 12640: 12650REM ********************************************* 12660REM Swaps the case of of the specified character. 12670REM ********************************************* 12680DEF PROC_SwapCase(Window%,Icon%,Index%) 12690 IF Index%<LEN(FN_ReadIconText(Main%,Icon%,FALSE)) THEN 12700 IconText$=FN_ReadIconText(Main%,Icon%,FALSE) 12710 C%=ASC(MID$(IconText$,Index%+1,1)) AND &DF 12720 IF C%>=&41 AND C%<=&5A THEN 12730 C$=CHR$(ASC(MID$(IconText$,Index%+1,1)) EOR &20) 12740 MID$(IconText$,Index%+1,1)=C$ 12750 PROC_SetIconText(Icon%,Window%,IconText$) 12760 PROC_Redraw(Main%,Icon%) 12770 ENDIF 12780 PROC_SetCaretPosition(Icon%,Index%+1) 12790 ENDIF 12800ENDPROC 12810: 12820REM ********************************************************************** 12830REM Sets the case of all the writable icons to ensure a consistant format. 12840REM ********************************************************************** 12850DEF PROC_FormatIconText 12860 LOCAL Loop% 12870 FOR Loop%=TopSetIndexStart% TO BtmSetItemEnd% STEP 2 12880 PROC_SetIconText(Loop%+1,Main%,FN_CEW(Loop%+1)) 12890 PROC_Redraw(Main%,Loop%+1) 12900 NEXT 12910 FOR Loop%=TitleFirstLine% TO TitleLastLine% 12920 PROC_SetIconText(Loop%,Main%,FN_Icon_FTU(Loop%)) 12930 PROC_Redraw(Main%,Loop%) 12940 NEXT 12950 REM User note text is free format, I.E. I do not impose any rules at all! 12960ENDPROC 12970: 12980REM ************************************************* 12990REM Function to Capitalise Each Word in a given Icon. 13000REM ************************************************* 13010DEF FN_CEW(Icon%) 13020 LOCAL IconText$, Index%, End%, C% 13030 IconText$=FN_ReadIconText(Main%,Icon%,FALSE) 13040 REM If icon is empty, abandon format 13050 IF IconText$="" THEN =IconText$ 13060 Index%=1 : End%=LEN(IconText$) 13070 REM Get 1st character 13080 WHILE Index%<=End% 13090 MID$(IconText$,Index%,1)=FN_Char_FTU(Icon%,Index%) 13100 Index%+=1 13110 C$=MID$(IconText$,Index%,1) 13120 REM Loop until end of word (or end of string) 13130 WHILE C$<>" " AND Index%<=End% 13140 MID$(IconText$,Index%,1)=FN_Char_FTL(Icon%,Index%) 13150 Index%+=1 13160 C$=MID$(IconText$,Index%,1) 13170 ENDWHILE 13180 REM Loop until next word found (Or end of string) 13190 WHILE C$=" " AND Index%<=End% 13200 Index%+=1 13210 C$=MID$(IconText$,Index%,1) 13220 ENDWHILE 13230 PRINTIndex%,End% 13240 ENDWHILE 13250=IconText$ 13260: 13270REM ********************************************************* 13280REM Function to Force all text in a given icon to UPPER CASE. 13290REM ********************************************************* 13300DEF FN_Icon_FTU(Icon%) 13310 LOCAL IconText$ 13320 IconText$=FN_ReadIconText(Main%,Icon%,FALSE) 13330 Index%=1 : End%=LEN(IconText$) 13340 WHILE Index%<=End% 13350 MID$(IconText$,Index%,1)=FN_Char_FTU(Icon%,Index%) 13360 Index%+=1 13370 C$=MID$(IconText$,Index%,1) 13380 ENDWHILE 13390=IconText$ 13400: 13410REM ********************************************************* 13420REM Function to Force all text in a given icon to LOWER CASE. 13430REM ********************************************************* 13440DEF FN_Icon_FTL(Icon%) 13450 LOCAL IconText$ 13460 IconText$=FN_ReadIconText(Main%,Icon%,FALSE) 13470 Index%=1 : End%=LEN(IconText$) 13480 WHILE Index%<=End% 13490 MID$(IconText$,Index%,1)=FN_Char_FTL(Icon%,Index%) 13500 Index%+=1 13510 C$=MID$(IconText$,Index%,1) 13520 ENDWHILE 13530: 13540REM ************************************************** 13550REM Function to Force a given character to UPPER CASE. 13560REM ************************************************** 13570DEF FN_Char_FTU(Icon%,Index%) 13580 LOCAL Temp$ 13590 Temp$=MID$(IconText$,Index%,1) 13600 IF Temp$>="a" AND Temp$<="z" THEN Temp$=CHR$(ASC(Temp$) AND &DF) 13610=Temp$ 13620: 13630REM ************************************************** 13640REM Function to Force a given character to LOWER CASE. 13650REM ************************************************** 13660DEF FN_Char_FTL(Icon%,Index%) 13670 LOCAL Temp$ 13680 Temp$=MID$(IconText$,Index%,1) 13690 IF Temp$>="A" AND Temp$<="Z" THEN Temp$=CHR$(ASC(Temp$) OR &20) 13700=Temp$ 13710: 13720REM ************************************************************************************ 13730REM Set up variable for print routine to give correct sizes & format for Video_8 inlays. 13740REM ************************************************************************************ 13750DEF PROC_GetDocumentSize_8(Box%) 13760 PrintTop%=FALSE 13770 FOR L%=TopSetIndexStart% TO TopSetItemEnd% STEP 2 13780 IF FN_ReadIconText(Main%,L%,FALSE)<>"" OR FN_ReadIconText(Main%,L%+1,FALSE)<>"" THEN PrintTop%=TRUE 13790 NEXT 13800 IF PrintTop% THEN Height%=1105 ELSE Height%=670 13810 Width%=675 : REM 7.1 UNITS=1MM 13820 X1%=0 : X2%=135 : X3%=Width% 13830 REM Y1%=0 : Y2%=114 : Y3%=227 : Y4%=670 : Y5%=Height% 13840 Y1%=Height% : Y2%=Y1%-114 : Y3%=Y1%-227 : Y4%=Y1%-670 : Y5%=0 13850 Box%!0=0 : Box%!4=0 13860 Box%!8=Width%+20 : Box%!12=Height%+20 : REM To Allow For Rounding Errors In Conversion Routines. 13870 REM Set up variable for inlay printing. 13880 Font1X%=13*16 : Font1Y%=12*16 : Font2X%=12*16 : Font2Y%=12*16 : Font3X%=13*16 : Font3Y%=13*16 13890 UserNote_Y_Offset%=Y2%+35 13900 Title1_Y_Offset%=Y3%+82 : Title2_Y_Offset%=Y3%+47 : Title3_Y_Offset%=Y3%+12 : Title_X_Offset%=80 13910 Index_X_Offset%=X1%+20 : Item_X_Offset%=X2%+10 : Text_Drop_Btm%=25 : Text_Drop_Top%=30 13920 Copyright_Text$="Video_8 Index Printer � M.Bright 1992" 13930ENDPROC 13940: 13950REM ********************************************************************************** 13960REM Set up variable for print routine to give correct sizes & format for VHS_C inlays. 13970REM ********************************************************************************** 13980DEF PROC_GetDocumentSize_C(Box%) 13990 PrintTop%=FALSE 14000 FOR L%=TopSetIndexStart% TO TopSetItemEnd% STEP 2 14010 IF FN_ReadIconText(Main%,L%,FALSE)<>"" OR FN_ReadIconText(Main%,L%+1,FALSE)<>"" THEN PrintTop%=TRUE 14020 NEXT 14030 IF PrintTop% THEN Height%=1120 ELSE Height%=700 14040 Width%=653 : REM 7.1 UNITS=1MM 14050 X1%=0 : X2%=120 : X3%=Width% 14060 REM Y1%=0 : Y2%=110 : Y3%=280 : Y4%=700 : Y5%=Height% 14070 Y1%=Height% : Y2%=Height%-110 : Y3%=Y1%-280 : Y4%=Y1%-700 : Y5%=0 14080 Box%!0=0 : Box%!4=0 14090 Box%!8=Width%+20 : Box%!12=Height%+20 : REM To Allow For Rounding Errors In Conversion Routines. 14100 REM Set up variable for inlay printing. 14110 Font1X%=13*16 : Font1Y%=13*16 : Font2X%=13*16 : Font2Y%=12*16 : Font3X%=12*16 : Font3Y%=12*16 14120 UserNote_Y_Offset%=Y2%+35 14130 Title1_Y_Offset%=Y3%+130 : Title2_Y_Offset%=Y3%+75 : Title3_Y_Offset%=Y3%+20 : Title_X_Offset%=80 14140 Index_X_Offset%=X1%+10 : Item_X_Offset%=X2%+10 : Text_Drop_Btm%=25 : Text_Drop_Top%=28 14150 Copyright_Text$="VHS-C Index Printer � M.Bright 1992" 14160ENDPROC 14170: 14180REM ******************************************************************************** 14190REM Set up variable for print routine to give correct sizes & format for DAT inlays. 14200REM ******************************************************************************** 14210DEF PROC_GetDocumentSize_D(Box%) 14220 PrintTop%=FALSE 14230 FOR L%=TopSetIndexStart% TO TopSetItemEnd% STEP 2 14240 IF FN_ReadIconText(Main%,L%,FALSE)<>"" OR FN_ReadIconText(Main%,L%+1,FALSE)<>"" THEN PrintTop%=TRUE 14250 NEXT 14260 IF PrintTop% THEN Height%=7.1*130 ELSE Height%=7.1*77 14270 Width%=7.1*73 : REM 7.1 UNITS=1MM 14280 X1%=0 : X2%=7.1*12 : X3%=Width% 14290 Y1%=Height% : Y2%=Y1%-7.1*9.5 : Y3%=Y1%-7.1*22 : Y4%=Y1%-7.1*76 : Y5%=0 14300 Box%!0=0 : Box%!4=0 14310 Box%!8=Width%+20 : Box%!12=Height%+20 : REM To Allow For Rounding Errors In Conversion Routines. 14320 REM Set up variable for inlay printing. 14330 Font1X%=10*16 : Font1Y%=10*16 : Font2X%=11*16 : Font2Y%=11*16 : Font3X%=13*16 : Font3Y%=12*16 14340 UserNote_Y_Offset%=Y2%+25 14350 Title1_Y_Offset%=Y3%+50 : Title2_Y_Offset%=Y3%+20 : Title_X_Offset%=80 14360 Index_X_Offset%=X1%+4 : Item_X_Offset%=X2%+4 : Text_Drop_Btm%=23 : Text_Drop_Top%=23 14370 Copyright_Text$="DAT Inlay Printer � M.Bright 1992" 14380ENDPROC 14390: 14400REM **************************************************************************************************************** 14410REM 'Draw' the inlay, using previously defined variables. All output has been switched to the printer at this stage. 14420REM this routine is the heart of the Risc-OS printer output. 14430REM **************************************************************************************************************** 14440DEF PROC_DrawInlay(Co_ordinateBlock%) 14450 SYS Find%,,BaseFont$,Font1X%,Font1Y%,0,0 TO BaseFontHandle% 14460 SYS Find%,,BoldFont$,Font2X%,Font2Y%,0,0 TO BoldFontHandle% 14470 SYS Find%,,EdgeFont$,Font3X%,Font3Y%,0,0 TO EdgeFontHandle% 14480: 14490 IF FN_ReadIconText(Main%,UserNote%,FALSE)<>"" THEN 14500 Text$=FN_ReadIconText(Main%,UserNote%,FALSE) 14510 ELSE 14520 Text$=Copyright_Text$ 14530 ENDIF 14540 PROC_CentreProp(Text$,UserNote_Y_Offset%,"Bold",Width%/7.1) 14550: 14560 PROC_CentreProp(FN_ReadIconText(Main%,TitleFirstLine%,FALSE),Title1_Y_Offset%,"Title",Title_X_Offset%) 14570 PROC_PrintTapeNumber 14580 PROC_CentreProp(FN_ReadIconText(Main%,TitleFirstLine%+1,FALSE),Title2_Y_Offset%,"Title",Title_X_Offset%) 14590 IF InlayType$<>"DAT" THEN 14600 PROC_CentreProp(FN_ReadIconText(Main%,TitleFirstLine%+2,FALSE),Title3_Y_Offset%,"Title",Title_X_Offset%) 14610 ENDIF 14620: 14630 Separation%=(Y3%-Y4%)/13 14640 SpaceStartY%=Y4% + Separation% 14650 Icon%=BtmSetIndexStart% 14660 SYS "ColourTrans_SetGCOL",&C0C0C000,,,0,0 14670 WHILE SpaceStartY% <= Y3% 14680 IF SpaceStartY% < Y3%-10 THEN MOVE X1%,SpaceStartY% :DRAW X3%,SpaceStartY% 14690 Text$=FN_ReadIconText(Main%,Icon%,FALSE) 14700 PROC_FontPaint("",Text$,Index_X_Offset%,SpaceStartY%-Text_Drop_Btm%) 14710 Text$=FN_ReadIconText(Main%,Icon%+1,FALSE) 14720 PROC_FontPaint("",Text$,Item_X_Offset%,SpaceStartY%-Text_Drop_Btm%) 14730 SpaceStartY%+=Separation% 14740 Icon%+=2 14750 ENDWHILE 14760: 14770 IF PrintTop% THEN 14780 Separation=(Y4%-Y5%)/12 14790 SpaceStartY=Y5% + Separation 14800 Icon%=TopSetIndexStart% 14810 SYS "ColourTrans_SetGCOL",&C0C0C000,,,0,0 14820 WHILE SpaceStartY <= Y4% 14830 IF SpaceStartY < Y4%-10 THEN MOVE X1%,SpaceStartY :DRAW X3%,SpaceStartY 14840 Text$=FN_ReadIconText(Main%,Icon%,FALSE) 14850 PROC_FontPaint("",Text$,Index_X_Offset%,SpaceStartY-Text_Drop_Top%) 14860 Text$=FN_ReadIconText(Main%,Icon%+1,FALSE) 14870 PROC_FontPaint("",Text$,Item_X_Offset%,SpaceStartY-Text_Drop_Top%) 14880 SpaceStartY+=Separation 14890 Icon%+=2 14900 ENDWHILE 14910 ENDIF 14920: 14930 SYS "ColourTrans_SetGCOL",&00000000,,,0,0 14940 RECTANGLE X1%,Y5%,X3%,Y1% 14950 RECTANGLE X1%,Y3%,X3%,Y2%-Y3% 14960 MOVE X1%,Y4% : DRAW X3%,Y4% 14970 MOVE X2%,Y3% : DRAW X2%,Y5% 14980: 14990 SYS Lose%,BaseFontHandle% 15000 SYS Lose%,BoldFontHandle% 15010 SYS Lose%,EdgeFontHandle% 15020ENDPROC 15030: 15040REM ******************************************************** 15050REM Sends the inlay data to the printer in NON Risc-OS mode. 15060REM ******************************************************** 15070DEF PROC_DoPrinting(InlayType$) 15080 PROC_SetPrintVariables(InlayType$) 15090 PROC_SendData(PrintPitch$) 15100 : 15110 PRINT LongMinus$ : IF InlayType$<>"DAT" THEN PRINT BlankLine$ 15120 IF FN_ReadIconText(Main%,UserNote%,FALSE)="" THEN 15130 PRINT Copyright$ 15140 ELSE 15150 PRINT "|";FN_Centre(FN_ReadIconText(Main%,UserNote%,FALSE),LineLength%);"|" 15160 ENDIF 15170 PRINT LongEqual$ 15180 PROC_PrintTitle(InlayType$) 15190 PRINT LongEqual$ : IF InlayType$<>"DAT" THEN PRINT BlankLine$ 15200 FOR L%=BtmSetIndexEnd% TO BtmSetIndexStart% STEP -2 15210 PRINT "|";RIGHT$(STRING$(7," "+FN_ReadIconText(Main%,L%,FALSE)),7);Spacer$;FN_ReadIconText(Main%,L%+1,TitleLen%);"|" 15220 NEXT 15230 IF InlayType$<>"DAT" THEN PRINT LongMinus$ 15240 : 15250 PrintTop%=FALSE 15260 FOR L%=TopSetIndexEnd% TO TopSetIndexStart% STEP -2 15270 IF FN_ReadIconText(Main%,L%,FALSE)<>"" OR FN_ReadIconText(Main%,L%+1,FALSE)<>"" THEN PrintTop%=TRUE 15280 NEXT 15290 : 15300 IF PrintTop% THEN 15310 IF InlayType$<>"DAT" THEN PRINT BlankLine$ 15320 FOR L%=TopSetIndexEnd% TO TopSetIndexStart% STEP -2 15330 PRINT "|";RIGHT$(STRING$(7," "+FN_ReadIconText(Main%,L%,FALSE)),7);Spacer$;FN_ReadIconText(Main%,L%+1,TitleLen%);"|" 15340 NEXT 15350 IF InlayType$="Video_8" THEN PRINT BlankLine$ 15360 PRINT LongMinus$ 15370 ENDIF 15380ENDPROC 15390: 15400REM ******************************************************************************************************** 15410REM Set global print variable to enable the non Risc-OS printer rouytine to generate 3 differnt label types. 15420REM ******************************************************************************************************** 15430DEF PROC_SetPrintVariables(InlayType$) 15440 CASE InlayType$ OF 15450 WHEN "Video_8" : Copyright$ ="| Video 8 Inlay Printer � M.S.Bright 1992 |" 15460 Spacer$ =" : " : TitleLen%=34 : LineLength%=44 15470 PrintPitch$=EliteON$ 15480 WHEN "VHS_C" : Copyright$ ="| VHS-C Inlay Printer � M.S.Bright 1992 |" 15490 Spacer$ =":" : TitleLen%=34 : LineLength%=42 15500 PrintPitch$=EliteON$ 15510 WHEN "DAT" : Copyright$ ="| DAT Inlay Printer � M.S.Bright 1992 |" 15520 Spacer$ =" : " : TitleLen%=38 : LineLength%=48 15530 PrintPitch$="1,15" 15540 ENDCASE 15550 LongMinus$ ="|"+STRING$(LineLength%,"-")+"|" 15560 BlankLine$ ="|"+STRING$(LineLength%," ")+"|" 15570 LongEqual$ ="|"+STRING$(LineLength%,"=")+"|" 15580ENDPROC 15590: 15600REM ********************************************************************************************************** 15610REM Tis is part of the NON Risc-OS print routine. It prints the 'cassette' title area on the spine of the case 15620REM Due to the many differences in this area of the label a separate routine was required. 15630REM ********************************************************************************************************** 15640DEF PROC_PrintTitle(InlayType$) 15650 IF InlayType$="Video_8" THEN 15660 PROC_SendData(EmphasisedON$) 15670 PRINT "| ";FN_Centre(FN_ReadIconText(Main%,TitleFirstLine%,FALSE),34);" ";FN_ReadIconText(Main%,TapeNumber%,FALSE);" |" 15680 PRINT "| ";FN_Centre(FN_ReadIconText(Main%,TitleFirstLine%+1,FALSE),34);" |" 15690 PRINT "| ";FN_Centre(FN_ReadIconText(Main%,TitleLastLine%,FALSE),34);" |" 15700 PROC_SendData(EmphasisedOFF$) 15710 ENDIF 15720 IF InlayType$="VHS_C" THEN 15730 PROC_SendData(EmphasisedON$) 15740 PRINT "|";RIGHT$(STRING$(41," ")+FN_ReadIconText(Main%,TapeNumber%,7),41);" |" 15750 PRINT "|";FN_Centre(FN_ReadIconText(Main%,TitleFirstLine%,FALSE),42);"|" 15760 PRINT "|";FN_Centre(FN_ReadIconText(Main%,TitleFirstLine%+1,FALSE),42);"|" 15770 PRINT "|";FN_Centre(FN_ReadIconText(Main%,TitleLastLine%,FALSE),42);"|" 15780 PROC_SendData(EmphasisedOFF$) 15790 ENDIF 15800 IF InlayType$="DAT" THEN 15810 PRINT "| ";FN_Centre(FN_ReadIconText(Main%,TitleFirstLine%,FALSE),40);" ";FN_ReadIconText(Main%,TapeNumber%,FALSE);"|" 15820 PRINT "| ";FN_Centre(FN_ReadIconText(Main%,TitleFirstLine%+1,FALSE),40);" |" 15830 ENDIF 15840ENDPROC 15850: 15860REM ************************************************************* 15870REM Routine to amend the title bar, The title MUST BE INDIRECTED. 15880REM ************************************************************* 15890DEF PROC_ChangeWindowTitle(Window%,NewTitle$) 15900 Block%!100 = Window% 15910 SYS "Wimp_GetWindowInfo",,Block%+100 15920 Pointer% = !(Block%+176) 15930 $Pointer% = NewTitle$ 15940 IF MainWindowOpen% THEN SYS "Wimp_ForceRedraw",-1,Block%!104,(Block%!116)-36,Block%!112,Block%!116+36 15950ENDPROC
�>!RunImage � � � Mark Bright. (: 2Version$="1.00 (05-Mar-92)" <: F7� Block% 1024*4 :� General purpose WIMP workspace! P Z�_Initialise_WIMP_System d: n#�_SetIconText(3,Info%,Version$) x'�_SetIconText(4,Save%,"BoffBright") �: �� � �_Wimp_Error �"�_Initialise_Program_Variables �0�_SetIconText(TapeNumber%,Main%,TapeNumber$) �: �� � �_Wimp_Error �: �n� ******************************************************************************************************** �l� All RISCOS/WIMP Specific Proceedures First, !Video8 Proc'S after.... Makes for a better skeleton prog! �n� ******************************************************************************************************** � �� �' ș "Wimp_Poll",Mask%,Block% � A% Ȏ A% � C � 2 : ș "Wimp_OpenWindow",,Block% : � allows auto Drag D � 3 : ș "Wimp_CloseWindow",,Block% : � allows auto Close "7 : � Block%!0=Main% � MainWindowOpen%=� , � 6 : �_ButtonPressed 67 � 7 : �_DragBoxEnd(�_ReadIconText(Save%,4,�)) @' � 8 : �_ProcessKey(Block%!24) J � 9 : �_MenuSelection T1 � 16,17,18 : �_DecodeMessage(Block%!16) ^ � h� � r: |/� ***************************************** �/� This is the WIMP Error handling routine ! �/� ***************************************** �� �_Wimp_Error � � Error$ � ș "OS_Byte",3,0 � ș "Wimp_DragBox",,-1 � !Block%=� � Error$ = �$ �Y � �<>2001 � Error$ += "Internal Error ("+�(�)+"). OK to continue, CANCEL to abort" � $(Block%+4)=Error$ + �0 �O ș "Wimp_ReportError",Block%,%001 - (2*(�<>2001)),MyTaskName$ � ,Result% � � Result%=2 � �_CloseDown �� : *� ************************************ *� Mouse 'Click' Whilst Over Menu Item. &*� ************************************ 0� �_MenuSelection : � IconBarMenuActive% � D Ȏ Block%!0 � N> � 0 : �_OpenSubMenu(Info%) : IconBarMenuActive%=� XA � 1 : �_OpenSubMenu(Options%) : IconBarMenuActive%=� b9 � 2 : Old$=InlayType$ : InlayType$="Video_8" l3 � Old$="VHS_C" � Old$="DAT" � v0 menu%!(28+24*2)=Ticked% �h menu%!(28+24*3)=NotTicked% : � Tick Item 2, Untick Items 3 & 4 �A menu%!(28+24*4)=NotTicked% � Underlined% �? �_SetIconText(Format%,Main%,"Video_8") �0 �_Redraw(Main%,Format%) �@ �_ChangeWindowTitle(Main%,WindowTitle$) �@ �_NotSelectable(Main%,TitleLastLine%,�) � � �7 � 3 : Old$=InlayType$ : InlayType$="VHS_C" �6 � Old$="Video_8" � Old$="DAT" � �3 menu%!(28+24*2)=NotTicked% �i menu%!(28+24*3)=Ticked% : � Tick Item 3, Untick Items 2 & 4 �A menu%!(28+24*4)=NotTicked% � Underlined% �= �_SetIconText(Format%,Main%,"VHS_C") 0 �_Redraw(Main%,Format%) @ �_ChangeWindowTitle(Main%,WindowTitle$) @ �_NotSelectable(Main%,TitleLastLine%,�) � *5 � 4 : Old$=InlayType$ : InlayType$="DAT" 47 � Old$="Video_8" � Old$="VHS_C" � >3 menu%!(28+24*2)=NotTicked% HW menu%!(28+24*3)=NotTicked% : � Tick Item 4, Untick Items 3 & 2 R> menu%!(28+24*4)=Ticked% � Underlined% \; �_SetIconText(Format%,Main%,"DAT") f0 �_Redraw(Main%,Format%) p= �_ChangeWindowTitle(Main%,DatTitle$) z@ �_NotSelectable(Main%,TitleLastLine%,�) � � �E � 5 : �_CloseDown : � <Select> on "quit" causes shutdown � � � � � � � MainWindowMenuActive% � � Ȏ Block%!0 � �A � 0 : �_OpenSubMenu(Info%) : MainWindowMenuActive%=� �A � 1 : �_OpenSubMenu(Save%) : MainWindowMenuActive%=� �D � 2 : �_OpenSubMenu(Options%) : MainWindowMenuActive%=� �# � 3 : �_FormatIconText �! � 4 : �_WipeIconText � � � ' ș "Wimp_GetPointerInfo",,Block% $ � (Block%!8 � 1) � .< � IconBarMenuActive% � ș "Wimp_CreateMenu",,menu% 8C � MainWindowMenuActive% � ș "Wimp_CreateMenu",,MainMenu% B � L� V: `&� ******************************** j&� Mouse Button Status Has Changed. t&� ******************************** ~� �_ButtonPressed �+� MouseX%,MouseY%,Button%,Window%,Icon% �F MouseX%=Block%!00 : � Block%!00 = Mouse X (Screen Co-ordinates) �F MouseY%=Block%!04 : � Block%!04 = Mouse Y (Screen Co-ordinates) �0 Button%=Block%!08 : � Block%!08 = Buttons �V Window%=Block%!12 : � Block%!12 = Window Handle (BackGround = -1, IconBar = -2) �Q Icon% =Block%!16 : � Block%!16 = Icon Handle ( Work Area BackGround = -1) � �/ � Window%=Options% � Icon%=OptionsOKF% � �H �_ButtonPress(Options%, OptionsOKF%, OptionsOKL%, OptionsOKD%) � �_StoreUserData � � � 6 � Window%=IconBar% � Icon%=IconBarIconHandle% � Ȏ Button% � ) � %001 : �_OpenMainWindow(�) ) � %100 : �_OpenMainWindow(�) (D � %010 : MainWindowMenuActive%=� : IconBarMenuActive%=� 2K ș "Wimp_CreateMenu",,menu%,Block%!0-64,(40*7)+104 < � F � P Z9 � Button%<> %010 � Window%=Main% � Icon%=PrintF% � d9 �_ButtonPress(Main%, PrintF%, PrintL%, PrintD%) n �_PrintOut x � � �' � Button%=%010 � Window%=Main% � �7 � InlayType$="Video_8" � InlayType$="VHS_C" � �$ Postfix$=�InlayType$,2) � � � Postfix$="_D" � � �_ Temp$=�_ReadIconText(Save%,4,�) : Temp2$=�_ReadIconText(Main%,TapeNumber%,�)+Postfix$ �8 � �Temp$,10)="BoffBright" � OldName$<>Temp2$ � �; NewSaveName$=�_ConvertSoftToHardSpaces(Temp2$) �# � �(Temp$)>�(Temp2$) � �! Pointer%=�(Temp$) �E ȕ �Temp$,Pointer%,1)<>"." � Pointer%>0:Pointer%-=1:� D �_SetIconText(4,Save%,�Temp$,Pointer%)+NewSaveName$) � 3 �_SetIconText(4,Save%,NewSaveName$) " � , OldName$=Temp2$ 6 � @7 �_CreateMainWindowMenu(MouseX%,MouseY%,Icon%) J � T ^6 � Window%=Save% � Icon%=SaveIcon% � �_DragSave h+ � Window%=Save% � Icon%=SaveOKF% � r< �_ButtonPress(Save%, SaveOKF%, SaveOKL%, SaveOKD%) |- �_SaveTo(�_ReadIconText(Save%,4,�)) � � � �, � Button%<> %010 � Window%=Options% � � Ȏ Icon% � �b � 0,1,5 : �_SetIconText(DriverName%,Main%,PDriver$(�_ReadESGSelected(Options%,9)+1)) � � �% �_Redraw(Main%,DriverName%) � � �� �: �m� ******************************************************************************************************* �m� Change all occurances of <SPACE> in the tape number to <ALT-SPACE> to stop the filer throwing a wobbly. �m� ******************************************************************************************************* &� �_ConvertSoftToHardSpaces(Name$) Pointer%=�(Name$) � &" Char$=�Name$,Pointer%,1) 0 � Char$=" " � : Char$="�" D% �Name$,Pointer%,1)=Char$ N � X Pointer%-=1 b � Pointer%=1 l =Name$ v: �$******************************** �"� 'Press' a button in a window �$******************************** �3� �_ButtonPress(Window%, Front%, Light%, Dark%) � � TimeNow% �* �_SetIconColour(Window%, Light%, 4) �) �_SetIconColour(Window%, Dark%, 0) �+ �_SetIconColour(Window%, Front%, 14) � TimeNow% = � � � � � � > TimeNow%+25 �* �_SetIconColour(Window%, Light%, 0) �) �_SetIconColour(Window%, Dark%, 4) * �_SetIconColour(Window%, Front%, 1) � : 0******************************************** *.� Change the colour of an icon in a window 40******************************************** >.� �_SetIconColour(Window%, Icon%, Colour%) H Block%!0 = Window% R Block%!4 = Icon% \ Block%!8 = Colour% << 28 f Block%!12 = %1111 << 28 p& ș "Wimp_SetIconState",, Block% z� �: �I� ******************************************************************* �I� When a key is pressed, Check if it concerns me. If not, Pass it on! �I� ******************************************************************* �� �_ProcessKey(KeyPressed) � � Icon%,Index%,Window% � Window%=Block%!0 � Icon%=Block%!4 � Index%=Block%!20 � Ȏ KeyPressed � � �B � &180 : �_ButtonPress(Main%, PrintF%, PrintL%, PrintD%) � �_PrintOut � <Print> � &18A $ � <Tab> ./ � Icon%<=BtmSetItemEnd% � 8Y �_SetCaretPosition(Icon%-((Icon% � 2)=0)+((Icon% � 2)=1),Index%) B � Li � Icon%>=TitleFirstLine% � Icon%<TitleLastLine% � �_SetCaretPosition(TapeNumber%,0) VQ � Icon%=TapeNumber% � �_SetCaretPosition(TitleFirstLine%,0) ` j � &0D t � <Return> ~? � Window%=Main% � Icon%<=BtmSetItemEnd% � �A � ((Icon% � 2)=1) � �_MoveDownOneBackOne �J � ((Icon% � 2)=0) � �_SetCaretPosition(Icon%+1,0) � � �j � Window%=Main% � Icon%>=TitleFirstLine% � Icon%<=TitleLastLine% � �_MoveDownAnEntry �[ � Window%=Main% � Icon%=TapeNumber% � �_SetCaretPosition(UserNote%,0) �' � Window%=Save% � �K �_ButtonPress(Save%, SaveOKF%, SaveOKL%, SaveOKD%) �< �_SaveTo(�_ReadIconText(Save%,4,�)) � � � � � &1E � � <Home> U � Icon%<=BtmSetItemEnd% � �_SetCaretPosition(BtmSetIndexEnd%,0) � &18F � <Cursor Up> (% �_MoveUpAnEntry 2 < � &18E F � <Cursor Down> P' �_MoveDownAnEntry Z d � &199 n � <Shift><f9> x$ �_WipeIconText � � � &1CA � � <f10> �4 �_SwapCase(Main%,Icon%,Index%) � � � &1CB �) � <f11> - Delete to end of line �B Text$=��_ReadIconText(Main%,Icon%,�),Index%) �6 �_SetIconText(Icon%,Main%,Text$) �+ �_Redraw(Main%,Icon%) � �, ș "Wimp_ProcessKey",Block%!24 � � � : "G� ***************************************************************** ,G� Set which icon the caret is in, scrolling the window as required. 6G� ***************************************************************** @&� �_SetCaretPosition(Icon%,Index%) J4 � CaretX%, CaretY%, Top%, Btm%, Left%, Right% T3 IconLength%=�(�_ReadIconText(Main%,Icon%,�)) ^0 � Index%>IconLength% � Index%=IconLength% h9 ș "Wimp_SetCaretPosition",Main%,Icon%,,,-1,Index% r) ș "Wimp_GetCaretPosition",,Block% |+ CaretX%=Block%!8 : CaretY%=Block%!12 � Block%!0=Main% �' ș "Wimp_GetWindowState",,Block% �: Top% =Block%!24 : Btm% =Top% -(Block%!16-Block%!8) �: Left%=Block%!20 : Right%=Left%+(Block%!12-Block%!4) �w � Since caret co-ordinates locate the bottom of the caret, there is a fudge of 64 above and 32 below (32=1 char) � � (Top%-64 < CaretY%) � � Block%!24=CaretY%+64 �& ș "Wimp_OpenWindow",,Block% � � � � (Btm%+32 > CaretY%) � �1 Block%!24=Block%!24-(Btm%-(CaretY%-32)) �& ș "Wimp_OpenWindow",,Block% � � � : %� ******************************* &%� Redraw the specifiied icon (v2) 0%� ******************************* :� �_Redraw(Window%,Icon%) D Block%!0=Window% N Block%!4=Icon% X Block%!8=0 b Block%!12=0 l% ș "Wimp_SetIconState",,Block% v� �: �E� *************************************************************** �H� When a message is received, Control is passed to here for decoding �E� *************************************************************** �� �_DecodeMessage(Request%) � Ȏ Request% � �' � msg_quit% : �_CloseDown �A � msg_datasave% : Block%!0=(48+�("<Wimp$Scrap> "))� � 3 �1 Block%!12=Block%!8 �* Block%!16=2 �: $(Block%+44)="<Wimp$Scrap>" �1 SaveRef%=Block%!12 �Q ș "Wimp_SendMessage",usr_message%,Block%,Block%!4 7 � msg_dsaveACK% : �_HandleMessage_DataSaveAck - � msg_dataload% : �_FileDroppedOnMe O � msg_help% : �_GiveHelp(Block%!32,Block%!36,Block%!20,Block%!24) *W � msg_taskinit% : � �_ReadString(Block%+28)=MyTaskName$ � Block%!4<> My_id% � 4] � Another !Video8 is trying to start up, I am closing down! >- �_CloseDown H � R � \� f: p>� ******************************************************** z@� Start Up program as a task with name "Video Inlay Printer" �"� And put icon on the Icon bar �>� ******************************************************** �� �_Initialise_WIMP_System �( MyTaskName$="Video Inlay Printer" �C ș "Wimp_Initialise",200,&4B534154,MyTaskName$ � ver%,My_id% �- IconBarIconHandle%=�_CreateIconBarIcon � �_Initialise_Sprites � �_Initialise_Templates �n Mask%=%1100000110001 : � Mask Out codes for Gain/Lose Caret, Pointer Enter/Leave Window & Null Event �� �: �A� *********************************************************** �A� All WIMP Programs should be able to shut themselves down!!! A� *********************************************************** � �_CloseDown + ș "Wimp_CloseDown",My_id%,&4B534154 $ ș "OS_Exit" .� 8: BF� **************************************************************** LF� Opens up the template file, Fondles it, and then creates Windows VF� **************************************************************** `� �_Initialise_Templates j. maxws%=&900 : � ws% maxws% : curws%=ws% t? ș"Wimp_OpenTemplate",,"<Video$Dir>.Resources.Templates" ~J ș"Wimp_LoadTemplate",,Block%,ws%,ws%+maxws%,-1,"info",0 � ,,curws% �, ș"Wimp_CreateWindow",,Block% � Info% �M ș"Wimp_LoadTemplate",,Block%,curws%,ws%+maxws%,-1,"save",0 � ,,curws% �, ș"Wimp_CreateWindow",,Block% � Save% �M ș"Wimp_LoadTemplate",,Block%,curws%,ws%+maxws%,-1,"Main",0 � ,,curws% �, ș"Wimp_CreateWindow",,Block% � Main% �R ș"Wimp_LoadTemplate",,Block%,curws%,ws%+maxws%,-1,"Print_Opt",0 � ,,curws% � Block%!64 = SpriteArea% �/ ș"Wimp_CreateWindow",,Block% � Options% � ș"Wimp_CloseTemplate" �� �: �I� ******************************************************************* I� This writes over the text in the Icon, and it should not be done!!! .� Only Works With Indirected Text Strings! I� ******************************************************************* 4� �_SetIconText(IconHandle%,WindowHandle%,Text$) ( � Pointer% 2 Block%!0=WindowHandle% < Block%!4=IconHandle% F% ș "Wimp_GetIconState",,Block% P" � (Block%!24 � (1<<8))<>0 � Z Pointer%=Block%!28 d � n Pointer%=Block%+28 x � � $Pointer%=Text$ �� �: �,� ************************************** �,� The name sort of says it all really!!! �,� ************************************** �� �_SetUpIconBarMenu � � m% � � menu% 28+6*24 � $menu%="Video" � menu%?12=`black � menu%?13=`grey2 � menu%?14=`black menu%?15=`white menu%!16=128 menu%!20=40 " menu%!24=0 , 6 m%=menu%+28 @ m%!0=&0 J0 m%!4=Info% :� name from template open. T m%!8=(7<<24) � %10001 ^ $(m%+12)="Info" h r m%=m%+24 | m%!0=&02 � m%!4=Options% � m%!8=(7<<24) � %10001 � $(m%+12)="Options" � � m%=m%+24 �3 � InlayType$="Video_8" � m%!0=&01 � m%!0=&00 � m%!4=0 � m%!8=(7<<24) � %10001 � $(m%+12)="Video 8" � � m%=m%+24 �1 � InlayType$="VHS_C" � m%!0=&01 � m%!0=&00 � m%!4=0 m%!8=(7<<24) � %10001 $(m%+12)="VHS C" & m%=m%+24 0/ � InlayType$="DAT" � m%!0=&03 � m%!0=&02 : m%!4=0 D^ m%!8=(7<<24) � %10001 : � to grey icon out add 'OR 1<<22' to the end of the line N $(m%+12)="DAT" X b m%=m%+24 l m%!0=&80 v m%!4=0 � m%!8=(7<<24)� %10001 � $(m%+12)="Quit" �� �: �C� ************************************************************* �C� This takes a Sprite and makes it into an Icon For the IconBar �C� ************************************************************* �� �_CreateIconBarIcon � � Icon% � Block%!0=-1 � Block%!4=0 � Block%!8=0 � Block%!12=68 Block%!16=68 Block%!20=%10000000000010 $(Block%+24)="!Video" + ș "Wimp_CreateIcon",,Block% � Icon% * =Icon% 4: >3� ********************************************* H3� Read Info for Window Main, and then open it ! R3� ********************************************* \-� �_OpenMainWindow(WipeTemplateIconText%) f6 � WipeTemplateIconText% � New% � �_WipeIconText p !Block%=Main% z' ș "Wimp_GetWindowState",,Block% �# ș "Wimp_OpenWindow",,Block% � New%=� �, �_SetCaretPosition(BtmSetIndexEnd%,0) � MainWindowOpen%=� �� �: �L� ********************************************************************** �L� This reads the text from the writable Icon specified in the parameters �H� and if Pad%<>FALSE TRUE then pads out the result to required size. �L� ********************************************************************** �4� �_ReadIconText(WindowHandle%,IconHandle%,Pad%) � � Result$ � Block%!0=WindowHandle% Block%!4=IconHandle% % ș "Wimp_GetIconState",,Block% " � (Block%!24 � (1<<8))<>0 � $ Result$=$(Block%!28) . � 8 Result$=$(Block%+28) B � L, � Pad%>0 � =�Result$+�Pad%," "),Pad%) V=Result$ `: j/� ***************************************** t/� Wipe the text from all the writable icons ~/� ***************************************** �� �_WipeIconText �3 � ItemText$,IndexText$,TapeNumberText$,Loop% �# ItemText$="" : IndexText$="" �5 � Loop%=TopSetIndexStart% � BtmSetItemEnd% � 2 �X �_SetIconText(Loop%,Main%,IndexText$) : �_SetIconText(Loop%+1,Main%,ItemText$) �9 �_Redraw(Main%,Loop%) : �_Redraw(Main%,Loop%+1) � � �/ � Loop%=TitleFirstLine% � TitleLastLine% �F �_SetIconText(Loop%,Main%,ItemText$) : �_Redraw(Main%,Loop%) � � �3 �_SetIconText(TapeNumber%,Main%,TapeNumber$) �/ �_SetIconText(UserNote%,Main%,ItemText$) " �_Redraw(Main%,TapeNumber%) �_Redraw(Main%,UserNote%) � : (,� ************************************** 2,� The name sort of says it all really!!! <+� ************************************* F)� �_CreateMainWindowMenu(X%,Y%,Icon%) P0 � m%,Flags%,Pointer%,Sel%,IconFlag%,Item$ Z5 MainWindowMenuActive%=� : IconBarMenuActive%=� d � MainMenu% 29+7*24 n $MainMenu%="Main" x MainMenu%?12=`black � MainMenu%?13=`grey2 � MainMenu%?14=`black � MainMenu%?15=`white � MainMenu%!16=16*16 � MainMenu%!20=40 � MainMenu%!24=0 � m%=MainMenu%+28 � � �0 � Flags%,Pointer%,Sel%,IconFlag%,Item$ �C m%!0=Flags% :� Menu Flags �Y m%!4=Pointer% :� Pointer to Sub-Menu (-1 If None) �F m%!8=IconFlag% � (Sel%<<22) � (7<<24) :� Menu Icon Flags �R $(m%+12)=Item$ :� Item Name (12 Bytes Max.) m%=m%+24 � Flags%=&80 : " � +0 ," � &00,Info%,0,%10001,"Info" 6' � &00,Save%,0,%10001,"Save data" @( � &00,Options%,0,%10001,"Options" J! � &00,-1,0,%10001,"Format" T# � &80,-1,0,%10001,"Wipe all" ^ : h/ ș "Wimp_CreateMenu",,MainMenu%,X%-96,Y% r� |: �T� ****************************************************************************** �T� Control Comes To Here When The User Has Dragged The Save Icon And Released It. �T� ****************************************************************************** �� �_DragBoxEnd(LeafName$) � Pointer%=�LeafName$ �2 ȕ Pointer%>0 � �LeafName$,Pointer%,1)<>"." � Pointer%-=1 � � �' LeafName$=�LeafName$,Pointer%+1) �' ș "Wimp_GetPointerInfo",,Block% � SenderWindow%=Block%!12 � SenderIcon%=Block%!16 � Block%!20=SenderWindow% Block%!24=SenderIcon% Block%!28=Block%!0 Block%!32=Block%!4 & Block%!0=44+�LeafName$ 0! Block%!0+=4-(Block%!0 � 4) : Block%!4=0 D Block%!8=0 N Block%!12=0 X' Block%!16=1 : � Message_DataSave b. Block%!36=0 : � Length of proposed save l Block%!40=MyFileType% v $(Block%+44)=LeafName$+�0 �x � � ((SenderWindow%=Save%) � (SenderWindow%=Main%) � (SenderWindow%=IconBar% � SenderIcon%=IconBarIconHandle%)) � �M ș "Wimp_SendMessage",usr_message%,Block%,SenderWindow%,SenderIcon% � � �� �: �<� ****************************************************** �;� A Data Save Acknowlegement Message Has Been Received! �<� ****************************************************** �!� �_HandleMessage_DataSaveAck � � PathName$,Pointer% � Pointer%=Block%+44 � � � PathName$+=�?Pointer% Pointer%+=1 � ?Pointer%=0 �_SaveTo(PathName$) Block%!0=40+�PathName$+4 *! Block%!0+=4-(Block%!0 � 4) 4 Block%!16=msg_dataload% > Block%!36=0 H Block%!40=MyFileType% R" $(Block%+44)=PathName$+�(0) \N ș "Wimp_SendMessage",usr_msgrecorded%,Block%,SenderWindow%,SenderIcon% f� p: ;� ***************************************************** ;� Read a string from a pointer, using a zero-terminator ;� ***************************************************** $� �_ReadString(Pointer%) . � String$ 8 ȕ ?Pointer%<>0 B String$+=�?Pointer% L Pointer%+=1 V � `=String$ j: tN� ************************************************************************ ~N� This Bit Does The Actual Saving Of The Data When Requested By The Filer. �N� ************************************************************************ �� �_SaveTo(PathName$) � Pointer%=�PathName$ �2 ȕ Pointer%>1 � �PathName$,Pointer%,1)<>"." � Pointer%-=1 � � �K � Pointer%=1 � � 2001,"To save: Drag the icon to a directory viewer" � ș "Wimp_CreateMenu",,-1 � ș "OS_Byte",3,2 � �("SPOOL "+PathName$) �G � First print out an identifier, so I can tell if it is my file! �! � MyFileIdentifier$;�(10); ; � Open Out A File And Print Out All the information! . � Loop%=TopSetIndexStart% � TapeNumber% 0 � �_ReadIconText(Main%,Loop%,�);�(10); � (1 � �_ReadIconText(Main%,UserNote%,�);�(10); 2" � Then Close the file again < *SPOOL F ș "OS_Byte",3,0 P1 � "SetType "+PathName$+" "+�~(MyFileType%) Zq � Overwrite leafname text with "BoffBright" to enable auto insertion of the tape number for the file name! d2 PathName$=�PathName$,Pointer%)+"BoffBright" n' �_SetIconText(4,Save%,PathName$) x� �: �?� ********************************************************* �?� This Handles The Dragging Of THe Outline Of The Save Box. �?� ********************************************************* �� �_DragSave � !Block%=Save% �' ș "Wimp_GetWindowState",,Block% �" OffsetX%=Block%!4-Block%!20 �# OffsetY%=Block%!16-Block%!24 � Block%!0=Save% � Block%!4=0 �% ș "Wimp_GetIconState",,Block% � !Block%=Save% Block%!4=5 ! Block%!8=Block%!8+OffsetX% # Block%!12=Block%!12+OffsetY% "# Block%!16=Block%!16+OffsetX% ,# Block%!20=Block%!20+OffsetY% 6 Block%!24=0 @ Block%!28=0 J Block%!32=&7FFFFFFF T Block%!36=&7FFFFFFF ^ ș "Wimp_DragBox",,Block% h� r: |@� ********************************************************** �@� When A File Is Dropped Onto My Icon Bar Icon, I Come Here! �@� ********************************************************** �� �_FileDroppedOnMe �! � Block%!40 =MyFileType% � �+ SaveName$=�_ReadString(Block%+44) � Block%!12=Block%!8 � Block%!16=4 �< ș "Wimp_SendMessage",usr_message%,Block%,Block%!4 �( �_DoActualLoadThing(SaveName$) � � �! � Block%!40 =ConfigFile% � � �_ReadUserData �" � InlayType$="Video_8" � $ menu%!(28+24*2)=Ticked% V menu%!(28+24*3)=NotTicked% : � Tick Item 2, Untick Item 3 5 menu%!(28+24*4)=NotTicked% � Underlined% & � 0 � InlayType$="VHS_C" � :' menu%!(28+24*2)=NotTicked% DW menu%!(28+24*3)=Ticked% : � Tick Item 3, Untick Item 2 N5 menu%!(28+24*3)=NotTicked% � Underlined% X � b � InlayType$="DAT" � l' menu%!(28+24*2)=NotTicked% vV menu%!(28+24*3)=NotTicked% : � Tick Item 3, Untick Item 2 �2 menu%!(28+24*3)=Ticked% � Underlined% � � � � �� �: �U� ******************************************************************************* �U� Control Comes Here When A Valid File Type Has Been Dropped Onto My Application. �U� ******************************************************************************* �� �_LoadData(FileName$) � LoadFile%=�(FileName$) � TempText$=�#(LoadFile%) �X � TempText$<>MyFileIdentifier$ � � #LoadFile% : � 2001,"Not a !Video saved file." �2 � LoadLoop%=TopSetIndexStart% � TapeNumber% ! TempText$=�#(LoadFile%) 2 �_SetIconText(LoadLoop%,Main%,TempText$) # �_Redraw(Main%,LoadLoop%) � * TempText$=�#(LoadFile%) 4/ �_SetIconText(UserNote%,Main%,TempText$) > �_Redraw(Main%,UserNote%) H � #LoadFile% R� \: fK� ********************************************************************* pJ� Reads State Of Icons in Window Stated and Returns The First Selected zF� Icon In The Give Exclusive Selection Group. (-1 = None Selected) �J� ******************************************************************** �+� �_ReadESGSelected(WindowHandle%,Esg%) � � Mask%,Pattern% �A Mask% = (1<<21)+(31<<16) : � Bit 21 and Bits 16-20 �> Pattern%= (1<<21)+(Esg%<<16) : � Selected and ESG X �B ș "Wimp_WhichIcon",WindowHandle%,Block%+200,Mask%,Pattern% �=Block%!200 �: �: �i� *************************************************************************************************** �g� ALTHOUGH A LOT OF THE ABOVE CODE IS STILL VERY SPECIFIC TO THIS PROGRAM, IT CAN BE EASILY ADAPTED �U� ALL CODE BELOW THIS LINE IS UNLIKELY TO BE OF MUCH USE TO ANY OTHER APPLICATION �i� *************************************************************************************************** : : 6� ************************************************ $6� Move Caret Up To The Next Entry, With Wrap-round .6� ************************************************ 8� �_MoveUpAnEntry B � I% L/ � Icon%<=(BtmSetItemEnd%-2) � I%=Icon%+2 VC � Icon%=BtmSetIndexEnd% � Icon%=BtmSetItemEnd% � I%=Icon%-48 `C � Icon%>TitleFirstLine% � Icon%<=TitleLastLine% � I%=Icon%-1 j2 � Icon%=TitleFirstLine% � I%=TitleLastLine% t@ � Icon%=TitleFirstLine% � CantGoToLastTitle% � I%=Icon%+1 ~$ �_SetCaretPosition(I%,Index%) �� �: �4� ********************************************** �4� Move Caret Down To Next Entry, With Wrap-round �4� ********************************************** �� �_MoveDownAnEntry � � I% �2 � Icon%>=(TopSetIndexStart%+2) � I%=Icon%-2 �G � Icon%=TopSetIndexStart% � Icon%=TopSetItemStart% � I%=Icon%+48 �C � Icon%<TitleLastLine% � Icon%>=TitleFirstLine% � I%=Icon%+1 �2 � Icon%=TitleLastLine% � I%=TitleFirstLine% �J � Icon%=TitleFirstLine%+1 � CantGoToLastTitle% � I%=TitleFirstLine% $ �_SetCaretPosition(I%,Index%) � : � �_MoveDownOneBackOne (D � Icon%>(TopSetIndexStart%+2) � �_SetCaretPosition(Icon%-3,0) 2@ � Icon%=TopSetItemStart% � �_SetCaretPosition(Icon%+47,0) <� F: P@� ********************************************************** Z4� Printout the contents of the writable icons!!! d@� ********************************************************** n� �_PrintOut x) Ȏ �_ReadESGSelected(Options%,9) � �2 � 0 : �_PrintTextMode(NlqON$,InlayType$) �3 � 1 : �_PrintTextMode(NlqOFF$,InlayType$) �/ � 5 : �_PrintGraphicsMode(InlayType$) � � 2001, "ModeErr" � � �� �: �;� ***************************************************** �4� Print out the label in text mode (non Risc OS) �;� Parameter is an optional control string (ie NLQ etc.) �;� ***************************************************** �)� �_PrintTextMode(Prelog$,InlayType$) � � L% � �_Printer_NotOnLine � � ș "Hourglass_On" : "< ș "OS_Byte",3,10 :� SCREEN OFF, PRINTER ON. ,/ �_SendData(Prelog$) :� Set NLQ Mode 6 : @ �_DoPrinting(InlayType$) J : T � L%=0 � �(FormLength$) ^ � :� short Form Feed h � r : |< ș "OS_Byte",3,00 :� SCREEN ON, PRINTER OFF. � ș "Hourglass_Off" �� �: �� �_Centre(Text$,Width%) �,NewText$=�(Width%-�(Text$))/2," ")+Text$ �.NewText$=NewText$+�Width%-�(NewText$)," ") � =NewText$ �: �@� ********************************************************** �.� Function to check if printer is on line, �@� If printer is not online TRUE is returned, otherwise FALSE �@� ********************************************************** �� �_Printer_NotOnLine ș "Hourglass_On" � # PrinterOnLine=� : What%=0 & Now%=� 0 Before%=�(-4) :/ � 2,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,3 D! Now%=� : � � �>Now%+100 N After%=�(-4) X � Before%<>After% � b ș "Hourglass_Off" l PrinterOnLine=� vz $Block%="The printer is not responding. Please check it has paper, it is switched on and on-line. Try again?" �E ș "Wimp_ReportError",Block%,%10011,MyTaskName$ � ,What% � ș "Hourglass_On" � � �4 � PrinterOnLine � (� PrinterOnLine � What%=2) � ș "Hourglass_Off" � � What%=2 � =� �=� �: �H� ****************************************************************** �H� Prints contents of Icon(Icon%) right justified in a field of Chars �H� ****************************************************************** �!� �_RightJustify(Icon%,Char%) �* Text$=�_ReadIconText(Main%,Icon%,�) !=�Char%-�(Text$)," ")+Text$ !: !L� ********************************************************************** ! L� This is purely for program variables and is nothing to do with Risc_OS !*L� ********************************************************************** !4$� �_Initialise_Program_Variables !>Y � Initailise Global variables first, These are usable in all RISCOS WIMP programs. !Hm `white = 0 : `grey1 = 1 : `grey2 = 2 : `grey3 = 3 : `grey4 = 4 : `grey5 = 5 : `grey6 = 6 : `black = 7 !R� `dark_blue = 8 : `yellow = 9 : `green = 10 : `red = 11 : `cream = 12 : `army_green = 13 : `orange = 14 : `light_blue = 15 !\d msg_quit% = 0 : msg_datasave% = 1 : msg_dsaveACK% = 2 : msg_dataload% = 3 : msg_dloadACK% = 4 !fq msg_RAMfetch% = 6 : msg_RAMtrans% = 7 : usr_message% = 17 : usr_msgrecorded% = 18 : msg_taskinit% = &400C2 !p. msg_help% = &502 : msg_helpACK% = &503 !z : !�6 � Variables to do with RiscOS PDriver InterFace !� Box%=Box% : � Box%<>0 � � !� � Box% 16 : � Box2% 16 !�7 ScaleX%=1 : ScaleY%=1 :� For Future Expansion? !� � Matrix% 16 !�0 Matrix%!04=0 : Matrix%!00=2^16*ScaleX% !�0 Matrix%!08=0 : Matrix%!12=2^16*ScaleY% !� � Origin% 8 !�: !�4 � Global variables, specific to this program. !�O LongEqual_8$ = "|"+�44,"=")+"|" : LongEqual_C$ = "|"+�42,"=")+"|" !�O LongMinus_8$ = "|"+�44,"-")+"|" : LongMinus_C$ = "|"+�42,"-")+"|" !�O BlankLine_8$ = "|"+�44," ")+"|" : BlankLine_C$ = "|"+�42," ")+"|" " New% = � " NLQ% = � "# NlqON$ = "27,120,1" "$# NlqOFF$ = "27,120,0" ".E EliteON$ = "27,77" : � Set 12 Characters per Inch "8A EmphasisedON$ = "27,69" : � Select Emphasised Mode "BC EmphasisedOFF$ = "27,70" : � Deselect Emphasised Mode "L# PrintFile$ = "PrintOut" "VD InlayType$ = "Video_8" : � Default to Video_8 format "`r LatestVer% = 4 : � Version Number Of Config File. Change If File Is Made Incompatable..... "j MainWindowOpen% = � "tT WindowTitle$ = " Video Inlay Printer " : DatTitle$ = " DAT Inlay Printer " "~ CantGoToLastTitle%=� "� OldName$ = "" "�: "�O � Give names to some of the icons etc. to make the program more readable "�* MyFileType%=&FFF : ConfigFile%=&D0B "�G MyFileIdentifier$="!Video Saved Inlay File. � M.S.Bright 1992" "�% BackGround%= -1 : IconBar%= -2 "�Z TopSetIndexStart%=00 : TopSetIndexEnd%=22 : TopSetItemStart%=01 : TopSetItemEnd%=23 "�Z BtmSetIndexStart%=24 : BtmSetIndexEnd%=48 : BtmSetItemStart%=25 : BtmSetItemEnd%=49 "�- TitleFirstLine%=51 : TitleLastLine%=53 "�% NumberOfLines%=56 : Format%=66 "�7 TapeNumber%=54 : UserNote% =67 : DriverName%=59 "�7 PrintF% =65 : PrintL% =64 : PrintD% =63 # 7 OptionsOKF%=28 : OptionsOKL%=26 : OptionsOKD%=27 # < NlqON%=12 : NlqOFF%=16 : FormLength%=20 : EliteON%=34 #F SaveOKF% =11 : SaveOKL% =9 : SaveOKD% =10 : SaveIcon%= 0 #2 Ticked%=%1 : NotTicked%=0 : Underlined%=%10 #( � PDriver$(6) #26 PDriver$(0)="Null:" : PDriver$(1)="NLQ Printer" #<@ PDriver$(2)="Draft Printer" : PDriver$(6)="RiscOS Driver" #F �_ReadUserData #P �_SetUpIconBarMenu #Z: #dF � Get SWI Numbers for font calls to speed up bottleneck in code #n; ș "OS_SWINumberFromString",,"Font_FindFont" � Find% #x; ș "OS_SWINumberFromString",,"Font_LoseFont" � Lose% #�9 ș "OS_SWINumberFromString",,"Font_SetFont" � Set% #�9 ș "OS_SWINumberFromString",,"Font_Paint" � Paint% #�: #�: BaseFont$=�_ConvertSystemToString("Video$BaseFont") #�: EdgeFont$=�_ConvertSystemToString("Video$EdgeFont") #�: BoldFont$=�_ConvertSystemToString("Video$BoldFont") #�9 TapeNumber$=�_ConvertSystemToString("Tape$Prefix") #� � �(TapeNumber$)>3 � #�" Clipped$=�TapeNumber$,3) #� !Block%=9090 #�u Error$="Tape$Prefix is set to longet than 3 characters. OK to clip to "+Clipped$+" Cancel to abort program" #�! $(Block%+4)=Error$ + �0 #�B ș "Wimp_ReportError",Block%,%011,MyTaskName$ � ,Result% $# � Result%=2 � �_CloseDown $$ TapeNumber$=Clipped$+" 00" $ � $"' TapeNumber$=TapeNumber$+" 00" $, � $6� $@: $J(� �_ConvertSystemToString(Variable$) $T � Loop% $^1 � Loop%=100 � 150 � 4 : Block%!Loop%=0 : � $h5 ș "OS_ReadVarVal",Variable$,Block%+100,50,0,3 $r=�_ReadString(Block%+100) $| : $�S� ***************************************************************************** $�Q� Store User Configurable Settings In Config File Within !Video8 Application. $�S� ***************************************************************************** $�� �_StoreUserData $�0 DataFile%=�"<Video$Dir>.Resources.Config" $� � #DataFile%,LatestVer% $�5 � #DataFile%,�_ReadIconText(Options%,NlqON%,�) $�6 � #DataFile%,�_ReadIconText(Options%,NlqOFF%,�) $�: � #DataFile%,�_ReadIconText(Options%,FormLength%,�) $�7 � #DataFile%,�_ReadIconText(Options%,EliteON%,�) $�3 � #DataFile%,�_ReadIconText(Main%,Format%,�) $�1 � #DataFile%,�_ReadESGSelected(Options%,9) $� � #DataFile% % ș "Wimp_CreateMenu",,-1 %� %: %&R� **************************************************************************** %0P� Read User Configurable Settings In Config File Within !Video8 Application. %:R� **************************************************************************** %D� �_ReadUserData %N0 DataFile%=�"<Video$Dir>.Resources.Config" %X � DataFile%=0 � � %b Ver%=�#DataFile% %l � #DataFile%,NlqON$ %v � #DataFile%,NlqOFF$ %� � #DataFile%,FormLength$ %� � #DataFile%,EliteON$ %� � #DataFile%,InlayType$ %�' � #DataFile%,SelectedPrinterIcon %� � #DataFile% %�- � Ver%<LatestVer% � � 1000,"ConfigErr" %�[ � SelectedPrinterIcon=15 � SelectedPrinterIcon=5 : � Fudge for template change - Stu %�- �_SetIconText(20,Options%,FormLength$) %� �_Redraw(Options%,20) %�( �_SetIconText(12,Options%,NlqON$) %� �_Redraw(Options%,12) %�) �_SetIconText(16,Options%,NlqOFF$) %� �_Redraw(Options%,16) &G �_SetIconText(DriverName%,Main%,PDriver$(SelectedPrinterIcon+1)) &" �_Redraw(Main%,DriverName%) &. �_SetIconText(Format%,Main%,InlayType$) & �_Redraw(Main%,Format%) &*5 �_SelectIcon(Options%,0,SelectedPrinterIcon=0) &45 �_SelectIcon(Options%,1,SelectedPrinterIcon=1) &>5 �_SelectIcon(Options%,5,SelectedPrinterIcon=5) &H� &R: &\'� �_SelectIcon(Window%,Icon%,Flag%) &f Block%!0=Window% &p Block%!4=Icon% &z Block%!8=(-1*Flag%)<<21 &� Block%!12=1<<21 &�% ș "Wimp_SetIconState",,Block% &�� &�: &�*� �_NotSelectable(Window%,Icon%,Flag%) &� Block%!0=Window% &� Block%!4=Icon% &�' � Make unselectable / Selectable &� Block%!8=(-1*Flag%)<<22 &� Block%!12=1<<22 &�% ș "Wimp_SetIconState",,Block% &�% � Make non-writable / Writable &�: � Flag%=� � Block%!8=%0000<<12 � Block%!8=%1111<<12 ' Block%!12=%1111<<12 '% ș "Wimp_SetIconState",,Block% ' CantGoToLastTitle%=Flag% '$H � Flag% � MainWindowOpen% � �_SetCaretPosition(TitleFirstLine%,0) '.� '8: 'B^� **************************************************************************************** 'L^� This Takes A 'Numeric' String, Breaks it Down, And Sends The Value To The Output Device. 'V^� **************************************************************************************** '`� �_SendData(Data$) 'j � Finish%,Count% 't" Count%=0 : Finish%=�(Data$) '~G Data$=Data$+"," : � This is cheating...See WHILE Condition!!!!!! '� � '� Sub$="" '� Pointer%=1 '�$ ȕ �Data$,Pointer%,1)<>"," '�) Sub$=Sub$+�Data$,Pointer%,1) '� Pointer%+=1 '� � '�" Data$=�Data$,Pointer%+1) '� � �(�(Sub$)); '�! Count%=Count%+�(Sub$)+1 '� � Count%>=Finish% '�� ( : ( g*************************************************************************************************** (e� Sets The Save Name In The Save Icon To The Full Pathname Of The Loaded File, And Then Loads It. (g*************************************************************************************************** (($� �_DoActualLoadThing(FileName$) (2' �_SetIconText(4,Save%,FileName$) (< �_LoadData(FileName$) (F �_OpenMainWindow(�) (P� (Z: (dD**************************************************************** (nB� Initialises User Sprite Area, and Loads sprite file into it. (xD**************************************************************** (�� �_Initialise_Sprites (�. Temp%=� "<Video$Dir>.Resources.Sprites" (� FileLength%=4+(�#Temp%) (� � #Temp% (� � SpriteArea% FileLength% (� SpriteArea%!0=FileLength% (� SpriteArea%!4=0 (� SpriteArea%!8=16 (� SpriteArea%!12=16 (�H ș "OS_SpriteOp",&10A,SpriteArea%,"<Video$Dir>.Resources.Sprites" (�� (�: (�/******************************************* )-� Communicate with RiscOS Printer Driver. )/******************************************* )%� �_PrintGraphicsMode(InlayType$) )"4 � Check For Presence Of PrinterDriver Modules ),< ș "XOS_SWINumberFromString",,"PDriver_Info" � ;Flag% )6J � Flag% � 1 � � 2001,"No Printer Driver, Please Load and Try Again" )@: )J � PrintFile%,OldJob% )T � White%, PageToPrint% )^) White%=&FFFFFF00 : E%=0 : Usage%=0 )h PrintFile%=�"printer:" )r � � )|N � � � : � � : F%=� : F$=�$ : � #PrintFile% : � E%=0 � � F%,F$ � � E%,F$ )�E ș "PDriver_SelectJob",PrintFile%,"Boffin Print Job" � OldJob% )� ș "Hourglass_On" )� � � )�� � � � : � � : E%=� : E$=�$ : ș "Hourglass_Off" : ș "PDriver_AbortJob",PrintFile% : ș "PDriver_SelectJob",OldJob% : � E%,E$ )�9 � InlayType$="Video_8" � �_GetDocumentSize_8(Box%) )�9 � InlayType$="VHS_C" � �_GetDocumentSize_C(Box%) )�9 � InlayType$="DAT" � �_GetDocumentSize_D(Box%) )�\ �_FitToPage(Height%,Width%) : ș "PDriver_GiveRectangle",,Box%,Matrix%,Origin%,White% )�6 ș "PDriver_DrawPage",1,Box2%,0,0 � CopiesLeft% )� ȕ CopiesLeft% )� �_DrawInlay(Box2%) )�7 ș "PDriver_GetRectangle",,Box% � CopiesLeft% )� � *% ș "PDriver_EndJob",PrintFile% * � � * ș "Hourglass_Off" *&% ș "PDriver_SelectJob",OldJob% *0 � � *: � #PrintFile% *D� *N: *X� �_OpenSubMenu(Window%) *b' ș "Wimp_GetPointerInfo",,Block% *l< ș "Wimp_CreateMenu",,Window%,Block%!0-64,Block%!4+48 *v� *�: *�!� �_FitToPage(Height%,Width%) *�" � Left%,Bottom%,Right%,Top% *�e � Returns values in Millipoints, Height% & Width% are in OS Units. 1 OS Unit = 400 Millipoints *�; ș "PDriver_PageSize" � ,,,Left%,Bottom%,Right%,Top% *�M OriginX%=((Right%+Left%)-(Width%*400))/2 : OriginY%=Top%-(Height%*400) *�. Origin%!0=OriginX% : Origin%!4=OriginY% *�� *�: *�-� �_CentreProp(Text$,Y%,Postfix$,Length%) *�8 � Postfix$="" � ș "Font_SetFont",BaseFontHandle% *�< � Postfix$="Bold" � ș "Font_SetFont",BoldFontHandle% *�= � Postfix$="Title" � ș "Font_SetFont",EdgeFontHandle% +B ș "Font_StringBBox",,Text$ � ,,,StringLengthInMillipoints% +: � StringLengthInMillipoints%>(Length%/25.4)*72000 � +p ș "Font_StringWidth",,Text$,(Length%/25.4)*72000,15000,-1,�(Text$) � ,,,,NumberOfPrintableCharacters% + ; TextToPrint$=�Text$,NumberOfPrintableCharacters%) +*; Continue%=�_WarnAboutClipping(Text$,TextToPrint$) +4D � Continue%=� � � 2001,"Aborting Printout. OK to Continue" +> � +H[ LengthInMM%=(StringLengthInMillipoints%/72000)*25.4 : X%=(Length%-LengthInMM%)*7.1/2 +R( �_FontPaint(Postfix$,Text$,X%,Y%) +\� +f: +pE***************************************************************** +zC� Select required Font and colour, then print Message$ at X%,Y% +�E***************************************************************** +�*� �_FontPaint(PostFix$,Message$,X%,Y%) +� � FontHandle% +� � Message$="" � � +�; � Dont Waste Time Messing about if nothing to print! +�8 � PostFix$="" � ș "Font_SetFont",BaseFontHandle% +�< � PostFix$="Bold" � ș "Font_SetFont",BoldFontHandle% +�= � PostFix$="Title" � ș "Font_SetFont",EdgeFontHandle% +�< ș "ColourTrans_SetFontColours",0,&FFFFFF00,&00000000 +� : +�h � Don't bother trimming the user-Note as this has got more space to work in than the other icons. +�7 � PostFix$<>"Bold" � Text$=�_TrimToFit(Message$) +�! ș Paint%,,Text$,&10,X%,Y% ,� ,: ,S� ***************************************************************************** ,$S� Prints the tape number in a smaller point size at a fixed place on the inlay. ,.S� ***************************************************************************** ,8� �_PrintTapeNumber ,B � Text$,FontHandle% ,L8 ș Find%,,BaseFont$,10*16,10*16,0,0 � FontHandle% ,V< ș "ColourTrans_SetFontColours",0,&FFFFFF00,&00000000 ,` : ,j0 Text$=�_ReadIconText(Main%,TapeNumber%,7) ,tD � InlayType$="VHS_C" � ș Paint%,,Text$,&10,X3%-100,Y3%+130 ,~C � InlayType$="Video_8" � ș Paint%,,Text$,&10,X3%-100,Y3%+82 ,�B � InlayType$="DAT" � ș Paint%,,Text$,&10,X3%-95,Y3%+60 ,� : ,� ș Lose%,FontHandle% ,�� ,�: ,�_� ***************************************************************************************** ,�_� Check the printed length of the text against the size in pixels, and shorten if required. ,�!� Uses : FN_WarnAboutClipping ,�_� ***************************************************************************************** ,�� �_TrimToFit(Text$) ,�% � NumberOfPrintableCharacters% ,� Continue%=� - ; � InlayType$="Video_8" � Max_X_Size%=(74/25.4)*72000 - ; � InlayType$="VHS_C" � Max_X_Size%=(73/25.4)*72000 -; � InlayType$="DAT" � Max_X_Size%=(60/25.4)*72000 -d ș "Font_StringWidth",,Text$,Max_X_Size%,15000,-1,�(Text$) � ,,,,NumberOfPrintableCharacters% -(8 TextToPrint$=�Text$,NumberOfPrintableCharacters%) -2b � NumberOfPrintableCharacters%<�(Text$) � Continue%=�_WarnAboutClipping(Text$,TextToPrint$) -<) � Continue%=� � � 2001,"PrintKill" -F=TextToPrint$ -P: -ZZ� ************************************************************************************ -d[� If Clipping will occour, then display Warning message and allow user option to abort. -n� Uses: NONE -xZ� ************************************************************************************ -�1� �_WarnAboutClipping(IconText$,TextToPrint$) -� � Error$ -� !Block%=0 -�r Error$="This text "+IconText$+" does not fit. Clipping to "+TextToPrint$+" OK to continue, CANCEL to abort" -� $(Block%+4)=Error$ + �0 -�A ș "Wimp_ReportError",Block%,%10011,MyTaskName$ � ,Result% -�. � Result%=2 � Continue%=� � Continue%=� -�4 ș "Wimp_ReportError",Block%,1<<6,MyTaskName$ -�=Continue% -�: -�B� ************************************************************ -�B� Give help to the interactive help by sending a message to it -�B� ************************************************************ ./� �_GiveHelp(Window%,Icon%,MouseX%,MouseY%) .0 � Window%=-2 � Icon%=IconBarIconHandle% � .� Message$="Video Label Printer|MUtility to print out cassette inlay sleeves for Video camera cassettes, (Video 8 or VHS_C Format only) and DAT audio tapes." ." � New% � .,g Message$+="|<SELECT> to start with blank screen|M|<ADJUST> to start with on-screen hints." .6 � .@E Message$+="|<SELECT> or |<ADJUST> to show current Inlay" .J � .T �_SendHelp(Message$) .^ � .h � Window%=Main% � .r Track%=24-(Icon% � 2)+1 .| Ȏ Icon% � .� � -13 .�� �_SendHelp("This is the Archimedes Video cassette Label Printer.|MDesigned and coded by Mark Bright.|MYou are using version "+Version$+".|M") .� � PrintF% .�� �_SendHelp("Click any mouse button to send the contents of the window to the printer.|MPressing the |<PRINT> Key performs the same function.") .�Q � 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48 .� � Icon%=00 � .�H Up$="|<CURSOR UP> to move to Index for item 1.|M" .� � .�V Up$="|<CURSOR UP> to move to Index for item "+�(Track%+1)+".|M" .� � .�- � Icon%=BtmSetIndexEnd% � .�M Down$="|<CURSOR DOWN> to move to Index for item 25.|M" .� � /Z Down$="|<CURSOR DOWN> to move to Index for item "+�(Track%-1)+".|M" / � /L Tab$="|<TAB> to move to Title for Item "+�(Track%)+".|M" /&a �_SendHelp("Enter the Index for item number "+�(Track%)+".|M"+Up$+Down$+Tab$) /0Q � 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49 /: � Icon%=01 � /DH Up$="|<CURSOR UP> to move to Title for item 1.|M" /N � /XV Up$="|<CURSOR UP> to move to Title for item "+�(Track%+1)+".|M" /b � /l � Icon%=49 � /vM Down$="|<CURSOR DOWN> to move to Title for item 25.|M" /� � /�Z Down$="|<CURSOR DOWN> to move to Title for item "+�(Track%-1)+".|M" /� � /�L Tab$="|<TAB> to move to Index for item "+�(Track%)+".|M" /�a �_SendHelp("Enter the Title of track number "+�(Track%)+".|M"+Up$+Down$+Tab$) /� � 51,52,53 /�R Up$ ="|<CURSOR UP> to move to previous line of tape title.|M" /�P Down$="|<CURSOR DOWN> to move to next line of tape title.|M" /�^ � Icon%=53 � Down$="|<CURSOR DOWN> to move to first line of tape title.|M" /�Z � Icon%=51 � Up$="|<CURSOR UP> to move to third line of tape title.|M" /�J �_SendHelp("Enter the title of the tape.|M"+Up$+Down$) /� � TapeNumber% /�M �_SendHelp("This is the Index number for this cassette!") 0 � DriverName% 0Z �_SendHelp("This is the Current Installed Printer - See Options Menu") 0 � UserNote% 0 � �_SendHelp("Enter any notes you wish here, eg Video8 / VideoHI8 / VHS_C format, dates Etc|MIf this is left blank a standard copywrite message will be put in its place") 0* � Format% 04� �_SendHelp("Display which print format you have currently selected. Note: This is saved with your configuration") 0> 0H� �_SendHelp("Misc. Help :|M|<f10> - Swap case |<f11> - Delete to end of line|M|<Shift>|<f9> - Wipe all fields. |<Home> - Go to Index #1|M") 0R 0\ � 0f � 0p � Window%=Options% � 0z Ȏ Icon% � 0�< � 01 : �_SendHelp("Select Draft printing mode") 0�: � 00 : �_SendHelp("Select NLQ printing mode") 0�L � 05 : �_SendHelp("Select RiscOS printer driver printing mode") 0�l � 12 : �_SendHelp("Enter your printer code for NLQ ON if it is different from the code shown.") 0�m � 16 : �_SendHelp("Enter your printer code for NLQ OFF if it is different from the code shown.") 0�o � 34 : �_SendHelp("Enter your printer code for 12 CPI ON if it is different from the code shown.") 0�� � 20 : �_SendHelp("Enter how many lines you want the paper to feed after character mode printing to clear the tear off bar") 0�[ � 28 : �_SendHelp("Save all the above preferences to the configuration file.") 0� � 0� � 0�� 0�: 0�:� **************************************************** 1:� Send the help-giving message to the help application 1:� **************************************************** 1� �_SendHelp(Message$) 1$ Block%!12=Block%!8 1. Block%!16=msg_helpACK% 18$ !Block%=(�(Message$)+25)� � 3 1B $(Block%+20)=Message$+�0 1L9 ș "Wimp_SendMessage",usr_message%,Block%,Block%!4 1V� 1`: 1j3� ********************************************* 1t3� Swaps the case of of the specified character. 1~3� ********************************************* 1�&� �_SwapCase(Window%,Icon%,Index%) 1�2 � Index%<�(�_ReadIconText(Main%,Icon%,�)) � 1�1 IconText$=�_ReadIconText(Main%,Icon%,�) 1�, C%=�(�IconText$,Index%+1,1)) � &DF 1� � C%>=&41 � C%<=&5A � 1�2 C$=�(�(�IconText$,Index%+1,1)) � &20) 1�& �IconText$,Index%+1,1)=C$ 1�3 �_SetIconText(Icon%,Window%,IconText$) 1�" �_Redraw(Main%,Icon%) 1� � 1�, �_SetCaretPosition(Icon%,Index%+1) 1� � 2 � 2 : 2L� ********************************************************************** 2L� Sets the case of all the writable icons to ensure a consistant format. 2(L� ********************************************************************** 22� �_FormatIconText 2< � Loop% 2F5 � Loop%=TopSetIndexStart% � BtmSetItemEnd% � 2 2P5 �_SetIconText(Loop%+1,Main%,�_CEW(Loop%+1)) 2Z! �_Redraw(Main%,Loop%+1) 2d � 2n/ � Loop%=TitleFirstLine% � TitleLastLine% 2x6 �_SetIconText(Loop%,Main%,�_Icon_FTU(Loop%)) 2� �_Redraw(Main%,Loop%) 2� � 2�N � User note text is free format, I.E. I do not impose any rules at all! 2�� 2�: 2�7� ************************************************* 2�7� Function to Capitalise Each Word in a given Icon. 2�7� ************************************************* 2�� �_CEW(Icon%) 2�$ � IconText$, Index%, End%, C% 2�. IconText$=�_ReadIconText(Main%,Icon%,�) 2�) � If icon is empty, abandon format 2�" � IconText$="" � =IconText$ 3# Index%=1 : End%=�(IconText$) 3 � Get 1st character 3 ȕ Index%<=End% 3"7 �IconText$,Index%,1)=�_Char_FTU(Icon%,Index%) 3, Index%+=1 36! C$=�IconText$,Index%,1) 3@5 � Loop until end of word (or end of string) 3J# ȕ C$<>" " � Index%<=End% 3T: �IconText$,Index%,1)=�_Char_FTL(Icon%,Index%) 3^ Index%+=1 3h$ C$=�IconText$,Index%,1) 3r � 3|9 � Loop until next word found (Or end of string) 3�" ȕ C$=" " � Index%<=End% 3� Index%+=1 3�$ C$=�IconText$,Index%,1) 3� � 3� �Index%,End% 3� � 3�=IconText$ 3�: 3�?� ********************************************************* 3�?� Function to Force all text in a given icon to UPPER CASE. 3�?� ********************************************************* 3�� �_Icon_FTU(Icon%) 3� � IconText$ 4. IconText$=�_ReadIconText(Main%,Icon%,�) 4# Index%=1 : End%=�(IconText$) 4 ȕ Index%<=End% 4&7 �IconText$,Index%,1)=�_Char_FTU(Icon%,Index%) 40 Index%+=1 4:! C$=�IconText$,Index%,1) 4D � 4N=IconText$ 4X: 4b?� ********************************************************* 4l?� Function to Force all text in a given icon to LOWER CASE. 4v?� ********************************************************* 4�� �_Icon_FTL(Icon%) 4� � IconText$ 4�. IconText$=�_ReadIconText(Main%,Icon%,�) 4�# Index%=1 : End%=�(IconText$) 4� ȕ Index%<=End% 4�7 �IconText$,Index%,1)=�_Char_FTL(Icon%,Index%) 4� Index%+=1 4�! C$=�IconText$,Index%,1) 4� � 4�: 4�8� ************************************************** 4�8� Function to Force a given character to UPPER CASE. 4�8� ************************************************** 5� �_Char_FTU(Icon%,Index%) 5 � Temp$ 5! Temp$=�IconText$,Index%,1) 5 : � Temp$>="a" � Temp$<="z" � Temp$=�(�(Temp$) � &DF) 5* =Temp$ 54: 5>8� ************************************************** 5H8� Function to Force a given character to LOWER CASE. 5R8� ************************************************** 5\� �_Char_FTL(Icon%,Index%) 5f � Temp$ 5p! Temp$=�IconText$,Index%,1) 5z: � Temp$>="A" � Temp$<="Z" � Temp$=�(�(Temp$) � &20) 5� =Temp$ 5�: 5�Z� ************************************************************************************ 5�Z� Set up variable for print routine to give correct sizes & format for Video_8 inlays. 5�Z� ************************************************************************************ 5�� �_GetDocumentSize_8(Box%) 5� PrintTop%=� 5�2 � L%=TopSetIndexStart% � TopSetItemEnd% � 2 5�[ � �_ReadIconText(Main%,L%,�)<>"" � �_ReadIconText(Main%,L%+1,�)<>"" � PrintTop%=� 5� � 5�/ � PrintTop% � Height%=1105 � Height%=670 5�# Width%=675 : � 7.1 UNITS=1MM 5�& X1%=0 : X2%=135 : X3%=Width% 6= � Y1%=0 : Y2%=114 : Y3%=227 : Y4%=670 : Y5%=Height% 6G Y1%=Height% : Y2%=Y1%-114 : Y3%=Y1%-227 : Y4%=Y1%-670 : Y5%=0 6" Box%!0=0 : Box%!4=0 6$e Box%!8=Width%+20 : Box%!12=Height%+20 : � To Allow For Rounding Errors In Conversion Routines. 6., � Set up variable for inlay printing. 68d Font1X%=13*16 : Font1Y%=12*16 : Font2X%=12*16 : Font2Y%=12*16 : Font3X%=13*16 : Font3Y%=13*16 6B UserNote_Y_Offset%=Y2%+35 6Lg Title1_Y_Offset%=Y3%+82 : Title2_Y_Offset%=Y3%+47 : Title3_Y_Offset%=Y3%+12 : Title_X_Offset%=80 6V] Index_X_Offset%=X1%+20 : Item_X_Offset%=X2%+10 : Text_Drop_Btm%=25 : Text_Drop_Top%=30 6`> Copyright_Text$="Video_8 Index Printer � M.Bright 1992" 6j� 6t: 6~X� ********************************************************************************** 6�X� Set up variable for print routine to give correct sizes & format for VHS_C inlays. 6�X� ********************************************************************************** 6�� �_GetDocumentSize_C(Box%) 6� PrintTop%=� 6�2 � L%=TopSetIndexStart% � TopSetItemEnd% � 2 6�[ � �_ReadIconText(Main%,L%,�)<>"" � �_ReadIconText(Main%,L%+1,�)<>"" � PrintTop%=� 6� � 6�/ � PrintTop% � Height%=1120 � Height%=700 6�# Width%=653 : � 7.1 UNITS=1MM 6�& X1%=0 : X2%=120 : X3%=Width% 6�= � Y1%=0 : Y2%=110 : Y3%=280 : Y4%=700 : Y5%=Height% 6�K Y1%=Height% : Y2%=Height%-110 : Y3%=Y1%-280 : Y4%=Y1%-700 : Y5%=0 7 " Box%!0=0 : Box%!4=0 7 e Box%!8=Width%+20 : Box%!12=Height%+20 : � To Allow For Rounding Errors In Conversion Routines. 7, � Set up variable for inlay printing. 7d Font1X%=13*16 : Font1Y%=13*16 : Font2X%=13*16 : Font2Y%=12*16 : Font3X%=12*16 : Font3Y%=12*16 7( UserNote_Y_Offset%=Y2%+35 72h Title1_Y_Offset%=Y3%+130 : Title2_Y_Offset%=Y3%+75 : Title3_Y_Offset%=Y3%+20 : Title_X_Offset%=80 7<] Index_X_Offset%=X1%+10 : Item_X_Offset%=X2%+10 : Text_Drop_Btm%=25 : Text_Drop_Top%=28 7F< Copyright_Text$="VHS-C Index Printer � M.Bright 1992" 7P� 7Z: 7dV� ******************************************************************************** 7nV� Set up variable for print routine to give correct sizes & format for DAT inlays. 7xV� ******************************************************************************** 7�� �_GetDocumentSize_D(Box%) 7� PrintTop%=� 7�2 � L%=TopSetIndexStart% � TopSetItemEnd% � 2 7�[ � �_ReadIconText(Main%,L%,�)<>"" � �_ReadIconText(Main%,L%+1,�)<>"" � PrintTop%=� 7� � 7�5 � PrintTop% � Height%=7.1*130 � Height%=7.1*77 7�& Width%=7.1*73 : � 7.1 UNITS=1MM 7�) X1%=0 : X2%=7.1*12 : X3%=Width% 7�Q Y1%=Height% : Y2%=Y1%-7.1*9.5 : Y3%=Y1%-7.1*22 : Y4%=Y1%-7.1*76 : Y5%=0 7�" Box%!0=0 : Box%!4=0 7�e Box%!8=Width%+20 : Box%!12=Height%+20 : � To Allow For Rounding Errors In Conversion Routines. 7�, � Set up variable for inlay printing. 7�d Font1X%=10*16 : Font1Y%=10*16 : Font2X%=11*16 : Font2Y%=11*16 : Font3X%=13*16 : Font3Y%=12*16 8 UserNote_Y_Offset%=Y2%+25 8M Title1_Y_Offset%=Y3%+50 : Title2_Y_Offset%=Y3%+20 : Title_X_Offset%=80 8[ Index_X_Offset%=X1%+4 : Item_X_Offset%=X2%+4 : Text_Drop_Btm%=23 : Text_Drop_Top%=23 8": Copyright_Text$="DAT Inlay Printer � M.Bright 1992" 8,� 86: 8@v� **************************************************************************************************************** 8Jv� 'Draw' the inlay, using previously defined variables. All output has been switched to the printer at this stage. 8T>� this routine is the heart of the Risc-OS printer output. 8^v� **************************************************************************************************************** 8h$� �_DrawInlay(Co_ordinateBlock%) 8r@ ș Find%,,BaseFont$,Font1X%,Font1Y%,0,0 � BaseFontHandle% 8|@ ș Find%,,BoldFont$,Font2X%,Font2Y%,0,0 � BoldFontHandle% 8�@ ș Find%,,EdgeFont$,Font3X%,Font3Y%,0,0 � EdgeFontHandle% 8�: 8�0 � �_ReadIconText(Main%,UserNote%,�)<>"" � 8�1 Text$=�_ReadIconText(Main%,UserNote%,�) 8� � 8� Text$=Copyright_Text$ 8� � 8�? �_CentreProp(Text$,UserNote_Y_Offset%,"Bold",Width%/7.1) 8�: 8�e �_CentreProp(�_ReadIconText(Main%,TitleFirstLine%,�),Title1_Y_Offset%,"Title",Title_X_Offset%) 8� �_PrintTapeNumber 8�g �_CentreProp(�_ReadIconText(Main%,TitleFirstLine%+1,�),Title2_Y_Offset%,"Title",Title_X_Offset%) 8� � InlayType$<>"DAT" � 9j �_CentreProp(�_ReadIconText(Main%,TitleFirstLine%+2,�),Title3_Y_Offset%,"Title",Title_X_Offset%) 9 � 9: 9& Separation%=(Y3%-Y4%)/13 90% SpaceStartY%=Y4% + Separation% 9: Icon%=BtmSetIndexStart% 9D/ ș "ColourTrans_SetGCOL",&C0C0C000,,,0,0 9N ȕ SpaceStartY% <= Y3% 9XJ � SpaceStartY% < Y3%-10 � � X1%,SpaceStartY% :� X3%,SpaceStartY% 9b- Text$=�_ReadIconText(Main%,Icon%,�) 9lK �_FontPaint("",Text$,Index_X_Offset%,SpaceStartY%-Text_Drop_Btm%) 9v/ Text$=�_ReadIconText(Main%,Icon%+1,�) 9�J �_FontPaint("",Text$,Item_X_Offset%,SpaceStartY%-Text_Drop_Btm%) 9�# SpaceStartY%+=Separation% 9� Icon%+=2 9� � 9�: 9� � PrintTop% � 9�! Separation=(Y4%-Y5%)/12 9�& SpaceStartY=Y5% + Separation 9�! Icon%=TopSetIndexStart% 9�2 ș "ColourTrans_SetGCOL",&C0C0C000,,,0,0 9� ȕ SpaceStartY <= Y4% 9�J � SpaceStartY < Y4%-10 � � X1%,SpaceStartY :� X3%,SpaceStartY 9�0 Text$=�_ReadIconText(Main%,Icon%,�) :M �_FontPaint("",Text$,Index_X_Offset%,SpaceStartY-Text_Drop_Top%) :2 Text$=�_ReadIconText(Main%,Icon%+1,�) :L �_FontPaint("",Text$,Item_X_Offset%,SpaceStartY-Text_Drop_Top%) : $ SpaceStartY+=Separation :* Icon%+=2 :4 � :> � :H: :R/ ș "ColourTrans_SetGCOL",&00000000,,,0,0 :\ ȓ X1%,Y5%,X3%,Y1% :f ȓ X1%,Y3%,X3%,Y2%-Y3% :p � X1%,Y4% : � X3%,Y4% :z � X2%,Y3% : � X2%,Y5% :�: :� ș Lose%,BaseFontHandle% :� ș Lose%,BoldFontHandle% :� ș Lose%,EdgeFontHandle% :�� :�: :�>� ******************************************************** :�>� Sends the inlay data to the printer in NON Risc-OS mode. :�>� ******************************************************** :�� �_DoPrinting(InlayType$) :�& �_SetPrintVariables(InlayType$) :� �_SendData(PrintPitch$) :� : ;8 � LongMinus$ : � InlayType$<>"DAT" � � BlankLine$ ;/ � �_ReadIconText(Main%,UserNote%,�)="" � ; � Copyright$ ;$ � ;.K � "|";�_Centre(�_ReadIconText(Main%,UserNote%,�),LineLength%);"|" ;8 � ;B � LongEqual$ ;L �_PrintTitle(InlayType$) ;V8 � LongEqual$ : � InlayType$<>"DAT" � � BlankLine$ ;`4 � L%=BtmSetIndexEnd% � BtmSetIndexStart% � -2 ;jg � "|";��7," "+�_ReadIconText(Main%,L%,�)),7);Spacer$;�_ReadIconText(Main%,L%+1,TitleLen%);"|" ;t � ;~) � InlayType$<>"DAT" � � LongMinus$ ;� : ;� PrintTop%=� ;�4 � L%=TopSetIndexEnd% � TopSetIndexStart% � -2 ;�[ � �_ReadIconText(Main%,L%,�)<>"" � �_ReadIconText(Main%,L%+1,�)<>"" � PrintTop%=� ;� � ;� : ;� � PrintTop% � ;�, � InlayType$<>"DAT" � � BlankLine$ ;�7 � L%=TopSetIndexEnd% � TopSetIndexStart% � -2 ;�j � "|";��7," "+�_ReadIconText(Main%,L%,�)),7);Spacer$;�_ReadIconText(Main%,L%+1,TitleLen%);"|" ;� � ;�/ � InlayType$="Video_8" � � BlankLine$ <