kaddressbook
colorlistbox.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _COLOR_LISTBOX_H_
00022 #define _COLOR_LISTBOX_H_
00023
00024 #include <klistbox.h>
00025
00026 class ColorListBox : public KListBox
00027 {
00028 Q_OBJECT
00029
00030 public:
00031 ColorListBox( TQWidget *parent=0, const char * name=0, WFlags f=0 );
00032 void setColor( uint index, const TQColor &color );
00033 TQColor color( uint index ) const;
00034
00035 public slots:
00036 virtual void setEnabled( bool state );
00037
00038 protected:
00039 void dragEnterEvent( TQDragEnterEvent *e );
00040 void dragLeaveEvent( TQDragLeaveEvent *e );
00041 void dragMoveEvent( TQDragMoveEvent *e );
00042 void dropEvent( TQDropEvent *e );
00043
00044 private slots:
00045 void newColor( int index );
00046
00047 private:
00048 int mCurrentOnDragEnter;
00049
00050 };
00051
00052
00053 class ColorListItem : public QListBoxItem
00054 {
00055 public:
00056 ColorListItem( const TQString &text, const TQColor &color=Qt::black );
00057 const TQColor &color( void );
00058 void setColor( const TQColor &color );
00059
00060 protected:
00061 virtual void paint( TQPainter * );
00062 virtual int height( const TQListBox * ) const;
00063 virtual int width( const TQListBox * ) const;
00064
00065 private:
00066 TQColor mColor;
00067 int mBoxWidth;
00068 };
00069
00070 #endif
00071
|