home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / intrvews / xgrab.lha / xgrab / include / aview.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-04-24  |  2.7 KB  |  104 lines

  1. /**
  2.    GRAB Graph Layout and Browser System
  3.  
  4.    Copyright (c) 1989, Tera Computer Company
  5.  **/
  6.  
  7. //
  8. //   header file for controlling the 'graph attributes' window
  9. //   and the user-defined attributes display 
  10. //
  11.  
  12. #ifndef aview_h
  13. #define aview_h
  14.  
  15. #include <InterViews/defs.h>
  16. #include <InterViews/box.h>
  17. #include <InterViews/button.h>
  18. #include <InterViews/event.h>
  19. #include <InterViews/scene.h>
  20. #include "mymenu.h"
  21. #include "bview.h"
  22.  
  23. class VBox;
  24. class HBox;
  25. class Interactor;
  26. class Scene;
  27. class Frame;
  28. class PressButton;
  29.  
  30. class AView : public MonoScene
  31. {
  32. public:
  33.     AView(Interactor*, Interactor*);
  34.     void SetAttrNames(char**, char**, int, int);  // get things rolling
  35.     boolean SetDisplayed();        // display the attributes window
  36.     void ShowNAttr(char**);        // display these node attributes
  37.     void ShowEAttr(char**);        // display these edge attributes
  38.     void EraseAttrBox();        // erase the display
  39.     void ChangeAttr(int);        // interface for AttrTextItems
  40.     void SetClear(int);            // interface for PressButtons
  41.     void Handle(Event&);
  42. private:
  43.     Interactor* underlying;    // we'll insert ourselves into its parent
  44.     Interactor* aligner;    // and we'll line it up with this one 
  45.     char** node_attr_names;
  46.     char** edge_attr_names;
  47.     int num_node_attr;
  48.     int num_edge_attr;
  49.     boolean* node_attr_displayed;
  50.     boolean* edge_attr_displayed;
  51.     VBox* NAttrMenu;
  52.     VBox* EAttrMenu;
  53.     HBox* NMenuBox;
  54.     HBox* EMenuBox;
  55.     MonoScene* currshow;    // the current user-defined attributes display
  56.     Frame* Displayer;      // what is displayed in the 'graph attributes' window
  57.     PressButton* eb;        // 'close'
  58.     PressButton* nc;        // 'node clear'
  59.     PressButton* ec;        // 'edge clear'
  60.     PressButton* ns;        // 'node setall'
  61.     PressButton* es;        // 'edge setall'
  62.     boolean onscreen;        // is the window onscreen?
  63.     boolean neveron;        // has it ever been onscreen
  64.     Coord oldx, oldy;        // where it was last
  65.  
  66.     void PopUp(Scene*, Coord, Coord, Alignment);
  67.     void Disappear(Scene*);
  68.     void DoExit();
  69.     void DoNodeSetall();
  70.     void DoEdgeSetall();
  71.     void DoNodeClear();
  72.     void DoEdgeClear();
  73.     void DisplayNAttrMenu();
  74.     void DisplayEAttrMenu();
  75.     VBox* NewNodeMenu();
  76.     VBox* NewEdgeMenu();
  77.     void InsertNodeMenuItems(VBox*);
  78.     void InsertEdgeMenuItems(VBox*);
  79. };
  80.  
  81. // text items in the 'graph attributes' window
  82. class AttrTextItem : public TextItem
  83. {
  84. public:
  85.     AttrTextItem(char*, int, AView*);
  86.     void Handle(Event&);
  87. private:
  88.     AView* handler;
  89.     int value;        // tag so we can tell them apart
  90. };
  91.  
  92. // buttons in the 'graph attributes' window
  93. class PressButton : public PushButton
  94. {
  95. public:
  96.     PressButton(char*, ButtonState*, int, AView*);
  97.     void Handle(Event&);
  98. private:
  99.     AView* handler;
  100.     int value;         // tag so we can tell them apart
  101. };
  102.  
  103. #endif
  104.