home *** CD-ROM | disk | FTP | other *** search
- /*
- ** this file contanes the "static" function definitions and some variables
- **
- ** Copyright © 1991 Mark Gross
- ** (RR2, Box 84, Clayville, NY 13322);
- ** this file may be published everywhere, but no charge
- ** may be made for its use. Please contact me about any bugs found.
- */
-
- #include "TScrollDoc.h"
- #include "TTEDoc.h"
-
- pascal void ActionProc(ControlHandle theControl, short partCode)
- {
- short scrollAmount = 0;
- TScrollDoc *theCurrScrollDoc;
- extern TScrollDoc *gCurrScrollDoc;
-
- theCurrScrollDoc = gCurrScrollDoc;
- if(theControl == theCurrScrollDoc->GetVScroll() )
- scrollAmount = theCurrScrollDoc->GetVertLineScrollAmount();
- if( theControl == theCurrScrollDoc->GetHScroll())
- scrollAmount = theCurrScrollDoc->GetHorizLineScrollAmount();
-
- if(partCode == inUpButton)
- theCurrScrollDoc->Scroll(theControl, -scrollAmount);
- if(partCode == inDownButton)
- theCurrScrollDoc->Scroll(theControl, scrollAmount);
- }/*end of function*/
-
-
- pascal Boolean MyClickLoop(void)
- {
- Point where;
- Rect view;
- TScrollDoc *theCurrScrollDoc;
-
- theCurrScrollDoc = gCurrScrollDoc;
- theCurrScrollDoc->GetContentRect(&view);
- GetMouse(&where);
- if (where.v > view.bottom)
- {
- theCurrScrollDoc->Scroll(theCurrScrollDoc->GetVScroll(),
- theCurrScrollDoc->GetVertLineScrollAmount() );
- }
- if (where.h > view.right)
- {
- theCurrScrollDoc->Scroll(theCurrScrollDoc->GetHScroll(),
- theCurrScrollDoc->GetHorizLineScrollAmount() );
- }
- if (where.v < view.top)
- {
- theCurrScrollDoc->Scroll(theCurrScrollDoc->GetVScroll(),
- -(theCurrScrollDoc->GetVertLineScrollAmount()) );
- }
- if (where.h < view.left)
- {
- theCurrScrollDoc->Scroll(theCurrScrollDoc->GetHScroll(),
- -(theCurrScrollDoc->GetHorizLineScrollAmount()) );
- }
-
- return TRUE;
- }/*end of function*/
-
-