00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef __KTAGCOMBOBOX_H__
00026 #define __KTAGCOMBOBOX_H__
00027
00028 #include <tqcombobox.h>
00029
00030 class TQPopupMenu;
00031
00032
00033
00034
00035
00036
00037
00038 class KTagComboBox : public QComboBox
00039 {
00040 Q_OBJECT
00041
00042 public:
00043 KTagComboBox(TQWidget *parent=0, const char *name=0);
00044 ~KTagComboBox();
00045
00046 void insertItem(const TQIconSet& icon, const TQString &text, const TQString &tag, const TQString &submenu = TQString::null, int index=-1 );
00047 void insertItem(const TQString &text, const TQString &tag, const TQString &submenu = TQString::null, int index=-1 );
00048 void insertSeparator(const TQString &submenu = TQString::null, int index=-1 );
00049 void insertSubmenu(const TQString &text, const TQString &tag, const TQString &submenu = TQString::null, int index=-1);
00050
00051 int count() const;
00052 void clear();
00053
00054
00055
00056
00057 TQString currentTag() const;
00058 TQString tag ( int i ) const;
00059 bool containsTag (const TQString &str ) const;
00060
00061
00062
00063
00064 int currentItem() const;
00065 void setCurrentItem(int i);
00066 void setCurrentItem(const TQString &code);
00067
00068
00069 virtual void setFont( const TQFont & );
00070
00071 signals:
00072 void activated( int index );
00073 void highlighted( int index );
00074
00075 private slots:
00076 void internalActivate( int );
00077 void internalHighlight( int );
00078
00079 protected:
00080 void paintEvent( TQPaintEvent * );
00081 void mousePressEvent( TQMouseEvent * );
00082 void keyPressEvent( TQKeyEvent *e );
00083 void popupMenu();
00084
00085 private:
00086
00087 TQStringList *tags;
00088 TQPopupMenu *popup, *old_popup;
00089 int current;
00090 };
00091
00092 #endif