author | mickeyl <mickeyl> | 2005-01-29 14:23:27 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-01-29 14:23:27 (UTC) |
commit | 20b3de56573b9e86c6b6041faf684adc8cbb2a45 (patch) (unidiff) | |
tree | e0d91c84dee46d1cce3b0d68fd2c10c3dd7ce3a1 /libopie2/examples/opieui/oversatileviewdemo/opieuidemo.cpp | |
parent | 555b999359a5aad999eaaf48632ce85f25125b85 (diff) | |
download | opie-20b3de56573b9e86c6b6041faf684adc8cbb2a45.zip opie-20b3de56573b9e86c6b6041faf684adc8cbb2a45.tar.gz opie-20b3de56573b9e86c6b6041faf684adc8cbb2a45.tar.bz2 |
examples to where they belong
Diffstat (limited to 'libopie2/examples/opieui/oversatileviewdemo/opieuidemo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/examples/opieui/oversatileviewdemo/opieuidemo.cpp | 203 |
1 files changed, 0 insertions, 203 deletions
diff --git a/libopie2/examples/opieui/oversatileviewdemo/opieuidemo.cpp b/libopie2/examples/opieui/oversatileviewdemo/opieuidemo.cpp deleted file mode 100644 index a2cdd5a..0000000 --- a/libopie2/examples/opieui/oversatileviewdemo/opieuidemo.cpp +++ b/dev/null | |||
@@ -1,203 +0,0 @@ | |||
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 | // Qt | ||
17 | |||
18 | #include <qcolor.h> | ||
19 | #include <qpopupmenu.h> | ||
20 | #include <qmenubar.h> | ||
21 | #include <qmessagebox.h> | ||
22 | #include <qvbox.h> | ||
23 | #include <qstring.h> | ||
24 | #include <qstringlist.h> | ||
25 | |||
26 | // Qtopia | ||
27 | |||
28 | #include <qpe/qpeapplication.h> | ||
29 | #include <qpe/global.h> | ||
30 | |||
31 | // Opie | ||
32 | |||
33 | #include <opie2/odevice.h> | ||
34 | |||
35 | #include <opie2/ocompletionbox.h> | ||
36 | #include <opie2/olineedit.h> | ||
37 | #include <opie2/ocombobox.h> | ||
38 | #include <opie2/oeditlistbox.h> | ||
39 | #include <opie2/oselector.h> | ||
40 | #include <opie2/opopupmenu.h> | ||
41 | |||
42 | #include <qtabwidget.h> | ||
43 | #include "oversatileviewdemo.h" | ||
44 | |||
45 | // Local | ||
46 | |||
47 | #include "opieuidemo.h" | ||
48 | |||
49 | using namespace Opie::Core; | ||
50 | using namespace Opie::Ui; | ||
51 | |||
52 | enum Demos { ocompletionbox, olineedit, ocombobox, oeditlistbox, oselector }; | ||
53 | |||
54 | OpieUIDemo::OpieUIDemo( QWidget* parent, const char* name, WFlags fl ) | ||
55 | : QMainWindow( parent, name, fl ) | ||
56 | { | ||
57 | |||
58 | QMenuBar* mbar = this->menuBar(); | ||
59 | OPopupMenu* demo = new OPopupMenu( this ); | ||
60 | demo->setTitle( "Title" ); | ||
61 | demo->setItemParameter( demo->insertItem( "OCompletionBox", this, SLOT( demo(int) ) ), ocompletionbox ); | ||
62 | demo->setItemParameter( demo->insertItem( "OLineEdit", this, SLOT( demo(int) ) ), olineedit ); | ||
63 | demo->setItemParameter( demo->insertItem( "OComboBox", this, SLOT( demo(int) ) ), ocombobox ); | ||
64 | demo->setItemParameter( demo->insertItem( "OEditListBox", this, SLOT( demo(int) ) ), oeditlistbox ); | ||
65 | demo->setItemParameter( demo->insertItem( "OSelector", this, SLOT( demo(int) ) ), oselector ); | ||
66 | mbar->insertItem( "Demonstrate", demo ); | ||
67 | |||
68 | build(); | ||
69 | |||
70 | } | ||
71 | |||
72 | OpieUIDemo::~OpieUIDemo() | ||
73 | { | ||
74 | } | ||
75 | |||
76 | void OpieUIDemo::build() | ||
77 | { | ||
78 | main = new QTabWidget( this, "tabwidget" ); | ||
79 | setCentralWidget( main ); | ||
80 | main->show(); | ||
81 | |||
82 | main->addTab( new OVersatileViewDemo( main ), "VersatileView" ); | ||
83 | } | ||
84 | |||
85 | |||
86 | void OpieUIDemo::demo( int d ) | ||
87 | { | ||
88 | switch (d) | ||
89 | { | ||
90 | case ocompletionbox: demoOCompletionBox(); break; | ||
91 | case olineedit: demoOLineEdit(); break; | ||
92 | case ocombobox: demoOComboBox(); break; | ||
93 | case oeditlistbox: demoOEditListBox(); break; | ||
94 | case oselector: demoOSelector(); break; | ||
95 | |||
96 | } | ||
97 | |||
98 | } | ||
99 | |||
100 | void OpieUIDemo::demoOCompletionBox() | ||
101 | { | ||
102 | odebug << "ocompletionbox" << oendl; | ||
103 | |||
104 | OCompletionBox* box = new OCompletionBox( 0 ); | ||
105 | box->insertItem( "This CompletionBox" ); | ||
106 | box->insertItem( "Says 'Hello World'" ); | ||
107 | box->insertItem( "Here are some" ); | ||
108 | box->insertItem( "Additional Items" ); | ||
109 | box->insertItem( "Complete Completion Box" ); | ||
110 | |||
111 | connect( box, SIGNAL( activated(const QString&) ), this, SLOT( messageBox(const QString&) ) ); | ||
112 | box->popup(); | ||
113 | |||
114 | } | ||
115 | |||
116 | void OpieUIDemo::demoOLineEdit() | ||
117 | { | ||
118 | odebug << "olineedit" << oendl; | ||
119 | |||
120 | OLineEdit *edit = new OLineEdit( 0, "lineedit" ); | ||
121 | |||
122 | edit->setCompletionMode( OGlobalSettings::CompletionPopup ); | ||
123 | OCompletion* comp = edit->completionObject(); | ||
124 | |||
125 | QStringList list; | ||
126 | list << "mickeyl@handhelds.org"; | ||
127 | list << "mickey@tm.informatik.uni-frankfurt.de"; | ||
128 | list << "mickey@vanille.de"; | ||
129 | |||
130 | comp->setItems( list ); | ||
131 | |||
132 | edit->show(); | ||
133 | |||
134 | } | ||
135 | |||
136 | void OpieUIDemo::demoOComboBox() | ||
137 | { | ||
138 | odebug << "ocombobox" << oendl; | ||
139 | |||
140 | OComboBox *combo = new OComboBox( true, 0, "combobox" ); | ||
141 | |||
142 | combo->setCompletionMode( OGlobalSettings::CompletionPopup ); | ||
143 | OCompletion* comp = combo->completionObject(); | ||
144 | |||
145 | QStringList ilist; | ||
146 | ilist << "kergoth@handhelds.org"; | ||
147 | ilist << "harlekin@handhelds.org"; | ||
148 | ilist << "groucho@handhelds.org"; | ||
149 | combo->insertStringList( ilist ); | ||
150 | |||
151 | QStringList clist; | ||
152 | clist << "mickeyl@handhelds.org"; | ||
153 | clist << "mickey@tm.informatik.uni-frankfurt.de"; | ||
154 | clist << "mickey@vanille.de"; | ||
155 | comp->setItems( clist ); | ||
156 | |||
157 | combo->show(); | ||
158 | |||
159 | } | ||
160 | |||
161 | void OpieUIDemo::demoOEditListBox() | ||
162 | { | ||
163 | odebug << "oeditlistbox" << oendl; | ||
164 | |||
165 | OEditListBox* edit = new OEditListBox( "OEditListBox", 0, "editlistbox" ); | ||
166 | |||
167 | edit->lineEdit()->setCompletionMode( OGlobalSettings::CompletionPopup ); | ||
168 | OCompletion* comp = edit->lineEdit()->completionObject(); | ||
169 | QStringList clist; | ||
170 | clist << "Completion everywhere"; | ||
171 | clist << "Cool Completion everywhere"; | ||
172 | clist << "History History History"; | ||
173 | comp->setItems( clist ); | ||
174 | |||
175 | QStringList list; | ||
176 | list << "kergoth@handhelds.org"; | ||
177 | list << "harlekin@handhelds.org"; | ||
178 | list << "groucho@handhelds.org"; | ||
179 | list << "mickeyl@handhelds.org"; | ||
180 | edit->insertStringList( list ); | ||
181 | |||
182 | edit->show(); | ||
183 | |||
184 | } | ||
185 | |||
186 | void OpieUIDemo::demoOSelector() | ||
187 | { | ||
188 | odebug << "oselector" << oendl; | ||
189 | |||
190 | OHSSelector* sel = new OHSSelector( 0, "gradientselector" ); | ||
191 | //#sel->resize( QSize( 200, 30 ) ); | ||
192 | //#sel->setColors( QColor( 90, 190, 60 ), QColor( 200, 55, 255 ) ); | ||
193 | //#sel->setText( "Dark", "Light" ); | ||
194 | |||
195 | sel->show(); | ||
196 | } | ||
197 | |||
198 | void OpieUIDemo::messageBox( const QString& text ) | ||
199 | { | ||
200 | QString info; | ||
201 | info = "You have selected '" + text + "'"; | ||
202 | QMessageBox::information( this, "OpieUIDemo", info ); | ||
203 | } | ||