home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 13 / 13.iso / s / s001 / 1.ddi / PFC / SRC / WNDUPD.C < prev   
Encoding:
C/C++ Source or Header  |  1990-02-19  |  2.4 KB  |  148 lines

  1. /* 88-11-11 Jahns    wnd_setupd() update only activ window        */
  2.  
  3.  
  4.  
  5. /* (c) 1985, Phoenix Computer Products Corp. and Novum Organum, Inc. */
  6. #include "pdefs.h"
  7.  
  8. static  int _upd;
  9. static  int _csrupd;
  10.  
  11. /***
  12. * Name:         wupdinit -- turns on _upd and _csrupd
  13. *
  14. * Synopsis:     void    wupdinit();
  15. *               wupdinit();
  16. *
  17. * Description:  set statics
  18. *
  19. * Returns:      nothing
  20. *
  21. * (C) Novum Organum, Inc. 1985
  22. *
  23. ***/
  24. void wupdinit(void)
  25. {
  26.     _csrupd = YES;
  27.     _upd = YES;
  28. }
  29.  
  30. /***
  31. * Name:         wndupdall -- updates all windows
  32. *
  33. * Synopsis:     void    wndupdall();
  34. *               wndupdall();
  35. *
  36. * Description:  Repaints all windows.
  37. *
  38. * Returns:      nothing
  39. *
  40. * (C) Novum Organum, Inc. 1985
  41. *
  42. ***/
  43.  
  44. void wndupdall(void)
  45. {
  46.     HDL h_sav, wndsetactv(), wndgetactv();
  47.     HDL h_wnd, _wndtop(), _wndnxt();
  48.  
  49.     if  ( _upd )
  50.         {
  51.         h_sav = wndgetactv();
  52.         h_wnd = _wndtop();
  53.         while ( h_wnd )
  54.             {
  55.             wndsetactv(h_wnd);
  56.             _waupd();
  57.             _waupdbdr();
  58.             h_wnd = _wndnxt( h_wnd );
  59.             }
  60.         wndsetactv( h_sav );
  61.         }
  62. }
  63.  
  64. /***
  65. * Name:         wndgetupd -- retrieve update flag
  66. *
  67. * Synopsis:     int upd, wndgetupd();
  68. *               upd = wndgetupd();
  69. *
  70. * Description:  Get update flag.
  71. *
  72. * Returns:      Update flag.
  73. *
  74. * (C) Novum Organum, Inc. 1985
  75. *
  76. ***/
  77.  
  78. int wndgetupd(void)
  79. {
  80.     return(_upd);
  81. }
  82.  
  83. /***
  84. * Name:         wndsetupd -- sets update flag
  85. *
  86. * Synopsis:     int oldval, newval, wndsetupd();
  87. *               oldval = wndsetupd( newval );
  88. *
  89. * Description:  Sets update flag.  With the update flag off, no screen
  90. *               activity will take place.  When the flag is turned on,
  91. *               the entire screen is repainted.
  92. *
  93. * Returns:      The previous flag state.
  94. *
  95. * (C) Novum Organum, Inc. 1985
  96. *
  97. ***/
  98.  
  99. int wndsetupd(upd)
  100.     int upd;
  101. {
  102.     int oldupd;
  103.  
  104.     oldupd = _upd;
  105.     _upd = upd;
  106.     if  ( _upd )
  107.         wndupdall();
  108.     return  ( oldupd );
  109. }
  110.  
  111.  
  112. int wnd_setupd(int upd)     /* update only activ window    */
  113. {
  114.     int savupd;
  115.  
  116.     savupd = _upd;
  117.     _upd   = upd;
  118.  
  119.     if    ( _upd ) _waupd();
  120.  
  121.     _upd = savupd;
  122.  
  123.     return  ( savupd );
  124. }
  125.  
  126.  
  127.  
  128. int wndgetcsrupd(void)
  129. {
  130.     return(_csrupd);
  131. }
  132.  
  133.  
  134.  
  135. int wndsetcsrupd(int newval)
  136. {
  137.     int oldval;
  138.  
  139.     oldval = _csrupd;
  140.     _csrupd = newval;
  141.     return(oldval);
  142.  
  143. }
  144.  
  145.  
  146.  
  147. /* end of WNDUPD.C    */
  148.