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/oversatileviewdemo/oversatileviewdemo.cpp | |
parent | 7b06e36fe27adc6a4fde2004eac13aaf8c0f0f02 (diff) | |
download | opie-555b999359a5aad999eaaf48632ce85f25125b85.zip opie-555b999359a5aad999eaaf48632ce85f25125b85.tar.gz opie-555b999359a5aad999eaaf48632ce85f25125b85.tar.bz2 |
examples appear here
Diffstat (limited to 'examples/opieui/oversatileviewdemo/oversatileviewdemo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | examples/opieui/oversatileviewdemo/oversatileviewdemo.cpp | 160 |
1 files changed, 160 insertions, 0 deletions
diff --git a/examples/opieui/oversatileviewdemo/oversatileviewdemo.cpp b/examples/opieui/oversatileviewdemo/oversatileviewdemo.cpp new file mode 100644 index 0000000..e8bbdb1 --- a/dev/null +++ b/examples/opieui/oversatileviewdemo/oversatileviewdemo.cpp @@ -0,0 +1,160 @@ +/* + 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 "oversatileviewdemo.h" +#include <opie2/oversatileview.h> +#include <opie2/oversatileviewitem.h> + +#include <qstring.h> +#include <qpixmap.h> +#include <qlistview.h> + +using namespace Opie::Ui; + +OVersatileViewDemo::OVersatileViewDemo( QWidget* parent, const char* name, WFlags f ) + :QVBox( parent, name, f ) +{ + vv = new OVersatileView( this ); + + vv->addColumn( "First" ); + vv->addColumn( "2nd" ); + vv->addColumn( "IIIrd" ); + + QString counter; + + QPixmap leaf( "leaf.png" ); + QPixmap opened( "folder_opened.png" ); + QPixmap closed( "folder_closed.png" ); + + QPixmap leaf32( "leaf32.png" ); + QPixmap opened32( "folder_opened32.png" ); + QPixmap closed32( "folder_closed32.png" ); + + vv->setDefaultPixmaps( OVersatileView::Tree, leaf, opened, closed ); + vv->setDefaultPixmaps( OVersatileView::Icons, leaf32, opened32, closed32 ); + + OVersatileViewItem* item; + OVersatileViewItem* item2; + + for ( int i = 0; i < 5; ++i ) + { + counter.sprintf( "%d", i ); + item = new OVersatileViewItem( vv, "Item", "Text", "Some more", counter ); + item->setRenameEnabled( true ); + item2 = new OVersatileViewItem( item, "OSubitem", "123", "...", counter ); + item2->setRenameEnabled( true ); + + } + + connect( vv, SIGNAL( selectionChanged() ), this, SLOT( selectionChanged() ) ); + connect( vv, SIGNAL( selectionChanged(OVersatileViewItem*) ), this, SLOT( selectionChanged(OVersatileViewItem*) ) ); + connect( vv, SIGNAL( currentChanged(OVersatileViewItem*) ), this, SLOT( currentChanged(OVersatileViewItem*) ) ); + connect( vv, SIGNAL( clicked(OVersatileViewItem*) ), this, SLOT( clicked(OVersatileViewItem*) ) ); + connect( vv, SIGNAL( pressed(OVersatileViewItem*) ), this, SLOT( pressed(OVersatileViewItem*) ) ); + + connect( vv, SIGNAL( doubleClicked(OVersatileViewItem*) ), this, SLOT( doubleClicked(OVersatileViewItem*) ) ); + connect( vv, SIGNAL( returnPressed(OVersatileViewItem*) ), this, SLOT( returnPressed(OVersatileViewItem*) ) ); + + connect( vv, SIGNAL( onItem(OVersatileViewItem*) ), this, SLOT( onItem(OVersatileViewItem*) ) ); + connect( vv, SIGNAL( onViewport() ), this, SLOT( onViewport() ) ); + + connect( vv, SIGNAL( expanded(OVersatileViewItem*) ), this, SLOT( expanded(OVersatileViewItem*) ) ); + connect( vv, SIGNAL( collapsed(OVersatileViewItem*) ), this, SLOT( collapsed(OVersatileViewItem*) ) ); + + connect( vv, SIGNAL( moved() ), this, SLOT( moved() ) ); + + connect( vv, SIGNAL( contextMenuRequested(OVersatileViewItem*,const QPoint&,int) ), this, SLOT( contextMenuRequested(OVersatileViewItem*,const QPoint&,int) ) ); + +} + +OVersatileViewDemo::~OVersatileViewDemo() +{ +} + +void OVersatileViewDemo::selectionChanged() +{ + odebug << "received signal selectionChanged()" << oendl; +} +void OVersatileViewDemo::selectionChanged( OVersatileViewItem * item ) +{ + odebug << "received signal selectionChanged(OVersatileViewItem*)" << oendl; +} +void OVersatileViewDemo::currentChanged( OVersatileViewItem * item ) +{ + odebug << "received signal currentChanged( OVersatileViewItem * )" << oendl; +} +void OVersatileViewDemo::clicked( OVersatileViewItem * item ) +{ + odebug << "received signal clicked( OVersatileViewItem * )" << oendl; +} +void OVersatileViewDemo::pressed( OVersatileViewItem * item ) +{ + odebug << "received signal pressed( OVersatileViewItem * )" << oendl; +} + +void OVersatileViewDemo::doubleClicked( OVersatileViewItem *item ) +{ + odebug << "received signal doubleClicked( OVersatileViewItem *item )" << oendl; +} +void OVersatileViewDemo::returnPressed( OVersatileViewItem *item ) +{ + odebug << "received signal returnPressed( OVersatileViewItem *item )" << oendl; +} + +void OVersatileViewDemo::onItem( OVersatileViewItem *item ) +{ + odebug << "received signal onItem( OVersatileViewItem *item )" << oendl; +} +void OVersatileViewDemo::onViewport() +{ + odebug << "received signal onViewport()" << oendl; +} + +void OVersatileViewDemo::expanded( OVersatileViewItem *item ) +{ + odebug << "received signal expanded( OVersatileViewItem *item )" << oendl; +} + +void OVersatileViewDemo::collapsed( OVersatileViewItem *item ) +{ + odebug << "received signal collapsed( OVersatileViewItem *item )" << oendl; +} + +void OVersatileViewDemo::moved() +{ + odebug << "received signal moved( OVersatileViewItem *item )" << oendl; +} + +void OVersatileViewDemo::contextMenuRequested( OVersatileViewItem *item, const QPoint& pos, int col ) +{ + odebug << "received signal contextMenuRequested( OVersatileViewItem *item )" << oendl; +} |