kmail
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 <tdelistbox.h>
00025
00026 class ColorListBox : public TDEListBox
00027 {
00028 Q_OBJECT
00029
00030
00031 public:
00032 ColorListBox( TQWidget *parent=0, const char * name=0, WFlags f=0 );
00033 void setColor( uint index, const TQColor &color );
00034 TQColor color( uint index ) const;
00035 signals:
00036 void changed();
00037
00038 public slots:
00039 virtual void setEnabled( bool state );
00040
00041 protected:
00042 void dragEnterEvent( TQDragEnterEvent *e );
00043 void dragLeaveEvent( TQDragLeaveEvent *e );
00044 void dragMoveEvent( TQDragMoveEvent *e );
00045 void dropEvent( TQDropEvent *e );
00046
00047 private slots:
00048 void newColor( int index );
00049
00050 private:
00051 int mCurrentOnDragEnter;
00052
00053 };
00054
00055
00056 class ColorListItem : public TQListBoxItem
00057 {
00058 public:
00059 ColorListItem( const TQString &text, const TQColor &color=TQt::black );
00060 const TQColor &color( void );
00061 void setColor( const TQColor &color );
00062
00063 protected:
00064 virtual void paint( TQPainter * );
00065 virtual int height( const TQListBox * ) const;
00066 virtual int width( const TQListBox * ) const;
00067
00068 private:
00069 TQColor mColor;
00070 int mBoxWidth;
00071 };
00072
00073 #endif
00074
|