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

tdeui

Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
KColorDialog Class Reference

#include <kcolordialog.h>

Inheritance diagram for KColorDialog:
KDialogBase KDialog

Public Slots

void setColor (const TQColor &col)
 
- Public Slots inherited from KDialogBase
void enableButton (ButtonCode id, bool state)
 
void enableButtonOK (bool state)
 
void enableButtonApply (bool state)
 
void enableButtonCancel (bool state)
 
void enableLinkedHelp (bool state)
 
void delayedDestruct ()
 
void setHelpLinkText (const TQString &text)
 
void setHelp (const TQString &anchor, const TQString &appname=TQString::null)
 
void helpClickedSlot (const TQString &)
 
void setDetails (bool showDetails)
 
void setDetailsWidget (TQWidget *detailsWidget)
 
void updateBackground ()
 
void cancel ()
 
- Public Slots inherited from KDialog
virtual void polish ()
 
virtual void setCaption (const TQString &caption)
 
virtual void setPlainCaption (const TQString &caption)
 

Signals

void colorSelected (const TQColor &col)
 
- Signals inherited from KDialogBase
void helpClicked ()
 
void defaultClicked ()
 
void user3Clicked ()
 
void user2Clicked ()
 
void user1Clicked ()
 
void applyClicked ()
 
void tryClicked ()
 
void okClicked ()
 
void yesClicked ()
 
void noClicked ()
 
void cancelClicked ()
 
void closeClicked ()
 
void apply ()
 
void backgroundChanged ()
 
void hidden ()
 
void finished ()
 
void aboutToShowDetails ()
 
void aboutToShowPage (TQWidget *page)
 
- Signals inherited from KDialog
void layoutHintChanged ()
 

Public Member Functions

 KColorDialog (TQWidget *parent=0L, const char *name=0L, bool modal=false)
 
 ~KColorDialog ()
 
TQColor color () const
 
void setDefaultColor (const TQColor &defaultCol)
 
TQColor defaultColor () const
 
- Public Member Functions inherited from KDialogBase
 KDialogBase (TQWidget *parent=0, const char *name=0, bool modal=true, const TQString &caption=TQString::null, int buttonMask=Ok|Apply|Cancel, ButtonCode defaultButton=Ok, bool separator=false, const KGuiItem &user1=KGuiItem(), const KGuiItem &user2=KGuiItem(), const KGuiItem &user3=KGuiItem())
 
 KDialogBase (int dialogFace, const TQString &caption, int buttonMask, ButtonCode defaultButton, TQWidget *parent=0, const char *name=0, bool modal=true, bool separator=false, const KGuiItem &user1=KGuiItem(), const KGuiItem &user2=KGuiItem(), const KGuiItem &user3=KGuiItem())
 
 KDialogBase (KDialogBase::DialogType dialogFace, WFlags f, TQWidget *parent=0, const char *name=0, bool modal=true, const TQString &caption=TQString::null, int buttonMask=Ok|Apply|Cancel, ButtonCode defaultButton=Ok, bool separator=false, const KGuiItem &user1=KGuiItem(), const KGuiItem &user2=KGuiItem(), const KGuiItem &user3=KGuiItem())
 
 KDialogBase (const TQString &caption, int buttonMask=Yes|No|Cancel, ButtonCode defaultButton=Yes, ButtonCode escapeButton=Cancel, TQWidget *parent=0, const char *name=0, bool modal=true, bool separator=false, const KGuiItem &yes=KStdGuiItem::yes(), const KGuiItem &no=KStdGuiItem::no(), const KGuiItem &cancel=KStdGuiItem::cancel())
 
 ~KDialogBase ()
 
void setButtonBoxOrientation (int orientation)
 
void setEscapeButton (ButtonCode id)
 
virtual void adjustSize ()
 
virtual TQSize sizeHint () const
 
virtual TQSize minimumSizeHint () const
 
TQFrame * plainPage ()
 
TQFrame * addPage (const TQString &itemName, const TQString &header=TQString::null, const TQPixmap &pixmap=TQPixmap())
 
TQFrame * addPage (const TQStringList &items, const TQString &header=TQString::null, const TQPixmap &pixmap=TQPixmap())
 
TQVBox * addVBoxPage (const TQString &itemName, const TQString &header=TQString::null, const TQPixmap &pixmap=TQPixmap())
 
TQVBox * addVBoxPage (const TQStringList &items, const TQString &header=TQString::null, const TQPixmap &pixmap=TQPixmap())
 
TQHBox * addHBoxPage (const TQString &itemName, const TQString &header=TQString::null, const TQPixmap &pixmap=TQPixmap())
 
TQHBox * addHBoxPage (const TQStringList &items, const TQString &header=TQString::null, const TQPixmap &pixmap=TQPixmap())
 
TQGrid * addGridPage (int n, Orientation dir, const TQString &itemName, const TQString &header=TQString::null, const TQPixmap &pixmap=TQPixmap())
 
TQGrid * addGridPage (int n, Orientation dir, const TQStringList &items, const TQString &header=TQString::null, const TQPixmap &pixmap=TQPixmap())
 
void setFolderIcon (const TQStringList &path, const TQPixmap &pixmap)
 
TQFrame * makeMainWidget ()
 
TQVBox * makeVBoxMainWidget ()
 
TQHBox * makeHBoxMainWidget ()
 
TQGrid * makeGridMainWidget (int n, Orientation dir)
 
void enableButtonSeparator (bool state)
 
void showButton (ButtonCode id, bool state)
 
void showButtonOK (bool state)
 
void showButtonApply (bool state)
 
void showButtonCancel (bool state)
 
bool showPage (int index)
 
int activePageIndex () const
 
int pageIndex (TQWidget *widget) const
 
void setMainWidget (TQWidget *widget)
 
TQWidget * mainWidget ()
 
void disableResize ()
 
void setInitialSize (const TQSize &s, bool noResize=false)
 
void incInitialSize (const TQSize &s, bool noResize=false)
 
TQSize configDialogSize (const TQString &groupName) const
 
TQSize configDialogSize (TDEConfig &config, const TQString &groupName) const
 
void saveDialogSize (const TQString &groupName, bool global=false)
 
void saveDialogSize (TDEConfig &config, const TQString &groupName, bool global=false) const
 
void setButtonOK (const KGuiItem &item=KStdGuiItem::ok())
 
void setButtonOKText (const TQString &text=TQString::null, const TQString &tooltip=TQString::null, const TQString &quickhelp=TQString::null) TDE_DEPRECATED
 
void setButtonApply (const KGuiItem &item=KStdGuiItem::apply())
 
void setButtonApplyText (const TQString &text=TQString::null, const TQString &tooltip=TQString::null, const TQString &quickhelp=TQString::null) TDE_DEPRECATED
 
void setButtonCancel (const KGuiItem &item=KStdGuiItem::cancel())
 
void setButtonCancelText (const TQString &text=TQString::null, const TQString &tooltip=TQString::null, const TQString &quickhelp=TQString::null) TDE_DEPRECATED
 
void setButtonText (ButtonCode id, const TQString &text)
 
void setButtonTip (ButtonCode id, const TQString &text)
 
void setButtonWhatsThis (ButtonCode id, const TQString &text)
 
void setButtonGuiItem (ButtonCode id, const KGuiItem &item)
 
void setTreeListAutoResize (bool state)
 
void setShowIconsInTreeList (bool state)
 
void setRootIsDecorated (bool state)
 
void unfoldTreeList (bool persist=false)
 
void addWidgetBelowList (TQWidget *widget)
 
void addButtonBelowList (const TQString &text, TQObject *recv, const char *slot)
 
void addButtonBelowList (const KGuiItem &guiitem, TQObject *recv, const char *slot)
 
void setIconListAllVisible (bool state)
 
void showTile (bool state)
 
void getBorderWidths (int &ulx, int &uly, int &lrx, int &lry) const TDE_DEPRECATED
 
TQRect getContentsRect () const TDE_DEPRECATED
 
TQSize calculateSize (int w, int h) const
 
TQString helpLinkText () const
 
TQPushButton * actionButton (ButtonCode id)
 
- Public Member Functions inherited from KDialog
 KDialog (TQWidget *parent=0, const char *name=0, bool modal=false, WFlags f=0)
 

Static Public Member Functions

static int getColor (TQColor &theColor, TQWidget *parent=0L)
 
static int getColor (TQColor &theColor, const TQColor &defaultColor, TQWidget *parent=0L)
 
static TQColor grabColor (const TQPoint &p)
 
- Static Public Member Functions inherited from KDialogBase
static bool haveBackgroundTile ()
 
static const TQPixmap * backgroundTile ()
 
static const TQPixmap * getBackgroundTile () TDE_DEPRECATED
 
static void setBackgroundTile (const TQPixmap *pix)
 
- Static Public Member Functions inherited from KDialog
static int marginHint ()
 
static int spacingHint ()
 
static void resizeLayout (TQWidget *widget, int margin, int spacing)
 
static void resizeLayout (TQLayoutItem *lay, int margin, int spacing)
 
static void centerOnScreen (TQWidget *widget, int screen=-1)
 
static bool avoidArea (TQWidget *widget, const TQRect &area, int screen=-1)
 

Protected Member Functions

virtual void mouseReleaseEvent (TQMouseEvent *)
 
virtual void keyPressEvent (TQKeyEvent *)
 
virtual bool eventFilter (TQObject *obj, TQEvent *ev)
 
virtual void virtual_hook (int id, void *data)
 
- Protected Member Functions inherited from KDialogBase
virtual void keyPressEvent (TQKeyEvent *e)
 
virtual void hideEvent (TQHideEvent *)
 
virtual void closeEvent (TQCloseEvent *e)
 
virtual void virtual_hook (int id, void *data)
 
virtual void keyPressEvent (TQKeyEvent *)
 
virtual void virtual_hook (int id, void *data)
 

Additional Inherited Members

- Public Types inherited from KDialogBase
enum  ButtonCode {
  Help = 0x00000001 , Default = 0x00000002 , Ok = 0x00000004 , Apply = 0x00000008 ,
  Try = 0x00000010 , Cancel = 0x00000020 , Close = 0x00000040 , User1 = 0x00000080 ,
  User2 = 0x00000100 , User3 = 0x00000200 , No = 0x00000080 , Yes = 0x00000100 ,
  Details = 0x00000400 , Filler = 0x40000000 , Stretch = 0x80000000 , NoDefault
}
 
enum  ActionButtonStyle {
  ActionStyle0 =0 , ActionStyle1 , ActionStyle2 , ActionStyle3 ,
  ActionStyle4 , ActionStyleMAX
}
 
enum  DialogType {
  TreeList = KJanusWidget::TreeList , Tabbed = KJanusWidget::Tabbed , Plain = KJanusWidget::Plain , Swallow = KJanusWidget::Swallow ,
  IconList = KJanusWidget::IconList
}
 
- Protected Slots inherited from KDialogBase
virtual void slotHelp ()
 
virtual void slotDefault ()
 
virtual void slotDetails ()
 
virtual void slotUser3 ()
 
virtual void slotUser2 ()
 
virtual void slotUser1 ()
 
virtual void slotOk ()
 
virtual void slotApply ()
 
virtual void slotTry ()
 
virtual void slotYes ()
 
virtual void slotNo ()
 
virtual void slotCancel ()
 
virtual void slotClose ()
 
virtual void applyPressed ()
 
void updateGeometry ()
 
void slotDelayedDestruct ()
 

Detailed Description

A color selection dialog.

Features:

  • Color selection from a wide range of palettes.
  • Color selection from a palette of H vs S and V selectors.
  • Direct input of HSV or RGB values.
  • Saving of custom colors

In most cases, you will want to use the static method KColorDialog::getColor(). This pops up the dialog (with an initial selection provided by you), lets the user choose a color, and returns.

Example:

TQColor myColor;
int result = KColorDialog::getColor( myColor );
if ( result == KColorDialog::Accepted )
...
KColorDialog::getColor
static int getColor(TQColor &theColor, TQWidget *parent=0L)
Creates a modal color dialog, let the user choose a color, and returns when the dialog is closed.
Definition: kcolordialog.cpp:1298
KDE Color Dialog

The color dialog is really a collection of several widgets which can you can also use separately: the quadratic plane in the top left of the dialog is a KXYSelector. Right next to it is a KHSSelector for choosing hue/saturation.

On the right side of the dialog you see a KPaletteTable showing up to 40 colors with a combo box which offers several predefined palettes or a palette configured by the user. The small field showing the currently selected color is a KColorPatch.

Definition at line 377 of file kcolordialog.h.

Constructor & Destructor Documentation

◆ KColorDialog()

KColorDialog::KColorDialog ( TQWidget *  parent = 0L,
const char *  name = 0L,
bool  modal = false 
)

Constructs a color selection dialog.

Definition at line 939 of file kcolordialog.cpp.

◆ ~KColorDialog()

KColorDialog::~KColorDialog ( )

Destroys the color selection dialog.

Definition at line 1178 of file kcolordialog.cpp.

Member Function Documentation

◆ color()

TQColor KColorDialog::color ( ) const

Returns the currently selected color.

Definition at line 1281 of file kcolordialog.cpp.

◆ colorSelected

void KColorDialog::colorSelected ( const TQColor &  col)
signal

Emitted when a color is selected.

Connect to this to monitor the color as it as selected if you are not running modal.

◆ defaultColor()

TQColor KColorDialog::defaultColor ( ) const
Returns
the value passed to setDefaultColor

Definition at line 1237 of file kcolordialog.cpp.

◆ eventFilter()

bool KColorDialog::eventFilter ( TQObject *  obj,
TQEvent *  ev 
)
protectedvirtual

Definition at line 1188 of file kcolordialog.cpp.

◆ getColor() [1/2]

int KColorDialog::getColor ( TQColor &  theColor,
const TQColor &  defaultColor,
TQWidget *  parent = 0L 
)
static

Creates a modal color dialog, lets the user choose a color, and returns when the dialog is closed.

The selected color is returned in the argument theColor.

This version takes a defaultColor argument, which sets the color selected by the "default color" checkbox. When this checkbox is checked, the invalid color (TQColor()) is returned into theColor.

Returns
TQDialog::result().

Definition at line 1316 of file kcolordialog.cpp.

◆ getColor() [2/2]

int KColorDialog::getColor ( TQColor &  theColor,
TQWidget *  parent = 0L 
)
static

Creates a modal color dialog, let the user choose a color, and returns when the dialog is closed.

The selected color is returned in the argument theColor.

Returns
TQDialog::result().

Definition at line 1298 of file kcolordialog.cpp.

◆ grabColor()

TQColor KColorDialog::grabColor ( const TQPoint &  p)
static

Gets the color from the pixel at point p on the screen.

Definition at line 1533 of file kcolordialog.cpp.

◆ keyPressEvent()

void KColorDialog::keyPressEvent ( TQKeyEvent *  e)
protectedvirtual

Maps some keys to the actions buttons.

F1 is mapped to the Help button if present and Escape to the Cancel or Close if present. The button action event is animated.

Reimplemented from KDialogBase.

Definition at line 1542 of file kcolordialog.cpp.

◆ mouseReleaseEvent()

void KColorDialog::mouseReleaseEvent ( TQMouseEvent *  e)
protectedvirtual

Definition at line 1515 of file kcolordialog.cpp.

◆ setColor

void KColorDialog::setColor ( const TQColor &  col)
slot

Preselects a color.

Definition at line 1290 of file kcolordialog.cpp.

◆ setDefaultColor()

void KColorDialog::setDefaultColor ( const TQColor &  defaultCol)

Call this to make the dialog show a "Default Color" checkbox.

If this checkbox is selected, the dialog will return an "invalid" color (TQColor()). This can be used to mean "the default text color", for instance, the one with the KDE text color on screen, but black when printing.

Definition at line 1207 of file kcolordialog.cpp.

◆ virtual_hook()

void KColorDialog::virtual_hook ( int  id,
void *  data 
)
protectedvirtual

Reimplemented from KDialogBase.

Definition at line 1611 of file kcolordialog.cpp.


The documentation for this class was generated from the following files:
  • kcolordialog.h
  • kcolordialog.cpp

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.