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

tdeui

  • tdeui
kcolorbutton.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 1997 Martin Jones (mjones@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 as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef __COLBTN_H__
21 #define __COLBTN_H__
22 
23 #include <tqpushbutton.h>
24 
25 #include <tdelibs_export.h>
26 
27 class KColorButtonPrivate;
37 class TDEUI_EXPORT KColorButton : public TQPushButton
38 {
39  TQ_OBJECT
40  TQ_PROPERTY( TQColor color READ color WRITE setColor )
41  TQ_PROPERTY( TQColor defaultColor READ defaultColor WRITE setDefaultColor )
42 
43 public:
47  KColorButton( TQWidget *parent, const char *name = 0L );
48 
52  KColorButton( const TQColor &c, TQWidget *parent, const char *name = 0L );
54  KColorButton( const TQColor &c, const TQColor &defaultColor, TQWidget *parent,
55  const char *name=0L );
56 
57  virtual ~KColorButton();
58 
62  TQColor color() const
63  { return col; }
64 
68  void setColor( const TQColor &c );
69 
75  TQColor defaultColor() const;
76 
81  void setDefaultColor( const TQColor &c );
82 
83  TQSize sizeHint() const;
84 
85 signals:
90  void changed( const TQColor &newColor );
91 
92 protected slots:
93  void chooseColor();
94 
95 protected:
96  virtual void drawButtonLabel( TQPainter *p );
97  virtual void dragEnterEvent( TQDragEnterEvent *);
98  virtual void dropEvent( TQDropEvent *);
99  virtual void mousePressEvent( TQMouseEvent *e );
100  virtual void mouseMoveEvent( TQMouseEvent *e);
101  virtual void keyPressEvent( TQKeyEvent *e );
102 private:
103  TQColor col;
104  TQPoint mPos;
105  bool dragFlag;
106 
107 protected:
108  virtual void virtual_hook( int id, void* data );
109 private:
110  class KColorButtonPrivate;
111  KColorButtonPrivate *d;
112 };
113 
114 #endif
115 
KColorButton
A pushbutton to display or allow user selection of a color.
Definition: kcolorbutton.h:38
KColorButton::color
TQColor color() const
Returns the currently chosen color.
Definition: kcolorbutton.h:62
KColorButton::changed
void changed(const TQColor &newColor)
Emitted when the color of the widget is changed, either with setColor() or via user selection.

tdeui

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

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.9.1
This website is maintained by Timothy Pearson.