home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / qt3_emx.zip / examples / themes / metal.h < prev    next >
C/C++ Source or Header  |  2001-10-11  |  2KB  |  67 lines

  1. /****************************************************************************
  2. ** $Id:  qt/metal.h   3.0.0   edited Aug 10 17:22 $
  3. **
  4. ** Definition of the Metal Style for the themes example
  5. **
  6. ** Created : 979899
  7. **
  8. ** Copyright (C) 1997 by Trolltech AS.  All rights reserved.
  9. **
  10. ** This file is part of an example program for Qt.  This example
  11. ** program may be used, distributed and modified without limitation.
  12. **
  13. *****************************************************************************/
  14.  
  15. #ifndef METAL_H
  16. #define METAL_H
  17.  
  18. #include <qwindowsstyle.h>
  19. #include <qpalette.h>
  20.  
  21. class MetalStyle : public QWindowsStyle
  22. {
  23. public:
  24.     MetalStyle();
  25.     void polish( QApplication*);
  26.     void unPolish( QApplication*);
  27.     void polish( QWidget* );
  28.     void unPolish( QWidget* );
  29.  
  30.     void drawPrimitive( PrimitiveElement pe,
  31.             QPainter *p,
  32.             const QRect &r,
  33.             const QColorGroup &cg,
  34.             SFlags flags = Style_Default,
  35.             const QStyleOption& = QStyleOption::Default) const;
  36.  
  37.     void drawControl( ControlElement element,
  38.               QPainter *p,
  39.               const QWidget *widget,
  40.               const QRect &r,
  41.               const QColorGroup &cg,
  42.               SFlags how = Style_Default,
  43.               const QStyleOption& = QStyleOption::Default ) const;
  44.  
  45.     void drawComplexControl( ComplexControl cc,
  46.                  QPainter *p,
  47.                  const QWidget *widget,
  48.                  const QRect &r,
  49.                  const QColorGroup &cg,
  50.                  SFlags how = Style_Default,
  51.                  SCFlags sub = SC_All,
  52.                  SCFlags subActive = SC_None,
  53.                  const QStyleOption& = QStyleOption::Default ) const;
  54.     int pixelMetric( PixelMetric, const QWidget * ) const;
  55.  
  56.  
  57. private:
  58.     void drawMetalFrame(  QPainter *p, int x, int y, int w, int h ) const;
  59.     void drawMetalGradient( QPainter *p, int x, int y, int w, int h,
  60.               bool sunken, bool horz, bool flat=FALSE ) const;
  61.     void drawMetalButton( QPainter *p, int x, int y, int w, int h,
  62.               bool sunken, bool horz, bool flat=FALSE ) const;
  63.     QPalette oldPalette;
  64. };
  65.  
  66. #endif
  67.