author | drw <drw> | 2002-07-16 01:08:45 (UTC) |
---|---|---|
committer | drw <drw> | 2002-07-16 01:08:45 (UTC) |
commit | b1849c87eade2706908caddeda5924866c040441 (patch) (unidiff) | |
tree | f36cbfb15eaa2eeea9f20438a5655188ee6165ab /noncore/settings/sysinfo/otabwidget.h | |
parent | 72eb74051ed8f1b7696041e241ab99df3af5b08d (diff) | |
download | opie-b1849c87eade2706908caddeda5924866c040441.zip opie-b1849c87eade2706908caddeda5924866c040441.tar.gz opie-b1849c87eade2706908caddeda5924866c040441.tar.bz2 |
New tab widget
Diffstat (limited to 'noncore/settings/sysinfo/otabwidget.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/sysinfo/otabwidget.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/noncore/settings/sysinfo/otabwidget.h b/noncore/settings/sysinfo/otabwidget.h new file mode 100644 index 0000000..4588cb9 --- a/dev/null +++ b/noncore/settings/sysinfo/otabwidget.h | |||
@@ -0,0 +1,62 @@ | |||
1 | /********************************************************************** | ||
2 | ** OTabWidget | ||
3 | ** | ||
4 | ** Modified tab widget control | ||
5 | ** | ||
6 | ** Copyright (C) 2002, Dan Williams | ||
7 | ** williamsdr@acm.org | ||
8 | ** http://draknor.net | ||
9 | ** | ||
10 | ** This file may be distributed and/or modified under the terms of the | ||
11 | ** GNU General Public License version 2 as published by the Free Software | ||
12 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
13 | ** packaging of this file. | ||
14 | ** | ||
15 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
16 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
17 | ** | ||
18 | **********************************************************************/ | ||
19 | |||
20 | #ifndef OTABWIDGET_H | ||
21 | #define OTABWIDGET_H | ||
22 | |||
23 | #include <qtabwidget.h> | ||
24 | |||
25 | class TabInfo | ||
26 | { | ||
27 | public: | ||
28 | TabInfo() : c( 0 ), i( 0 ), l( QString::null ) {} | ||
29 | TabInfo( QWidget *control, const QString &icon, const QString &label ) | ||
30 | : c( control ), i( icon ), l( label ) {} | ||
31 | QString label() const { return l; } | ||
32 | QWidget *control() const { return c; } | ||
33 | QString icon() const { return i; } | ||
34 | |||
35 | private: | ||
36 | QWidget *c; | ||
37 | QString i; | ||
38 | QString l; | ||
39 | }; | ||
40 | |||
41 | typedef QValueList<TabInfo> TabInfoList; | ||
42 | |||
43 | class OTabWidget : public QTabWidget | ||
44 | { | ||
45 | Q_OBJECT | ||
46 | public: | ||
47 | OTabWidget( QWidget *, const char * ); | ||
48 | ~OTabWidget(); | ||
49 | |||
50 | void addTab( QWidget *, const QString &, const QString & ); | ||
51 | |||
52 | private: | ||
53 | TabInfoList Tabs; | ||
54 | TabInfoList::Iterator CurrentTab; | ||
55 | |||
56 | QPixmap loadSmooth( const QString & ); | ||
57 | |||
58 | private slots: | ||
59 | void tabChangedSlot( QWidget * ); | ||
60 | }; | ||
61 | |||
62 | #endif | ||