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

  1. //=======================================================================
  2. //  mycanvas.h -- myCanvasPane class defintion header
  3. //  Copyright (C) 1995  Bruce E. Wampler
  4. //
  5. //  This program is part of the V C++ GUI Framework example programs.
  6. //
  7. //  This program is free software; you can redistribute it and/or modify
  8. //  it under the terms of the GNU General Public License as published by
  9. //  the Free Software Foundation; either version 2 of the License, or
  10. //  (at your option) any later version.
  11. //
  12. //  This program is distributed in the hope that it will be useful,
  13. //  but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. //  GNU General Public License for more details.
  16. //
  17. //  You should have received a copy of the GNU General Public License
  18. //  (see COPYING) along with this program; if not, write to the Free
  19. //  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. //=======================================================================
  21.  
  22. #ifndef MYCANVAS_H
  23. #define MYCANVAS_H
  24.  
  25. #include <v/vcanvas.h>
  26. #include <v/vpen.h>
  27.  
  28.     typedef struct point
  29.       {
  30.     int x;
  31.     int y;
  32.     vPen pPen;
  33.       } point;
  34.  
  35.     class myCanvasPane : public vCanvasPane
  36.       {
  37.       public:        //---------------------------------------- public
  38.     myCanvasPane();
  39.     virtual ~myCanvasPane();
  40.  
  41.     // Windows
  42.     virtual void Clear();
  43.  
  44.     // Scrolling
  45.     virtual void HPage(int, int);
  46.     virtual void VPage(int, int);
  47.  
  48.     virtual void HScroll(int);
  49.     virtual void VScroll(int);
  50.  
  51.     // Events
  52.     virtual void MouseDown(int, int, int);
  53.     virtual void MouseUp(int, int, int);
  54.     virtual void MouseMove(int, int, int);
  55.  
  56.     virtual void Redraw(int, int, int, int); // Expose/redraw event
  57.     virtual void Resize(int, int);        // Resize event
  58.  
  59.       protected:    //--------------------------------------- protected
  60.  
  61.       private:        //--------------------------------------- private
  62.     int _mouseDown;
  63.     int _begx;
  64.     int _begy;
  65.     int _curx;
  66.     int _cury;
  67.  
  68.     point *pt;
  69.     int nextpt;
  70.       };
  71. #endif
  72.