⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 kcolordlg.h

📁 PIXIL is a small footprint operating environment, complete with PDA PIM applications, a browser and
💻 H
字号:
/* This file is part of the KDE libraries    Copyright (C) 1997 Martin Jones (mjones@kde.org)    This library is free software; you can redistribute it and/or    modify it under the terms of the GNU Library General Public    License as published by the Free Software Foundation; either    version 2 of the License, or (at your option) any later version.    This library is distributed in the hope that it will be useful,    but WITHOUT ANY WARRANTY; without even the implied warranty of    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU    Library General Public License for more details.    You should have received a copy of the GNU Library General Public License    along with this library; see the file COPYING.LIB.  If not, write to    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,    Boston, MA 02111-1307, USA.*///-----------------------------------------------------------------------------// KDE color selection dialog.// layout managment added Oct 1997 by Mario Weilguni // <mweilguni@sime.com>#ifndef __KCOLORDLG_H__#define __KCOLORDLG_H__#include <qdialog.h>#include <qtableview.h>#include <qframe.h>#include <qrangecontrol.h>#include <qlineedit.h>#include <qpixmap.h>#include <qcombobox.h>#include "kselect.h"//-----------------------------------------------------------------------------class KHSSelector : public KXYSelector{  Q_OBJECTpublic:  KHSSelector( QWidget *parent );private:  void drawPalette();protected:  virtual void resizeEvent( QResizeEvent * );  virtual void drawContents( QPainter *painter );protected:  QPixmap pixmap;};//-----------------------------------------------------------------------------class KValueSelector : public KSelector{  Q_OBJECTpublic:  KValueSelector( QWidget *parent );  void setHue( int h )	{	hue = h; }  void setSaturation( int s )	{	sat = s; }  void drawPalette();protected:  virtual void resizeEvent( QResizeEvent * );  virtual void drawContents( QPainter *painter );protected:  int hue;  int sat;  QPixmap pixmap;};//-----------------------------------------------------------------------------class KColorCells : public QTableView{  Q_OBJECTpublic:  KColorCells( QWidget *parent, int rows, int cols );  ~KColorCells();  void setColor( int colNum, const QColor &col );  QColor color( int indx )  {	return colors[indx]; }  int numCells()  {	return numRows() * numCols(); }	  int getSelected()  {	return selected; }  signals:  void colorSelected( int col );protected:  virtual void paintCell( QPainter *painter, int row, int col );  virtual void resizeEvent( QResizeEvent * );  virtual void mouseReleaseEvent( QMouseEvent * );  QColor *colors;  int	selected;};//-----------------------------------------------------------------------------class KColorPatch : public QFrame{  Q_OBJECTpublic:  KColorPatch( QWidget *parent );  virtual ~KColorPatch();  void setColor( const QColor &col );protected:  virtual void drawContents( QPainter *painter );private:  QColor color;  uint pixel;  int colContext;};//-----------------------------------------------------------------------------/// KDE Color Selection dialog/** KDE Color Selection dialogFeatures:Colour selection from a standard system palette.Colour selection from a Palette of H vs S and V selectors (similar to windoze).Direct input of HSV or RGB values.Saving of custom colorssimplest use:QColor myColor;int result = KColorDialog::getColor( myColor ); */class KColorDialog : public QDialog{  Q_OBJECTpublic:  /// Constructor  /** Construct a KColorDialog */  KColorDialog( QWidget *parent = 0L, const char *name = 0L,				bool modal = FALSE );  /// Preselect a color  /** Preselect a color */  void setColor( const QColor &col );  /// Retrieve the currently selected color.  /** Retrieve the currently selected color. */  QColor color()	{	return selColor; }    /**	This is probably the function you are looking for.	Just call this to pop up dialog get the selected color.	returns result().	*/  static int getColor( QColor &theColor ); public slots: void slotOkPressed();  signals: /// Notify when a color is selected. /**   connect to this to monitor the color as it as selected if you are   not running modal.   */ void colorSelected( const QColor &col ); private slots: void slotRGBChanged();  void slotHSVChanged();  void slotHSChanged( int, int );  void slotVChanged( int );  void slotSysColorSelected( int );  void slotCustColorSelected( int );  void slotAddToCustom();  void getHelp();private:  void readSettings();  void writeSettings();  void setRgbEdit();  void setHsvEdit();private:  KColorCells *sysColorCells;  KColorCells *custColorCells;  QLineEdit *hedit;  QLineEdit *sedit;  QLineEdit *vedit;  QLineEdit *redit;  QLineEdit *gedit;  QLineEdit *bedit;  KColorPatch *patch;  KHSSelector *palette;  KValueSelector *valuePal;  QColor selColor;};//----------------------------------------------------------------------------class KColorCombo : public QComboBox{	Q_OBJECTpublic:	KColorCombo( QWidget *parent, const char *name = 0L );	void setColor( const QColor &col );public slots:	void slotActivated( int index );	void slotHighlighted( int index );signals:	void activated( const QColor &col );	void highlighted( const QColor &col );protected:	virtual void resizeEvent( QResizeEvent *re );private:	void addColors();	QColor customColor;	QColor color;};#endif		// __KCOLORDLG_H__

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -