home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-07-16 | 1.8 KB | 77 lines | [TEXT/CWIE] |
- // ===========================================================================
- // CGraphPane.h ©1995-97 Timo Eloranta All rights reserved.
- // ===========================================================================
- // This class displays the best drawing on the screen.
-
- #pragma once
-
- #include <LView.h>
- #include <LCommander.h>
- #include <URegistrar.h>
- #include "CGraphDrawing.h"
-
- class LGWorld;
- class CGraphGAApp;
-
- class CGraphPane : public LView,
- public LCommander {
- private:
- CGraphGAApp *mApp;
- CGraphPtr mGraph;
- LGWorld *mGWorld;
- Int16 mGridSquareSize;
- Int16 mMaxSquareSize;
- Int16 mNodeSize;
- Rect mGridRect;
- Rect mFrameRect;
- SDimension16 mWindStdSize;
-
- Boolean mFullWindow,
- mShowGrid,
- mShowEdges,
- mShowNodes,
- mDarkGrid,
- mUseColor,
- mDrawingIsOld;
-
- // --- Private methods ---
-
- void CalculateGridRect();
-
- void EraseBackground( Rect &inEraseRect,
- Boolean inForceErase );
- void PlaceInClipboard();
- PicHandle CreatePict();
- void DrawTheBest();
- void DrawGrid();
- void DrawEdges( Boolean inDrawToPict = false );
- void DrawNodes();
-
- Int16 SelectNodeSize();
- Int16 GetNextSquareSize( Boolean inBigger );
- Boolean ValidSquareSize( Int16 inSize );
-
- protected:
- virtual void DrawSelf();
-
- public:
- enum {
- class_ID = 'GrPa'
- };
-
- CGraphPane( LStream *inStream );
- virtual ~CGraphPane();
-
- virtual Boolean ObeyCommand( CommandT inCommand, void *ioParam );
- virtual void FindCommandStatus( CommandT inCommand,
- Boolean &outEnabled, Boolean &outUsesMark,
- Char16 &outMark, Str255 outName);
-
- void SetGraph( CGraphPtr inGraph );
- void SetApp( CGraphGAApp * inApp)
- { mApp = inApp; };
-
- void InvalidateDrawing( Boolean inDrawNow );
-
- };
-