home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / icanvas.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  4.5 KB  |  138 lines

  1. #ifndef _ICANVAS_
  2.   #define _ICANVAS_
  3. /*******************************************************************************
  4. * FILE NAME: icanvas.hpp                                                       *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the classes:                                                *
  8. *     ICanvas                                                                  *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   IBM Open Class Library                                                     *
  12. *   (C) Copyright International Business Machines Corporation 1992, 1996       *
  13. *   Licensed Material - Program-Property of IBM - All Rights Reserved.         *
  14. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  15. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  16. *                                                                              *
  17. *******************************************************************************/
  18. #include <icontrol.hpp>
  19. #include <ihandle.hpp>
  20. #include <ipoint.hpp>
  21. #include <irect.hpp>
  22.  
  23. class ICanvasData;
  24. class ICanvasHandler;
  25. class IColor;
  26. class IFont;
  27. class IWindowPosBuffer;
  28.  
  29. #pragma pack(4)
  30.  
  31. class ICanvas : public IControl {
  32. typedef IControl
  33.   Inherited;
  34. public:
  35. class Style;
  36.  
  37. /*------------------------------- Constructors -------------------------------*/
  38.   ICanvas ( unsigned long     windowIdentifier,
  39.             IWindow*          parent,
  40.             IWindow*          owner,
  41.             const IRectangle& initial = IRectangle(),
  42.             const Style&      style = defaultStyle() );
  43. virtual
  44.  ~ICanvas ( );
  45.  
  46. /*---------------------------------- Style -----------------------------------*/
  47. INESTEDBITFLAGCLASSDEF1(Style, ICanvas, IWindow);
  48. static const Style
  49.   IC_IMPORTU classDefaultStyle;
  50. static Style
  51.   defaultStyle      ( );
  52. static void
  53.   setDefaultStyle   ( const Style&    style );
  54.  
  55. virtual unsigned long
  56.   convertToGUIStyle ( const IBitFlag& style,
  57.                       Boolean         extendedOnly = false ) const;
  58.  
  59. /*---------------------------------- Colors ----------------------------------*/
  60. virtual IColor
  61.   backgroundColor ( ) const;
  62.  
  63. /*------------------------------ Font Functions ------------------------------*/
  64. virtual IWindow
  65.  &setFont       ( const IFont& font );
  66.  
  67. /*------------------------- Dialog Behavior Support --------------------------*/
  68. virtual Boolean
  69.   isTabStop               ( ) const;
  70. IWindowHandle
  71.   origDefaultButtonHandle ( ) const;
  72. virtual IWindowHandle
  73.   defaultPushButton       ( ) const,
  74.   matchForMnemonic        ( unsigned short character ) const;
  75.  
  76. /*---------------------------------- Layout ----------------------------------*/
  77. virtual ICanvas
  78.  &setLayoutDistorted ( unsigned long layoutAttributesOn,
  79.                        unsigned long layoutAttributesOff );
  80.  
  81. protected:
  82. /*------------------------------- Constructors -------------------------------*/
  83.   ICanvas ( );
  84.  
  85. /*------------------------------ Layout Support ------------------------------*/
  86. virtual ICanvas
  87.  &layout              ( );
  88. ISize
  89.   layoutSize          ( ) const;
  90. ICanvas
  91.  &setLayoutSize       ( const ISize& size );
  92. virtual IWindowPosBuffer
  93.   fixupChildren       ( );
  94. Boolean
  95.   areChildrenReversed ( ) const;
  96. virtual ISize
  97.   calcMinimumSize     ( ) const;
  98.  
  99. /*------------------------ Constructor Implementation ------------------------*/
  100. ICanvas
  101.  &initialize ( unsigned long     windowIdentifier,
  102.                IWindow*          parent,
  103.                IWindow*          owner,
  104.                const IRectangle& initialRect,
  105.                unsigned long     style,
  106.                unsigned long     extendedStyle );
  107.  
  108. private:
  109. /*----------------------------- Hidden Members -------------------------------*/
  110.   ICanvas   ( const ICanvas& canvas );
  111. ICanvas
  112.  &operator= ( const ICanvas& canvas );
  113.  
  114. /*--------------------------------- Private ----------------------------------*/
  115. friend class ICanvasHandler;
  116. static Style
  117.   currentDefaultStyle;
  118. ISize
  119.   sizClLayout;
  120. IWindowHandle
  121.   hwndClDefaultButton;
  122. Boolean
  123.   bClChildrenReversed,
  124.   bClDefaultHandlerAdded;
  125. IFont
  126.  *fFont;
  127. ICanvasData
  128.  *fCanvasData;
  129. };  // ICanvas
  130.  
  131. INESTEDBITFLAGCLASSFUNCS(Style, ICanvas);
  132.  
  133. #pragma pack()
  134.  
  135.   #include <icanvas.inl>
  136.  
  137. #endif /* _ICANVAS_ */
  138.