author | mickeyl <mickeyl> | 2003-02-20 00:00:22 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-02-20 00:00:22 (UTC) |
commit | d25a16d1fd34374e4d2815dec4d11b25b2049432 (patch) (unidiff) | |
tree | 51f8fe7f32a891e3a1f5c579b15734bd784f8142 /noncore/net/wellenreiter/gui/mainwindow.cpp | |
parent | c815825a0368257defb64d5f8ce5e2a2f2da93c6 (diff) | |
download | opie-d25a16d1fd34374e4d2815dec4d11b25b2049432.zip opie-d25a16d1fd34374e4d2815dec4d11b25b2049432.tar.gz opie-d25a16d1fd34374e4d2815dec4d11b25b2049432.tar.bz2 |
- add mainwindow as central window
- add menubar and some toolbuttons
Diffstat (limited to 'noncore/net/wellenreiter/gui/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/mainwindow.cpp | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/noncore/net/wellenreiter/gui/mainwindow.cpp b/noncore/net/wellenreiter/gui/mainwindow.cpp new file mode 100644 index 0000000..d7326c0 --- a/dev/null +++ b/noncore/net/wellenreiter/gui/mainwindow.cpp | |||
@@ -0,0 +1,92 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Opie Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | **********************************************************************/ | ||
15 | |||
16 | #include "mainwindow.h" | ||
17 | #include "wellenreiter.h" | ||
18 | |||
19 | #include <qiconset.h> | ||
20 | #include <qmenubar.h> | ||
21 | #include <qpopupmenu.h> | ||
22 | #include <qstatusbar.h> | ||
23 | #include <qtoolbutton.h> | ||
24 | |||
25 | #ifdef QWS | ||
26 | #include <qpe/resource.h> | ||
27 | #else | ||
28 | #include "resource.h" | ||
29 | #endif | ||
30 | |||
31 | WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * name, WFlags f ) | ||
32 | :QMainWindow( parent, name, f ) | ||
33 | { | ||
34 | mw = new Wellenreiter( this ); | ||
35 | setCentralWidget( mw ); | ||
36 | |||
37 | // setup icon sets | ||
38 | |||
39 | searchIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/SearchIcon" ) ); | ||
40 | infoIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/InfoIcon" ) ); | ||
41 | settingsIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/SettingsIcon" ) ); | ||
42 | cancelIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/CancelIcon" ) ); | ||
43 | |||
44 | // setup tool buttons | ||
45 | |||
46 | QToolButton* b = new QToolButton( 0 ); | ||
47 | b->setAutoRaise( true ); | ||
48 | b->setOnIconSet( *cancelIconSet ); | ||
49 | b->setOffIconSet( *searchIconSet ); | ||
50 | b->setToggleButton( true ); | ||
51 | |||
52 | QToolButton* c = new QToolButton( 0 ); | ||
53 | c->setAutoRaise( true ); | ||
54 | c->setIconSet( *infoIconSet ); | ||
55 | c->setEnabled( false ); | ||
56 | |||
57 | QToolButton* d = new QToolButton( 0 ); | ||
58 | d->setAutoRaise( true ); | ||
59 | d->setIconSet( *settingsIconSet ); | ||
60 | |||
61 | // setup menu bar | ||
62 | |||
63 | QMenuBar* mb = menuBar(); | ||
64 | |||
65 | QPopupMenu* p = new QPopupMenu( mb ); | ||
66 | p->insertItem( "&Load" ); | ||
67 | p->insertItem( "&Save" ); | ||
68 | |||
69 | mb->insertItem( "&File", p ); | ||
70 | mb->setItemEnabled( mb->insertItem( b ), false ); | ||
71 | mb->setItemEnabled( mb->insertItem( c ), false ); | ||
72 | mb->insertItem( d ); | ||
73 | |||
74 | // setup status bar | ||
75 | |||
76 | // statusBar()->message( "Ready." ); | ||
77 | |||
78 | }; | ||
79 | |||
80 | WellenreiterMainWindow::~WellenreiterMainWindow() | ||
81 | { | ||
82 | |||
83 | delete searchIconSet; | ||
84 | delete infoIconSet; | ||
85 | delete settingsIconSet; | ||
86 | delete cancelIconSet; | ||
87 | |||
88 | |||
89 | }; | ||
90 | |||
91 | |||
92 | |||