author | mickeyl <mickeyl> | 2005-01-29 14:18:51 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-01-29 14:18:51 (UTC) |
commit | 555b999359a5aad999eaaf48632ce85f25125b85 (patch) (unidiff) | |
tree | 7414362241e49e06f49486e93a8f504113961b1c /examples/opieui/olistviewdemo | |
parent | 7b06e36fe27adc6a4fde2004eac13aaf8c0f0f02 (diff) | |
download | opie-555b999359a5aad999eaaf48632ce85f25125b85.zip opie-555b999359a5aad999eaaf48632ce85f25125b85.tar.gz opie-555b999359a5aad999eaaf48632ce85f25125b85.tar.bz2 |
examples appear here
Diffstat (limited to 'examples/opieui/olistviewdemo') (more/less context) (ignore whitespace changes)
-rw-r--r-- | examples/opieui/olistviewdemo/main.cpp | 29 | ||||
-rw-r--r-- | examples/opieui/olistviewdemo/olistviewdemo.cpp | 86 | ||||
-rw-r--r-- | examples/opieui/olistviewdemo/olistviewdemo.h | 51 | ||||
-rw-r--r-- | examples/opieui/olistviewdemo/olistviewdemo.pro | 23 |
4 files changed, 189 insertions, 0 deletions
diff --git a/examples/opieui/olistviewdemo/main.cpp b/examples/opieui/olistviewdemo/main.cpp new file mode 100644 index 0000000..cd49c28 --- a/dev/null +++ b/examples/opieui/olistviewdemo/main.cpp | |||
@@ -0,0 +1,29 @@ | |||
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 "olistviewdemo.h" | ||
17 | #include <opie2/oapplication.h> | ||
18 | |||
19 | using namespace Opie::Ui; | ||
20 | using namespace Opie::Core; | ||
21 | |||
22 | int main( int argc, char **argv ) | ||
23 | { | ||
24 | OApplication a( argc, argv, "OListViewDemo" ); | ||
25 | OListViewDemo e; | ||
26 | a.showMainWidget(&e); | ||
27 | return a.exec(); | ||
28 | } | ||
29 | |||
diff --git a/examples/opieui/olistviewdemo/olistviewdemo.cpp b/examples/opieui/olistviewdemo/olistviewdemo.cpp new file mode 100644 index 0000000..4c05620 --- a/dev/null +++ b/examples/opieui/olistviewdemo/olistviewdemo.cpp | |||
@@ -0,0 +1,86 @@ | |||
1 | /* | ||
2 | This file is part of the Opie Project | ||
3 | |||
4 | Copyright (C) 2003 Michael 'Mickey' Lauer | ||
5 | <mickey@tm.informatik.uni-frankfurt.de> | ||
6 | =. | ||
7 | .=l. | ||
8 | .>+-= | ||
9 | _;:, .> :=|. This program is free software; you can | ||
10 | .> <`_, > . <= redistribute it and/or modify it under | ||
11 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
12 | .="- .-=="i, .._ License as published by the Free Software | ||
13 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
14 | ._= =} : or (at your option) any later version. | ||
15 | .%`+i> _;_. | ||
16 | .i_,=:_. -<s. This program is distributed in the hope that | ||
17 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
18 | : .. .:, . . . without even the implied warranty of | ||
19 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
20 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
21 | ..}^=.= = ; Library General Public License for more | ||
22 | ++= -. .` .: details. | ||
23 | : = ...= . :.=- | ||
24 | -. .:....=;==+<; You should have received a copy of the GNU | ||
25 | -_. . . )=. = Library General Public License along with | ||
26 | -- :-=` this library; see the file COPYING.LIB. | ||
27 | If not, write to the Free Software Foundation, | ||
28 | Inc., 59 Temple Place - Suite 330, | ||
29 | Boston, MA 02111-1307, USA. | ||
30 | |||
31 | */ | ||
32 | |||
33 | #include "olistviewdemo.h" | ||
34 | |||
35 | /* OPIE */ | ||
36 | #include <opie2/olistview.h> | ||
37 | #include <opie2/odebug.h> | ||
38 | |||
39 | /* QT */ | ||
40 | #include <qstring.h> | ||
41 | #include <qpixmap.h> | ||
42 | #include <qlistview.h> | ||
43 | |||
44 | using namespace Opie::Ui; | ||
45 | |||
46 | OListViewDemo::OListViewDemo( QWidget* parent, const char* name, WFlags f ) | ||
47 | :QVBox( parent, name, f ) | ||
48 | { | ||
49 | lv = new ONamedListView( this ); | ||
50 | lv->setRootIsDecorated( true ); | ||
51 | lv->addColumns( QStringList::split( ' ', "Column1 Column2 Column3 Column4" ) ); | ||
52 | |||
53 | ONamedListViewItem* item = new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); | ||
54 | item->setText( "Column2", "ModifiedText" ); | ||
55 | item->setText( "Column5", "ThisColumnDoesNotExits" ); | ||
56 | |||
57 | new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); | ||
58 | new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); | ||
59 | new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Minni" ) ); | ||
60 | item = new ONamedListViewItem( lv, QStringList::split( ' ', "XXX YYY ZZZ ***" ) ); | ||
61 | new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); | ||
62 | new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); | ||
63 | |||
64 | new ONamedListViewItem( item, QStringList::split( ' ', "SubText1 Text2 Text3 Text4" ) ); | ||
65 | new ONamedListViewItem( item, QStringList::split( ' ', "SubText1 Text2 Text3 Text4" ) ); | ||
66 | new ONamedListViewItem( item, QStringList::split( ' ', "SubText1 Text2 Text3 Text4" ) ); | ||
67 | item = new ONamedListViewItem( item, QStringList::split( ' ', "Text1 Text2 Text3 HereItComes" ) ); | ||
68 | item = new ONamedListViewItem( item, QStringList::split( ' ', "Text1 Text2 Text3 HereItComesSoon" ) ); | ||
69 | item = new ONamedListViewItem( item, QStringList::split( ' ', "Text1 Text2 Text3 Mickey" ) ); | ||
70 | |||
71 | if ( lv->find( 3, "Mickey", 3 ) ) | ||
72 | odebug << "found Mickey :-)" << oendl; | ||
73 | else | ||
74 | odebug << "did not found Mickey :-(" << oendl; | ||
75 | |||
76 | if ( lv->find( 3, "Minni", 0 ) ) | ||
77 | odebug << "found Minni :-)" << oendl; | ||
78 | else | ||
79 | odebug << "did not found Minni :-(" << oendl; | ||
80 | |||
81 | } | ||
82 | |||
83 | OListViewDemo::~OListViewDemo() | ||
84 | { | ||
85 | } | ||
86 | |||
diff --git a/examples/opieui/olistviewdemo/olistviewdemo.h b/examples/opieui/olistviewdemo/olistviewdemo.h new file mode 100644 index 0000000..0b5c498 --- a/dev/null +++ b/examples/opieui/olistviewdemo/olistviewdemo.h | |||
@@ -0,0 +1,51 @@ | |||
1 | /* | ||
2 | This file is part of the Opie Project | ||
3 | |||
4 | Copyright (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> | ||
5 | =. | ||
6 | .=l. | ||
7 | .>+-= | ||
8 | _;:, .> :=|. This program is free software; you can | ||
9 | .> <`_, > . <= redistribute it and/or modify it under | ||
10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
11 | .="- .-=="i, .._ License as published by the Free Software | ||
12 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
13 | ._= =} : or (at your option) any later version. | ||
14 | .%`+i> _;_. | ||
15 | .i_,=:_. -<s. This program is distributed in the hope that | ||
16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
17 | : .. .:, . . . without even the implied warranty of | ||
18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
20 | ..}^=.= = ; Library General Public License for more | ||
21 | ++= -. .` .: details. | ||
22 | : = ...= . :.=- | ||
23 | -. .:....=;==+<; You should have received a copy of the GNU | ||
24 | -_. . . )=. = Library General Public License along with | ||
25 | -- :-=` this library; see the file COPYING.LIB. | ||
26 | If not, write to the Free Software Foundation, | ||
27 | Inc., 59 Temple Place - Suite 330, | ||
28 | Boston, MA 02111-1307, USA. | ||
29 | |||
30 | */ | ||
31 | |||
32 | #ifndef OLISTVIEWDEMO_H | ||
33 | #define OLISTVIEWDEMO_H | ||
34 | |||
35 | #include <qvbox.h> | ||
36 | #include <opie2/olistview.h> | ||
37 | |||
38 | class OListViewDemo: public QVBox | ||
39 | { | ||
40 | Q_OBJECT | ||
41 | |||
42 | public: | ||
43 | OListViewDemo( QWidget* parent=0, const char* name=0, WFlags f=0 ); | ||
44 | virtual ~OListViewDemo(); | ||
45 | |||
46 | private: | ||
47 | Opie::Ui::ONamedListView* lv; | ||
48 | |||
49 | }; | ||
50 | |||
51 | #endif | ||
diff --git a/examples/opieui/olistviewdemo/olistviewdemo.pro b/examples/opieui/olistviewdemo/olistviewdemo.pro new file mode 100644 index 0000000..52c3ceb --- a/dev/null +++ b/examples/opieui/olistviewdemo/olistviewdemo.pro | |||
@@ -0,0 +1,23 @@ | |||
1 | TEMPLATE = app | ||
2 | CONFIG = qt warn_on | ||
3 | HEADERS = olistviewdemo.h | ||
4 | SOURCES = olistviewdemo.cpp \ | ||
5 | main.cpp | ||
6 | INCLUDEPATH += $(OPIEDIR)/include | ||
7 | DEPENDPATH += $(OPIEDIR)/include | ||
8 | LIBS += -lopieui2 -lopiecore2 -lqpe | ||
9 | TARGET = olistviewdemo | ||
10 | MOC_DIR = moc | ||
11 | OBJECTS_DIR = obj | ||
12 | |||
13 | |||
14 | |||
15 | |||
16 | !contains( platform, x11 ) { | ||
17 | include( $(OPIEDIR)/include.pro ) | ||
18 | } | ||
19 | |||
20 | contains( platform, x11 ) { | ||
21 | LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib | ||
22 | } | ||
23 | |||