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

tdeui

  • tdeui
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
21class TQBitmap;
22#include <tqbrush.h>
23#include <tqwidget.h>
24
25#include <tdelibs_export.h>
26
48class TDEUI_EXPORT KDualColorButton : public TQWidget
49{
50 TQ_OBJECT
51 TQ_ENUMS( DualColor )
52 TQ_PROPERTY( TQColor foreground READ foreground WRITE setForeground )
53 TQ_PROPERTY( TQColor background READ background WRITE setBackground )
54 TQ_PROPERTY( TQColor currentColor READ currentColor WRITE setCurrentColor STORED false DESIGNABLE false )
55 TQ_PROPERTY( DualColor current READ current WRITE setCurrent )
56
57public:
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;
98public slots:
102 void setForeground(const TQColor &c);
106 void setBackground(const TQColor &c);
110 void setCurrent(DualColor s);
114 void setCurrentColor(const TQColor &c);
115signals:
119 void fgChanged(const TQColor &c);
123 void bgChanged(const TQColor &c);
127 void currentChanged(KDualColorButton::DualColor s);
128protected:
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);
144private:
145 TQBitmap *arrowBitmap;
146 TQPixmap *resetPixmap;
147 TQBrush fg, bg;
148 TQPoint mPos;
149 bool dragFlag, miniCtlFlag;
150 DualColor curColor, tmpColor;
151
152protected:
153 virtual void virtual_hook( int id, void* data );
154private:
155 class KDualColorPrivate;
156 KDualColorPrivate *d;
157};
158
159#endif
KDualColorButton
A widget for selecting two related colors.
Definition: kdualcolorbutton.h:49
KDualColorButton::currentChanged
void currentChanged(KDualColorButton::DualColor s)
Emitted when the user changes the current color selection.
KDualColorButton::fgChanged
void fgChanged(const TQColor &c)
Emitted when the foreground color is changed.
KDualColorButton::bgChanged
void bgChanged(const TQColor &c)
Emitted when the background color is changed.

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.4
This website is maintained by Timothy Pearson.