home *** CD-ROM | disk | FTP | other *** search
- #include <scl1.h>
- #include <scl1keys.h>
-
- /**********************************************
- Shows the use of cursor related functions */
-
- char Text[]="\n\nCursor size and position has been be saved using PushCursor.\n\n"
- "\t<*> Move the cursor around your screen using the arrow keys\n"
- "\t<*> Change cursor size using the TAB key\n"
- "\t<*> Press ESC to restore original size and position\n";
-
- main()
- {
- unsigned int Key;
- int CurFlag=0;
-
- printf(Text);
-
- PushCursor(); /* save cursor size and position */
-
- /* let user modify size and position */
-
- do
- {
- switch((Key=GetKey()))
- {
- case UP:
- SetCurPos(GetCurLine()-1,GetCurCol());
- break;
- case DOWN:
- SetCurPos(GetCurLine()+1,GetCurCol());
- break;
- case LEFT:
- SetCurPos(GetCurLine(),GetCurCol()-1);
- break;
- case RIGHT:
- SetCurPos(GetCurLine(),GetCurCol()+1);
- break;
- case TAB:
- CurFlag ^= 1;
- if(CurFlag)
- BigCursor();
- else
- CursorOn();
- break;
- }
- }while(Key != ESC);
-
- /* restore original size and position */
-
- PopCursor();
- }