home *** CD-ROM | disk | FTP | other *** search
- /**
- GRAB Graph Layout and Browser System
-
- Copyright (c) 1989, Tera Computer Company
- **/
-
- /* View of the built-in attribute indicator */
-
- #ifndef dview_h
- #define dview_h
-
- #include <InterViews/interactor.h>
- #include <InterViews/button.h>
- #include <InterViews/box.h>
- #include <InterViews/message.h>
- #include <InterViews/painter.h>
- #include "att.h"
-
- class Button;
- class PushButton;
- class Painter;
- class CycleButton;
- class DrawView;
- class Depiction;
-
- // A message indicating an attribute value plus a button to press to change the
- // message. The message 'cycles' betwen various attribute values, forward or
- // backward, or can be reset to the base value
-
- class CycleParam : public HBox
- {
- public:
- CycleParam (char*, char*, DrawView*, AttType);
- void ChangeText(char*);
- void cycle(boolean);
- void reset();
- private:
- CycleButton* button;
- Message* message;
- char* text;
- DrawView* dv;
- AttType type; // shape, color, or brush?
- };
-
- // The interactive button in a CycleParam
-
- class CycleButton : public PushButton
- {
- public:
- CycleButton(char*, ButtonState*, CycleParam*);
- void Handle(Event&);
- private:
- CycleParam* cp;
- };
-
- // The drawing indicating the current values of the built-in attributes
-
- class Depiction : public Interactor
- {
- public:
- Depiction::Depiction();
- void Draw();
- void Redraw(Coord, Coord, Coord, Coord);
- void inhibit() { okaytodraw = false; };
- void allow() { okaytodraw = true; };
-
- NShape currShape;
- Painter *painter;
- private:
- friend class DrawView;
-
- boolean okaytodraw;
- };
-
- // 3 cycleparams, plus a depiction of what they mean
-
- class DrawView : public VBox
- {
- public:
- DrawView(int);
- void cycle(char*, boolean, AttType);
- void reset(AttType);
- void Draw();
- void Redraw(Coord, Coord, Coord, Coord);
- void Update();
- void Resize();
- boolean ShapeSet() { return shapeset; };
- boolean ColorSet() { return colorset; };
- boolean BrushSet() { return brushset; };
- NShape CurShape() { return depiction->currShape; };
- BType CurBrush() { return currentBrush; };
- CType CurColor() { return currentColor; };
- void DrawDep ();
- private:
- Depiction *depiction;
- CType currentColor;
- BType currentBrush;
- boolean colorset; // is there a current color?
- boolean brushset; // is there a current brush?
- boolean shapeset; // is there a current shape?
- CycleParam *colorButton;
- CycleParam *brushButton;
- CycleParam *shapeButton;
- void EraseDep ();
- int size; // size it should be
- char* colorString();
- char* shapeString();
- char* brushString();
- };
-
- #endif
-