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
)
26 textColor
= Qt::black
;
30 if ( pix
!= 0L ) delete pix
;
42 class STabBar
: public QWidget
44 friend class BarPainter
;
46 STabBar( QWidget
* parent
= 0, const char * name
= 0 );
53 void setTabPos( TabPos
);
55 int insertTab( const QString
&label
, int id
= -1 );
57 void setPixmap( int id
, const QPixmap
&pix
);
59 void setTextColor( int id
, const QColor
&color
);
60 const QColor
& textColor( int id
);
62 void removeTab( int );
64 int currentTab(){ return _currentTab
; }
65 void setCurrentTab( int id
, bool allowDisable
= false );
67 void setTabEnabled( int, bool );
68 bool isTabEnabled( int );
70 void setTabCaption( int id
, const QString
&caption
);
71 QString
tabCaption( int id
);
74 virtual void setFont( const QFont
& );
76 void showTabIcon( bool );
77 bool isShowTabIcon(){ return iconShow
; }
80 void tabSelected( int );
81 void rightButtonPress( int, QPoint
);
88 virtual void paintEvent( QPaintEvent
* );
89 virtual void resizeEvent( QResizeEvent
* );
92 void setButtonPixmap();
95 TabBarData
* findData( int id
);
100 BarPainter
* barPainter
;
101 QList
<TabBarData
> *mainData
;
117 class BarPainter
: public QWidget
119 friend class STabBar
;
121 BarPainter( STabBar
* parent
);
125 int findBarByPos( int x
, int y
);
131 virtual void mousePressEvent ( QMouseEvent
* );
132 virtual void mouseReleaseEvent ( QMouseEvent
* );
134 virtual void resizeEvent( QResizeEvent
* );
135 virtual void paintEvent( QPaintEvent
* );