home *** CD-ROM | disk | FTP | other *** search
- #include "cwldemo.h"
-
- int WinVirtual(POPUP_MENU_PTR p, int sel)
- {
- WPOINTER cw;
- VWPOINTER vw;
- WPOINTER wViewPort;
- int i,j,k;
- FILE *infile;
- #ifndef SHWARE
- ProcessAllEvents(M_EVENT);
- #endif
- cw = WindowInitialize(DESKTOP_WINDOW,
- BORDER,0,0,43,2,
- BLACKONCYAN,BLACKONCYAN,SINGLEBOX);
- WindowWriteCenterString(cw,"You can create virtual windows...",0);
- WindowCenter(cw,VERTCENTER | HORIZCENTER);
- WindowDisplay(cw,1,NOEFFECT);
-
- vw = VirtualInitialize(NOATTRIBUTE, 100, 80, 0);
- if (vw)
- {
- wViewPort = WindowInitialize(DESKTOP_WINDOW, BORDER, 0, 0, 50, 15,
- 0x70, 0x70, SINGLEBOX);
- WindowMove(wViewPort,2,0);
- WindowAssignToVirtual(wViewPort, vw, 0, 0);
- #ifndef SHWARE
- WindowSetEventStyle(wViewPort,CWL_VSCROLL | CWL_HSCROLL | CWL_CAPTION |
- CWL_RESIZE);
- WindowSetCaption(wViewPort, "This is a caption" );
- #endif
- if (infile = read_file(vw,"CWLDEMO.C"))
- {
- WindowCenter(wViewPort,VERTCENTER | HORIZCENTER);
- WindowDisplay(wViewPort, 2, NOEFFECT);
- WindowClear(cw);
- WindowResizeHeight(cw,3,ANCHORTOP);
- WindowResizeWidth(cw,34,ANCHORLEFT);
- WindowWriteString(cw,"You can create windows in memory",0,0);
- WindowWriteString(cw,"and scroll through the contents",1,0);
- WindowWriteString(cw,"using a displayed window. ",2,0);
- WindowCenter(cw, VERTCENTER | HORIZCENTER);
- delay_approx(10000);
- WindowPanViewport(wViewPort, DEFAULTPANKEYS);
- fclose(infile);
- }
- VirtualClose(vw,TRUE,NOEFFECT);
- WindowClose(wViewPort,NOEFFECT);
- }
- WindowClose(cw,NOEFFECT);
- #ifndef SHWARE
- CWLQuitMessage( ); /* call for mouse event only */
- #endif
- return POPUP_CONTINUE;
- }