;Demo program to show off updates to the windows and gadget libraries. ;Updates by Stephen McNamara of Red When Excited. ;Updates include: ; (Windowslib) - Using Window command as a function, e.g. ; if Window(0,0,0,100,20,0,"Fubar",-1,-1)=0 then ERROR! ; (Gadgetslib) - ArrowGadgets ; Proper PropGadget flags and controls ; Use PropGadgets like Gadtool gadgets - instead of having ; to use QUICKS to get/set their values - use VISIBLE/TOTAL ; amounts. #RIGHTREL=%1 #BOTTOMREL=%10 #RIGHTBORDER=%100 #BOTTOMBORDER=%1000 #AUTOKNOB =$0001 ; this flag sez: gimme that old auto-knob #FREEHORIZ =$0002 ; if set, the knob can move horizontally #FREEVERT =$0004 ; if set, the knob can move vertically #PROPBORDERLESS =$0008 ; if set, no border will be rendered #KNOBHIT =$0100 ; set when this Knob is hit #PROPNEWLOOK =$0010 ; set this if you want to get the new ; V36 look #GFLG_RELBOTTOM =$0008 ; set if rel to bottom, clear if to top #GFLG_RELRIGHT =$0010 ; set if rel to right, clear if to left ; set the GFLG_RELWIDTH bit to spec that Width is relative to width of screen #GFLG_RELWIDTH =$0020 ; set the GFLG_RELHEIGHT bit to spec that Height is rel to height of screen #GFLG_RELHEIGHT =$0040 DEFTYPE.Gadget *gad WbToScreen 0 AddIDCMP #IDCMP_GADGETDOWN *scr.Screen=Peek.l(Addr Screen(0)) fontheight.w=*scr\BarHeight aflags.w=#GFLG_RELRIGHT|#GFLG_RELHEIGHT pflags.w=#AUTOKNOB|#FREEVERT|#PROPBORDERLESS|#PROPNEWLOOK wy=fontheight+4 PropGadget 0,-13,wy,aflags,0,10,-15-fontheight-24,pflags,3 aflags.w=#GFLG_RELBOTTOM|#GFLG_RELWIDTH pflags.w=#AUTOKNOB|#FREEHORIZ|#PROPBORDERLESS|#PROPNEWLOOK PropGadget 0,6,-7,aflags,1,-25-33,6,pflags,3 ArrowGadget 0,2,#UPIMAGE,-17,-20-11,#RIGHTREL|#BOTTOMREL|#RIGHTBORDER,$2 ArrowGadget 0,3,#DOWNIMAGE,-17,-20,#RIGHTREL|#BOTTOMREL|#RIGHTBORDER,$2 ArrowGadget 0,4,#LEFTIMAGE,-49,-9,#RIGHTREL|#BOTTOMREL|#BOTTOMBORDER,$2 ArrowGadget 0,5,#RIGHTIMAGE,-33,-9,#RIGHTREL|#BOTTOMREL|#BOTTOMBORDER,$2 AddIDCMP #IDCMP_INTUITICKS htotal=50 hvisible=5 vtotal=50 vvisible=5 SetPropInfo 0,0,vvisible,vtotal,0 SetPropInfo 0,1,hvisible,htotal,0 If Window(0,0,*scr\BarHeight+1,320,128,$11000+%1111+$30,"Test",-1,-1,0)=0 NPrint "Could not open window!" End EndIf MoveProp 0,0,20,0 Repeat ev.l=WaitEvent gad=GadgetHit If ev=32 Use Window evw *gad=EventiAddress Repeat Select gad Case 2 n.w=GetPropCurrent(0,0) If n>0 n-1 MoveProp 0,0,n,0 EndIf Case 3 n.w=GetPropCurrent(0,0) If n<(vtotal-vvisible) n+1 MoveProp 0,0,n,0 EndIf Case 4 n.w=GetPropCurrent(0,1) If n>0 n-1 MoveProp 0,1,n,0 EndIf Case 5 n.w=GetPropCurrent(0,1) If n<(htotal-hvisible) n+1 MoveProp 0,1,n,0 EndIf End Select ev.l=WaitEvent WLocate 0,0 NPrint GetPropCurrent(0,0)," " NPrint GetPropCurrent(0,1)," " Until (*gad\Flags AND #GFLG_SELECTED)=0 EndIf Until ev=$200 End