home *** CD-ROM | disk | FTP | other *** search
- ' copyright 1994 Robert Schenk
- RESOURCES "Ctester.rsc","APPLyyXX" 'open resource file
-
- COMPILE 0,_macsBugLabels '_dimmedVarsOnly
- _fiveButtonWnd=5
- _arrowWnd=4
- _splashWnd=21
- DIM pictid%
- END GLOBALS
-
- LOCAL FN splash(id)
- DIM rect;8
- WINDOW CLOSE _splashWnd
- WINDOW _splashWnd,"",(1,21)-(520,340),_dialogShadow,_splashWnd
- Hndl&= FN GETPICTURE(id)
- LONG IF Hndl&
- rect;8=[Hndl&]+_picFrame
- v=rect.bottom-rect.top
- offsetv=(280-v)/2
- hor=rect.right-rect.left
- offseth=(520-hor)/2
- CALL OFFSETRECT(rect,offseth,offsetv)
- CALL DRAWPICTURE(Hndl&, rect)
- END IF
- BUTTON 10,_activeBtn,"1050", (200,280)-(400,312),321
- END FN
-
- LOCAL FN handleSplash(evnt,id)
- SELECT CASE evnt
- d%=0
- CASE _btnClick
- theControl&=BUTTON&(10)
- LONG IF theControl&
- d% = FN GETCTLVALUE(theControl&)
- END IF
- LONG IF d%<3
- pictid%=pictid%-1
- IF pictid%<252 THEN pictid%=254
- FN splash(pictid%)
- XELSE
- LONG IF d%>5
- WINDOW CLOSE _splashWnd
- END IF
- END IF
- END SELECT
- END FN
-
- LOCAL FN intialize
- WINDOW OFF
- pictid%=252
- FN splash(pictid%)
- COORDINATE WINDOW
- END FN
-
-
- LOCAL FN readContolRec(id)
- DIM rect;8
- theControl&=BUTTON&(id)
- LONG IF theControl&
- PRINT theControl&
-
- cp&=PEEK LONG(theControl&)
- cnext&=cp&+_nextControl
- nextc&=PEEK LONG(cnext&)
- PRINT "Next Button;";nextc&
-
- owner&=cp&+_contrlOwner
- oc&=PEEK LONG(owner&)
- PRINT "Window Pointer:";oc&
-
- rt&=cp&+_contrlRect
- rect;8=[theControl&]+_contrlRect
- PRINT "rectangle:";rect.left;rect.top;rect.right;rect.bottom
-
- ad&=cp&+_contrlVis
- v%=PEEK(ad&)
- PRINT "visible:";v%
- ad&=cp&+_contrlHilite
- v%=PEEK(ad&)
- PRINT "Highlight:";v%
-
- valu&=cp&+_contrlValue
- v%=PEEK WORD(valu&)
- PRINT "current value:";v%
- valu&=cp&+_contrlMin
- v%=PEEK WORD(valu&)
- PRINT "Minimum:";v%
- valu&=cp&+_contrlMax
- v%=PEEK WORD(valu&)
- PRINT "Maximum:";v%
- owner&=cp&+_contrlDefHandle
- oc&=PEEK LONG(owner&)
- PRINT "CDEF:";oc&
- owner&=cp&+_contrlData
- oc&=PEEK LONG(owner&)
- PRINT "data hndl:";oc&
- owner&=cp&+_contrlAction
- oc&=PEEK LONG(owner&)
- PRINT "Action Handle:";oc&
- owner&=cp&+_contrlRfCon
- oc&=PEEK LONG(owner&)
- PRINT "FB REF:";oc&
-
- 'ctlTitle$=PSTR$([theControl&]+_contrltitle)
- ctlTitle$=PSTR$(cp&+_contrltitle)
- PRINT "Title;";ctlTitle$
- PRINT
- END IF
- END FN
-
- LOCAL FN fivebutton
- WINDOW CLOSE _fiveButtonWnd
- WINDOW CLOSE _splashWnd
- ' if we have this open, and reopen it, we have the buttons scroll off the screen.
- 'so we close it if it is open before we reopen it.
- WINDOW _fiveButtonWnd,"five buttons",(1,40)-(500,310),_docNoGrow,_fiveButtonWnd
- BUTTON 1,_activeBtn,"1000", (200,50)-(400,100),321
- BUTTON 2,_grayBtn,"1000", (200,150)-(400,200),321
- END FN
- LOCAL FN handlefive(evnt,id)
- SELECT CASE evnt
- CASE _WndClose
- WINDOW CLOSE _fiveButtonWnd
- CASE _btnClick
- FN readContolRec(id)
- END SELECT
- END FN
-
- LOCAL FN arrowtest
- WINDOW CLOSE _arrowWnd
- WINDOW CLOSE _splashWnd
- WINDOW _arrowWnd,"arrow buttons",(1,40)-(500,310),_docNoGrow,_arrowWnd
- BUTTON 4,_grayBtn,"975", (80,50)-(95,66),161
- BUTTON 3,_activeBtn,"975", (80,90)-(95,106),161
- theControl&=BUTTON&(3)
- LONG IF theControl&
- CALL SETCTLMIN(theControl&, -12)
- d% = FN GETCTLVALUE(theControl&)
- t$=STR$(d%)
- EDIT FIELD 4, t$, (30,90)-(70,106), _framedNoCr
- EDIT TEXT _Geneva, 12
- EDIT FIELD 111, "", (2000,90)-(2070,106), _NoFramedNoCr
- ' edit field 111 is a dummy edit field to prevent some of the blinking that would
- 'otherwise occur
- END IF
- END FN
-
- LOCAL FN handlearrow(evnt,id)
- SELECT CASE evnt
- CASE _WndClose
- WINDOW CLOSE _arrowWnd
- CASE _btnClick
- theControl&=BUTTON&(3)
- LONG IF theControl&
- d% = FN GETCTLVALUE(theControl&)
- t$=STR$(d%)
- EDIT$(4)=t$
- END IF
- CASE _efReturn
- max%=0:min%=0
- t$=EDIT$(4)
- EDIT FIELD 111
- d%=VAL(t$)
- theControl&=BUTTON&(3)
- LONG IF theControl&<>0
- max% = FN GETCTLMAX(theControl&)
- min% = FN GETCTLMIN(theControl&)
- END IF
- LONG IF d%>=min% AND d%<=max% AND t$<>""
- CALL SETCTLVALUE(theControl&, d%)
- BEEP
- END IF
- END SELECT
- END FN
-
- LOCAL FN doDialog
- evnt = DIALOG(0)
- id = DIALOG(evnt)
- SELECT WINDOW(_outputWClass)
- CASE (_fiveButtonWnd)
- FN handlefive(evnt,id)
- CASE(_arrowWnd)
- FN handlearrow(evnt,id)
- CASE (_splashWnd)
- FN handleSplash(evnt,id)
- END SELECT
- END FN
-
- LOCAL FN doquit
- END
- END FN
-
- LOCAL FN domenu
- DIM menuid, menuitem
- menuid=MENU(0)
- menuitem=MENU(1)
- SELECT CASE menuid
- CASE 127
- pictid%=252
- FN splash(pictid%)
- BEEP
- CASE 1
- SELECT CASE menuitem
- CASE 1
- FN arrowtest
- CASE 2
- FN fivebutton
- CASE ELSE
- FN doquit
- END SELECT
- CASE ELSE
- END SELECT
- CALL HILITEMENU(0)
- END FN
-
- 'main program*******************************************
- FN intialize
- ON MENU FN domenu
- ON DIALOG FN doDialog
- ON BREAK FN doquit
- DO
- HANDLEEVENTS
- UNTIL programends
-
-
-