home *** CD-ROM | disk | FTP | other *** search
- 'copyright 1994 Robert Schenk
- RESOURCES "NewButton.rsc","rsrcRSED","CDEF",10,"arrowButton",0
- COMPILE 0,4
- DIM ctrlT;8
-
- "Entry"
- ENTERPROC%(varCode%, the Control&, message%, param&)
- returnValue&=0
- ctrlT;8 = [theControl&]+_contrlRect
- SELECT message%
- CASE _drawCtlMsg
- GOSUB "Draw Control"
- CASE _hitCtlMsg
- GOSUB "User Action"
- CASE _calcCtlMsg
- GOSUB "Calc Control Regions"
- END SELECT
- "Exit"
- EXITPROC%=returnValue&
- END
-
- "Draw Control"
- LONG IF PEEK ([theControl&]+_contrlVis)
- ctlTitle$=PSTR$([theControl&]+_contrltitle)
- id=VAL(ctlTitle$)
- selector= PEEK([theControl&]+_contrlHilite)
- SELECT CASE selector
- CASE 255 ' grayed
- Hndl&= FN GETPICTURE(id)
- LONG IF Hndl&
- CALL DRAWPICTURE(Hndl&, ctrlT)
- END IF
- CASE _inDownButton ' up arrow, increase
- Hndl&= FN GETPICTURE(id+2)
- LONG IF Hndl&
- CALL DRAWPICTURE(Hndl&, ctrlT)
- END IF
- CASE _inUpButton ' down, decrease
- Hndl&= FN GETPICTURE(id+3)
- LONG IF Hndl&
- CALL DRAWPICTURE(Hndl&, ctrlT)
- END IF
- CASE ELSE ' regular
- Hndl&= FN GETPICTURE(id+1)
- LONG IF Hndl&
- CALL DRAWPICTURE(Hndl&, ctrlT)
- END IF
- END SELECT
- END IF
- RETURN
- "User Action"
- LONG IF FN PTINRECT(param&, ctrlT)
- ctrlT.bottom=(ctrlT.top+ctrlT.bottom)/2
- LONG IF FN PTINRECT(param&, ctrlT) ' up
- returnValue&=_inDownButton ' we want to increase it when at top
- XELSE
- returnValue&=_inUpButton ' we want to decrease when at bottom
- END IF
- END IF
- RETURN
- "Calc Control Regions"
- CALL OPENRGN
- CALL FRAMERECT(ctrlT)
- CALL CLOSERGN(param&)
- RETURN
-
-