home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / yacl-012.zip / ui / canvas.cxx < prev    next >
C/C++ Source or Header  |  1995-04-04  |  2KB  |  82 lines

  1.  
  2.  
  3. /*
  4.  *
  5.  *          Copyright (C) 1994, M. A. Sridhar
  6.  *  
  7.  *
  8.  *     This software is Copyright M. A. Sridhar, 1994. You are free
  9.  *     to copy, modify or distribute this software  as you see fit,
  10.  *     and to use  it  for  any  purpose, provided   this copyright
  11.  *     notice and the following   disclaimer are included  with all
  12.  *     copies.
  13.  *
  14.  *                        DISCLAIMER
  15.  *
  16.  *     The author makes no warranties, either expressed or implied,
  17.  *     with respect  to  this  software, its  quality, performance,
  18.  *     merchantability, or fitness for any particular purpose. This
  19.  *     software is distributed  AS IS.  The  user of this  software
  20.  *     assumes all risks  as to its quality  and performance. In no
  21.  *     event shall the author be liable for any direct, indirect or
  22.  *     consequential damages, even if the  author has been  advised
  23.  *     as to the possibility of such damages.
  24.  *
  25.  */
  26.  
  27.  
  28. #if defined(__GNUC__)
  29. #pragma implementation
  30. #endif
  31.  
  32.  
  33. #include "ui/canvas.h"
  34. #include "ui/color.h"
  35. #include "ui/dsplsurf.h"
  36.  
  37. #if defined(__X_MOTIF__)
  38. #include <Xm/DrawingA.h>
  39. #endif
  40.  
  41.  
  42. UI_Canvas::UI_Canvas (UI_VObjCollection* parent, const UI_Rectangle& shape,
  43.                       UI_ViewID id)
  44. : UI_VisualObject (parent, shape, id)
  45. {
  46. #if defined(__MS_WINDOWS__)
  47.     _style = WS_VISIBLE | WS_BORDER | WS_CHILD;
  48. #elif defined(__OS2__)
  49.     _style = WS_VISIBLE;
  50. #endif
  51.    _fgColor = UI_Color (UIColor_Black);
  52.    _bgColor = UI_Color (UIColor_White);
  53. }
  54.  
  55.  
  56.  
  57. UI_WindowClass UI_Canvas::WindowClass () const
  58. {
  59. #if defined(__MS_WINDOWS__) || defined(__OS2__)
  60.     return _YACLWindowClassName;
  61. #elif defined(__X_MOTIF__)
  62.     return xmDrawingAreaWidgetClass;
  63. #endif
  64. }
  65.  
  66.  
  67.  
  68. void UI_Canvas::_PrivateInitialize ()
  69. {
  70.     UI_VisualObject::_PrivateInitialize ();
  71.     CreateDisplaySurface ();
  72. }
  73.  
  74.  
  75. void UI_Canvas::Finalize ()
  76. {
  77.     DestroyDisplaySurface ();
  78.     UI_VisualObject::Finalize ();
  79. }
  80.  
  81.  
  82.