• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kdeui
 

kdeui

  • kdeui
kdualcolorbutton.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 1999 Daniel M. Duley <mosfet@kde.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License version 2 as published by the Free Software Foundation.
7 
8  This library is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  Library General Public License for more details.
12 
13  You should have received a copy of the GNU Library General Public License
14  along with this library; see the file COPYING.LIB. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17 */
18 #ifndef __KDUALCOLORBTN_H
19 #define __KDUALCOLORBTN_H
20 
21 class TQBitmap;
22 #include <tqbrush.h>
23 #include <tqwidget.h>
24 
25 #include <kdelibs_export.h>
26 
48 class KDEUI_EXPORT KDualColorButton : public TQWidget
49 {
50  Q_OBJECT
51  Q_ENUMS( DualColor )
52  Q_PROPERTY( TQColor foreground READ foreground WRITE setForeground )
53  Q_PROPERTY( TQColor background READ background WRITE setBackground )
54  Q_PROPERTY( TQColor currentColor READ currentColor WRITE setCurrentColor STORED false DESIGNABLE false )
55  Q_PROPERTY( DualColor current READ current WRITE setCurrent )
56 
57 public:
58 
59  enum DualColor { Foreground, Background };
67  KDualColorButton(TQWidget *parent=0, const char *name=0, TQWidget* dialogParent=0);
68 
73  KDualColorButton(const TQColor &fgColor, const TQColor &bgColor,
74  TQWidget *parent=0, const char *name=0, TQWidget* dialogParent=0);
75 
76  ~KDualColorButton();
80  TQColor foreground() const;
84  TQColor background() const;
88  DualColor current() const;
92  TQColor currentColor() const;
97  virtual TQSize sizeHint() const;
98 public slots:
102  void setForeground(const TQColor &c);
106  void setBackground(const TQColor &c);
110  void setCurrent(DualColor s);
114  void setCurrentColor(const TQColor &c);
115 signals:
119  void fgChanged(const TQColor &c);
123  void bgChanged(const TQColor &c);
127  void currentChanged(KDualColorButton::DualColor s);
128 protected:
136  virtual void metrics(TQRect &fgRect, TQRect &bgRect);
137  virtual void paintEvent(TQPaintEvent *ev);
138  virtual void mousePressEvent(TQMouseEvent *ev);
139  virtual void mouseMoveEvent(TQMouseEvent *ev);
140  virtual void mouseReleaseEvent(TQMouseEvent *ev);
141  // Dnd
142  virtual void dragEnterEvent(TQDragEnterEvent *ev);
143  virtual void dropEvent(TQDropEvent *ev);
144 private:
145  TQBitmap *arrowBitmap;
146  TQPixmap *resetPixmap;
147  TQBrush fg, bg;
148  TQPoint mPos;
149  bool dragFlag, miniCtlFlag;
150  DualColor curColor, tmpColor;
151 
152 protected:
153  virtual void virtual_hook( int id, void* data );
154 private:
155  class KDualColorPrivate;
156  KDualColorPrivate *d;
157 };
158 
159 #endif
KDualColorButton
A widget for selecting two related colors.
Definition: kdualcolorbutton.h:48

kdeui

Skip menu "kdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdeui

Skip menu "kdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdeui by doxygen 1.8.11
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |