home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / vos2-121.zip / v / drawex / drawcnv.h < prev    next >
C/C++ Source or Header  |  1998-07-03  |  1KB  |  44 lines

  1. //================================================================
  2. //  drawcnv.h -- myCanvasPane class defintion header
  3. //  Copyright (C) 1995  Bruce E. Wampler
  4. //================================================================
  5. #ifndef DRAWCANVAS_H
  6. #define DRAWCANVAS_H
  7. #include <v/vcanvas.h>    // derive from vCanvas
  8. #include <v/vpen.h>    // contain a vPen
  9.  
  10.     typedef struct point    // simple struct for points
  11.       {
  12.     int x;  int y;        // coordinates
  13.     vPen pPen;        // pen to use
  14.       } point;
  15.  
  16.     class myCanvasPane : public vCanvasPane
  17.       {
  18.       public:        //--------------------------------- public
  19.     myCanvasPane();
  20.     virtual ~myCanvasPane();
  21.  
  22.     // Methods we will override.
  23.  
  24.     virtual void Clear();
  25.       virtual void MouseDown(int X, int Y, int button);
  26.     virtual void MouseUp(int X, int Y, int button);
  27.     virtual void MouseMove(int x, int y, int button);
  28.     virtual void Redraw(int x, int y, int w, int h);
  29.     virtual void myCanvasPane::Resize(int w, int h);
  30.  
  31.     // New methods for this class
  32.     int Read(char* name);
  33.     int Save(char* name);
  34.  
  35.       protected:    //------------------------------ protected
  36.  
  37.       private:        //-------------------------------- private
  38.     int _mouseDown;            // state of mouse
  39.     int _begx;  int _begy;  int _curx;  int _cury;  // coords
  40.     point *_pt;            // for point list
  41.     int _nextpt;            // next free point
  42.       };
  43. #endif
  44.