KBFX – an alternative to T-Menu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
1.9KB

  1. /*
  2. * Copyright (C) 2006
  3. * Siraj Razick <siraj@kdemail.net>
  4. * PhobosK <phobosk@mail.kbfx.net>
  5. * see Also AUTHORS
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU Library General Public License version 2 as
  9. * published by the Free Software Foundation
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details
  15. *
  16. * You should have received a copy of the GNU Library General Public
  17. * License along with this program; if not, write to the
  18. * Free Software Foundation, Inc.,
  19. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  20. */
  21. #ifndef KBFX_SPINX_SCROLL_BAR_H
  22. #define KBFX_SPINX_SCROLL_BAR_H
  23. #include <tqimage.h>
  24. #include <tqpainter.h>
  25. #include <tqpixmap.h>
  26. #include <tqpointarray.h>
  27. #include <tqtimer.h>
  28. #include <tqwidget.h>
  29. #include <kbfxplasmapixmapprovider.h>
  30. class TQWidget;
  31. class KbfxSpinxScrollBar:public TQWidget
  32. {
  33. Q_OBJECT
  34. public:
  35. typedef enum {UP,DOWN,LEFT,RIGHT} Direction;
  36. KbfxSpinxScrollBar ( TQWidget * parent = 0,const char * name = 0,int type = 0 );
  37. ~KbfxSpinxScrollBar();
  38. virtual void paintEvent ( TQPaintEvent * ev );
  39. virtual void mousePressEvent ( TQMouseEvent * me );
  40. virtual void mouseReleaseEvent ( TQMouseEvent * me );
  41. virtual void enterEvent ( TQEvent * e );
  42. virtual void leaveEvent ( TQEvent * e );
  43. void setType ( Direction dir );
  44. public slots:
  45. void timeoutslot();
  46. signals:
  47. void scrollUp();
  48. void scrollDown();
  49. void scroll ( int , int );
  50. private:
  51. TQPixmap m_normal;
  52. TQPixmap m_hover;
  53. TQPixmap m_presseod;
  54. TQPointArray m_triAngle;
  55. Direction m_dir;
  56. TQTimer * m_timer;
  57. bool m_pressed;
  58. //
  59. int _x;
  60. int _y;
  61. int w;
  62. int h;
  63. };
  64. #endif