1 /***************************************************************************
2 STabBar part of KDEStudio
4 copyright : (C) 1999 by Judin Maximus
5 email : novaprint@mtu-net.ru
6 ***************************************************************************/
19 TabBarData( int _id
, const char* _label
)
27 textColor
= Qt::black
;
34 if ( pix
!= 0L ) delete pix
;
46 class STabBar
: public QWidget
48 friend class BarPainter
;
50 STabBar( QWidget
* parent
= 0, const char * name
= 0 );
57 void setTabPos( TabPos
);
59 int insertTab( const QString
&label
, int id
= -1 );
61 void setPixmap( int id
, const QPixmap
&pix
);
63 void setTextColor( int id
, const QColor
&color
);
64 const QColor
& textColor( int id
);
66 void removeTab( int );
68 int currentTab(){ return _currentTab
; }
69 void setCurrentTab( int id
, bool allowDisable
= false );
71 void setTabEnabled( int, bool );
72 bool isTabEnabled( int );
74 void setTabCaption( int id
, const QString
&caption
);
75 QString
tabCaption( int id
);
78 virtual void setFont( const QFont
& );
80 void showTabIcon( bool );
81 bool isShowTabIcon(){ return iconShow
; }
84 void tabSelected( int );
85 void rightButtonPress( int, QPoint
);
92 virtual void paintEvent( QPaintEvent
* );
93 virtual void resizeEvent( QResizeEvent
* );
96 void setButtonPixmap();
99 TabBarData
* findData( int id
);
104 BarPainter
* barPainter
;
105 QList
<TabBarData
> *mainData
;
121 class BarPainter
: public QWidget
123 friend class STabBar
;
125 BarPainter( STabBar
* parent
);
129 int findBarByPos( int x
, int y
);
135 virtual void mousePressEvent ( QMouseEvent
* );
136 virtual void mouseReleaseEvent ( QMouseEvent
* );
138 virtual void resizeEvent( QResizeEvent
* );
139 virtual void paintEvent( QPaintEvent
* );