Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

nodes.h

Go to the documentation of this file.
00001 /*************************************************************************
00002  *
00003  *  AUTHOR: Wilson T
00004  *
00005  *  TITLE:  nodes.h
00006  *
00007  *  DATE: April 28, 1993
00008  *
00009  *  PURPOSE:  Declaration of nodes class and constants.
00010  *
00011  *************************************************************************/
00012 
00013 #ifndef _NODES_H
00014 #define _NODES_H
00015 
00016 #include <stdlib.h>
00017 #include "typedefs.h"
00018 #include "scrnobj.h"
00019 #include "viewport.h"
00020 #include "display.h"
00021 #include "messages.h"
00022 #include "checkbox.h"
00023 
00024 
00025         /*************************
00026          *                       *
00027          * Constant Declarations *
00028          *                       *
00029          *************************/
00030 
00031 const int NFRAME  = 1;  // Additional highlighting of node when Active
00032 const int CCIRCLE = 8;
00033 const int NFILLSIZE = 1;  // Border of fill graphics from edge
00034 const int STOPRAD = 3;
00035 const int NBOXCOLOR = LIGHTGRAY;
00036 const int NOFFCOLOR = DARKGRAY;
00037 
00038 class Nodes:public CheckBox {
00039   int NCOLORFILL, NBOXSIZE;
00040 public:
00041   Nodes       (int, BOOLEAN);
00042   Nodes       (int, int, BOOLEAN);
00043   void Init     (Display *, int, int);
00044   ~Nodes        ()
00045     {if (Drawn) Erase();}
00046   Message Dispatch    (Message &);
00047   void  Draw      ();
00048   void NewFillColor   (int);
00049   void EnableNode     (int);
00050   void DisableNode    ();
00051   void ChangeStatus   (BOOLEAN);
00052   void ChangeStatus   (BOOLEAN, int);
00053 private:
00054   void set_constants  (int, int, BOOLEAN);
00055   void  image_size  ();
00056   void  image_size  (int, int);
00057   void prep_screen  (int);
00058   void fill_box   ();
00059   void empty_box    (int);
00060   void animate_box  ();
00061   void animate_frame  ();
00062   Message key_msg (Message &);
00063   Message command_msg (Message &);
00064   Message mouse_msg (Message &);
00065   void disable_box  ();
00066   void enable_box ();
00067 };
00068 
00069 inline Nodes::Nodes(int Id, int colorfill, BOOLEAN state)
00070   {set_constants(Id, colorfill, state); image_size();}
00071 
00072 inline Nodes::Nodes(int Id, BOOLEAN state)
00073   {set_constants(Id, BLUE, state); image_size();}
00074 
00075 inline void Nodes::NewFillColor(int newcolor)
00076   {NCOLORFILL=newcolor;}
00077 
00078 inline void Nodes::DisableNode()
00079   {disable_box();}
00080 
00081 inline void Nodes::EnableNode(int color)
00082   {if(!BStatus) NCOLORFILL=color; enable_box();}
00083 
00084 inline void Nodes::ChangeStatus(BOOLEAN bswitch, int color)
00085   {BStatus=bswitch; NCOLORFILL=color; animate_box();}
00086 
00087 inline void Nodes::ChangeStatus(BOOLEAN bswitch)
00088   {BStatus=bswitch; animate_box();}
00089 
00090 inline void Nodes::image_size()
00091   {X2 = X+NBOXSIZE; Y2 = Y+NBOXSIZE;}
00092 
00093 inline void Nodes::animate_box()
00094   {if (BStatus) fill_box(); else if(Able) empty_box(NBOXCOLOR);
00095    else if(!Able) empty_box(NOFFCOLOR);}
00096 
00097 inline void Nodes::disable_box()
00098   {Able=Off; BOOLEAN temp=BStatus; empty_box(NOFFCOLOR);
00099    BStatus=temp; if(BStatus) fill_box();}
00100 
00101 inline void Nodes::enable_box()
00102   {Able=On; BOOLEAN temp=BStatus; empty_box(NBOXCOLOR);
00103    BStatus=temp; if(BStatus) fill_box();}
00104 
00105 #endif

Generated on Sun Jul 6 23:07:16 2003 for Scotland Yard by doxygen1.2.15