class drawmode {                               // drawing modes
    public: enum { draw, move, box, circle, arrow, lastmode };
    };
      
    class tablet : public canvas {                    // the tablet
    public:
      
      tablet(widget* w, char* options="");  
      
      int operator()() {                      // according to _mode
      	return handlers [mode]->dispatch( _event );
      }
      
      void mode(char* m);                // to set the drawing mode
      
    protected:
      void init(char* options);           // initializes the tablet
      int _mode; 
      class handler* handlers[drawmode::lastmode];   // keeps modes
      canvas* c;                               // the actual canvas
    };
  

slide: The tablet class