author | mickeyl <mickeyl> | 2005-01-29 14:18:51 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-01-29 14:18:51 (UTC) |
commit | 555b999359a5aad999eaaf48632ce85f25125b85 (patch) (side-by-side diff) | |
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 @@ +/********************************************************************** +** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. +** +** This file is part of Opie Environment. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +**********************************************************************/ + +#include "olistviewdemo.h" +#include <opie2/oapplication.h> + +using namespace Opie::Ui; +using namespace Opie::Core; + +int main( int argc, char **argv ) +{ + OApplication a( argc, argv, "OListViewDemo" ); + OListViewDemo e; + a.showMainWidget(&e); + return a.exec(); +} + 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 @@ +/* + This file is part of the Opie Project + + Copyright (C) 2003 Michael 'Mickey' Lauer + <mickey@tm.informatik.uni-frankfurt.de> + =. + .=l. + .>+-= + _;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU Library General Public +.="- .-=="i, .._ License as published by the Free Software + - . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -<s. This program is distributed in the hope that + + . -:. = it will be useful, but WITHOUT ANY WARRANTY; + : .. .:, . . . without even the implied warranty of + =_ + =;=|` MERCHANTABILITY or FITNESS FOR A + _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= = ; Library General Public License for more +++= -. .` .: details. + : = ...= . :.=- + -. .:....=;==+<; You should have received a copy of the GNU + -_. . . )=. = Library General Public License along with + -- :-=` this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + +*/ + +#include "olistviewdemo.h" + +/* OPIE */ +#include <opie2/olistview.h> +#include <opie2/odebug.h> + +/* QT */ +#include <qstring.h> +#include <qpixmap.h> +#include <qlistview.h> + +using namespace Opie::Ui; + +OListViewDemo::OListViewDemo( QWidget* parent, const char* name, WFlags f ) + :QVBox( parent, name, f ) +{ + lv = new ONamedListView( this ); + lv->setRootIsDecorated( true ); + lv->addColumns( QStringList::split( ' ', "Column1 Column2 Column3 Column4" ) ); + + ONamedListViewItem* item = new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); + item->setText( "Column2", "ModifiedText" ); + item->setText( "Column5", "ThisColumnDoesNotExits" ); + + new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); + new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); + new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Minni" ) ); + item = new ONamedListViewItem( lv, QStringList::split( ' ', "XXX YYY ZZZ ***" ) ); + new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); + new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); + + new ONamedListViewItem( item, QStringList::split( ' ', "SubText1 Text2 Text3 Text4" ) ); + new ONamedListViewItem( item, QStringList::split( ' ', "SubText1 Text2 Text3 Text4" ) ); + new ONamedListViewItem( item, QStringList::split( ' ', "SubText1 Text2 Text3 Text4" ) ); + item = new ONamedListViewItem( item, QStringList::split( ' ', "Text1 Text2 Text3 HereItComes" ) ); + item = new ONamedListViewItem( item, QStringList::split( ' ', "Text1 Text2 Text3 HereItComesSoon" ) ); + item = new ONamedListViewItem( item, QStringList::split( ' ', "Text1 Text2 Text3 Mickey" ) ); + + if ( lv->find( 3, "Mickey", 3 ) ) + odebug << "found Mickey :-)" << oendl; + else + odebug << "did not found Mickey :-(" << oendl; + + if ( lv->find( 3, "Minni", 0 ) ) + odebug << "found Minni :-)" << oendl; + else + odebug << "did not found Minni :-(" << oendl; + +} + +OListViewDemo::~OListViewDemo() +{ +} + 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 @@ +/* + This file is part of the Opie Project + + Copyright (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> + =. + .=l. + .>+-= + _;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU Library General Public +.="- .-=="i, .._ License as published by the Free Software + - . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -<s. This program is distributed in the hope that + + . -:. = it will be useful, but WITHOUT ANY WARRANTY; + : .. .:, . . . without even the implied warranty of + =_ + =;=|` MERCHANTABILITY or FITNESS FOR A + _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= = ; Library General Public License for more +++= -. .` .: details. + : = ...= . :.=- + -. .:....=;==+<; You should have received a copy of the GNU + -_. . . )=. = Library General Public License along with + -- :-=` this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + +*/ + +#ifndef OLISTVIEWDEMO_H +#define OLISTVIEWDEMO_H + +#include <qvbox.h> +#include <opie2/olistview.h> + +class OListViewDemo: public QVBox +{ + Q_OBJECT + + public: + OListViewDemo( QWidget* parent=0, const char* name=0, WFlags f=0 ); + virtual ~OListViewDemo(); + + private: + Opie::Ui::ONamedListView* lv; + +}; + +#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 @@ +TEMPLATE = app +CONFIG = qt warn_on +HEADERS = olistviewdemo.h +SOURCES = olistviewdemo.cpp \ + main.cpp +INCLUDEPATH += $(OPIEDIR)/include +DEPENDPATH += $(OPIEDIR)/include +LIBS += -lopieui2 -lopiecore2 -lqpe +TARGET = olistviewdemo +MOC_DIR = moc +OBJECTS_DIR = obj + + + + +!contains( platform, x11 ) { + include( $(OPIEDIR)/include.pro ) +} + +contains( platform, x11 ) { + LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib +} + |