home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / Draw / Sources / ToolFrm.h < prev    next >
Encoding:
Text File  |  1996-08-16  |  3.2 KB  |  101 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                ToolFrm.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Author:                Henri Lamiraux
  7. //
  8. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef TOOLFRM_H
  13. #define TOOLFRM_H
  14.  
  15. #ifndef UTILS_H
  16. #include "Utils.h"
  17. #endif
  18.  
  19. #ifndef FLOATFRM_H
  20. #include "FloatFrm.h"
  21. #endif
  22.  
  23. //========================================================================================
  24. // Constants
  25. //========================================================================================
  26.  
  27. const unsigned short kToolCellSize = 21;
  28.  
  29. const unsigned short kToolWidth = 1 + kToolCellSize + 1 + kToolCellSize + 1;
  30. const unsigned short kToolHeight = 1 + kToolCellSize + 1 + kToolCellSize + 1 + kToolCellSize + 1;
  31.  
  32. const unsigned short kSelectorHeight = 12;
  33. const short kFillFrameSelectorPos = 2 + kToolHeight + 2;
  34.  
  35. const unsigned short kColorSelectorWidth = kToolWidth - 4;
  36. const unsigned short kColorSelectorHeight = 30;
  37.  
  38. const unsigned short kToolsWindowWidth = 2 + kToolWidth + 2;
  39. const unsigned short kToolsWindowHeight = 2 + kToolHeight + 2 + kSelectorHeight + 2 + 2 + 4 + kColorSelectorHeight + 4;
  40.  
  41. //========================================================================================
  42. // Forward Declaration
  43. //========================================================================================
  44.  
  45. class FW_CMouseEvent;
  46. class FW_CGraphicContext;
  47.  
  48. //========================================================================================
  49. // CToolFrame
  50. //========================================================================================
  51.  
  52. class CToolFrame : public CFloatingWindowFrame
  53. {
  54. //----------------------------------------------------------------------------------------
  55. // Initialization/destruction
  56. //
  57. public:        
  58.  
  59.     FW_DECLARE_AUTO(CToolFrame)
  60.     
  61.     CToolFrame(Environment *ev, ODFrame* odFrame, FW_CPresentation* presentation, CDrawPart* drawPart);
  62.     virtual ~ CToolFrame();
  63.  
  64. //----------------------------------------------------------------------------------------
  65. // Inherited
  66. //
  67. public:    
  68.     virtual void             Draw(Environment *ev, ODFacet* odFacet, ODShape* invalidShape);
  69.     virtual FW_Boolean        DoMouseDown(Environment *ev, const FW_CMouseEvent& theMouseEvent);
  70.     
  71. //----------------------------------------------------------------------------------------
  72. // New API
  73. //
  74. public:
  75.     void                    CheckTool(Environment *ev, 
  76.                                         unsigned short oldTool, 
  77.                                           unsigned short newTool);
  78.     void                    CheckRenderVerb(Environment *ev, 
  79.                                             unsigned short oldRenderVerb, 
  80.                                                  unsigned short newRenderVerb);
  81.     void                    UpdateColors(Environment *ev);
  82.     
  83. private:
  84.     void                    InvertTool(FW_CGraphicContext& gc, unsigned short theTool, FW_Boolean state);
  85.     void                    DrawRenderVerb(FW_CGraphicContext& gc, 
  86.                                             unsigned short renderVerb, 
  87.                                             const FW_CColor& color);
  88.     void                    DrawTools(FW_CGraphicContext& gc);
  89.     void                    DrawColors(FW_CGraphicContext& gc);
  90.     
  91.     
  92. //----------------------------------------------------------------------------------------
  93. // Data Members
  94. //
  95. private:    
  96.     CGrid                    fToolGrid;
  97.     CGrid                    fFillFrameGrid;
  98. };
  99.  
  100. #endif
  101.