home *** CD-ROM | disk | FTP | other *** search
/ Point Programming 1 / PPROG1.ISO / c / sclib31 / examples / window2.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-12-31  |  1.6 KB  |  63 lines

  1. #include <scl1.h>
  2. #include <scl1clor.h>
  3.  
  4. main()
  5. {
  6. WData wd;
  7.  
  8. /*   Define a window from rows 5 to 17, columns 19 to 59, with frame
  9.      type 3, white black colors, and with the following styles; save
  10.      screen area, draw a shadow effect, draw a frame, grow when
  11.      opening, shrink when closing and add title */
  12.  
  13. InitWData(&wd,WHITE_BLACK,W_SAVE | W_SHADOW | W_FRAME | W_GROW | W_SHRINK,5,28,19,73,3,BLACK_WHITE," WINDOW TITLE ");
  14.  
  15. CreateWindow(&wd); /* create the window */
  16.  
  17. /* Display centralized text in the first row of the window, 
  18.    use HorCenter as column parameter to centralize text
  19.    use HorSize so that the Horizontal window size is used as Count parameter */
  20.  
  21. WriteWindow(&wd,1,wd.HorCenter,wd.HorSize,W_CENTER,"Text can be\ncentralized...");
  22.  
  23. WaitTime(300);
  24.  
  25. /* Display left justified string */
  26.  
  27. WriteWindow(&wd,5,1,wd.HorSize,W_LEFT,"Left\njustified...");
  28.  
  29. WaitTime(300);
  30.  
  31. /* Display right justified string. Use HorSize to know the window right 
  32.    column value */
  33.  
  34. WriteWindow(&wd,8,wd.HorSize-2,wd.HorSize,W_RIGHT,"or right\njustified...");
  35.  
  36. WaitTime(300);
  37.  
  38. /* Clear the window */
  39.  
  40. ClearWindow(&wd);
  41.  
  42. /*  Display string with new lines and tab control codes. Use VerCenter to 
  43.     centralize the string vertically */
  44.  
  45. WriteWindow(&wd,wd.VerCenter,1,wd.HorSize,W_LEFT,"New lines\nand\t\tTab control codes are supported...");
  46.  
  47. WaitTime(300);
  48.  
  49. ClearWindow(&wd);
  50.  
  51. /* this string os longer than window size, it will be clipped */
  52.  
  53. WriteWindow(&wd,wd.VerCenter,22,wd.HorSize,W_LEFT,"This line will be clipped...");
  54.  
  55. WaitTime(300);
  56.  
  57. /* Remove window from screen */
  58.  
  59. DestroyWindow(&wd);
  60. }
  61.  
  62.  
  63.