home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / qt3_emx.zip / examples / opengl / overlay_x11 / rubberbandwidget.h < prev   
Encoding:
C/C++ Source or Header  |  2001-10-11  |  993 b   |  39 lines

  1. /****************************************************************************
  2. ** $Id:  qt/rubberbandwidget.h   3.0.0   edited Jun 1 18:44 $
  3. **
  4. ** Definition of a widget that draws a rubberband. Designed to be used 
  5. ** in an X11 overlay visual
  6. **
  7. ** Copyright (C) 1999 by Trolltech AS.  All rights reserved.
  8. **
  9. ** This file is part of an example program for Qt.  This example
  10. ** program may be used, distributed and modified without limitation.
  11. **
  12. *****************************************************************************/
  13.  
  14. #ifndef RUBBERBANDWIDGET_H
  15. #define RUBBERBANDWIDGET_H
  16.  
  17. #include <qwidget.h>
  18.  
  19.  
  20. class RubberbandWidget : public QWidget
  21. {
  22. public:
  23.     RubberbandWidget( QColor transparentColor, QWidget *parent=0, 
  24.               const char *name=0, WFlags f=0 );
  25.  
  26. protected:
  27.     void mousePressEvent( QMouseEvent* e );
  28.     void mouseMoveEvent( QMouseEvent* e );
  29.     void mouseReleaseEvent( QMouseEvent* e );
  30.  
  31.     QColor c;
  32.     QPoint p1;
  33.     QPoint p2;
  34.     QPoint p3;
  35.     bool on;
  36. };
  37.  
  38. #endif
  39.