From 555b999359a5aad999eaaf48632ce85f25125b85 Mon Sep 17 00:00:00 2001 From: mickeyl Date: Sat, 29 Jan 2005 14:18:51 +0000 Subject: examples appear here --- (limited to 'examples/opieui/osplitter_example') diff --git a/examples/opieui/osplitter_example/osplitter_example.cpp b/examples/opieui/osplitter_example/osplitter_example.cpp new file mode 100644 index 0000000..07c7e51 --- a/dev/null +++ b/examples/opieui/osplitter_example/osplitter_example.cpp @@ -0,0 +1,34 @@ +#include "osplitter_example.h" + +/* OPIE */ + +#include +#include +#include +#include + +/* QT*/ +#include +#include + +using namespace Opie::Ui; +using namespace Opie::Core; + +OPIE_EXPORT_APP( OApplicationFactory ) + +OSplitterExample::OSplitterExample( QWidget *w,const char* n,WFlags f ) + : QWidget( w, n, f ){ + QVBoxLayout * lay = new QVBoxLayout(this); + OSplitter * splitter = new OSplitter( Horizontal, this ); + lay->addWidget( splitter ); + + OFileSelector *selector = new OFileSelector( splitter, OFileSelector::FileSelector, + OFileSelector::Normal, QDir::homeDirPath(), + QString::null ); + splitter->addWidget( selector, "zoom", tr("Selector 1") ); + + selector = new OFileSelector( splitter, OFileSelector::FileSelector, OFileSelector::Normal, + QDir::homeDirPath(), QString::null ); + splitter->addWidget( selector, "zoom", tr("Selector 2") ); + +} diff --git a/examples/opieui/osplitter_example/osplitter_example.h b/examples/opieui/osplitter_example/osplitter_example.h new file mode 100644 index 0000000..0cf28aa --- a/dev/null +++ b/examples/opieui/osplitter_example/osplitter_example.h @@ -0,0 +1,19 @@ +/* + * May be used, copied and modified wihtout any limitation + */ + +#ifndef OSPlitter_EXAMPLE_H +#define OSPlitter_EXAMPLE_H + +#include + +class OSplitterExample : public QWidget { + Q_OBJECT +public: + static QString appName() { return QString::fromLatin1("osplitter_example"); } + OSplitterExample( QWidget *parent, const char* name, WFlags fl ); + +}; + + +#endif diff --git a/examples/opieui/osplitter_example/osplitter_example.pro b/examples/opieui/osplitter_example/osplitter_example.pro new file mode 100644 index 0000000..9f156a1 --- a/dev/null +++ b/examples/opieui/osplitter_example/osplitter_example.pro @@ -0,0 +1,13 @@ +CONFIG = qt warn_on +TEMPLATE = app +TARGET = osplitter_example + +HEADERS = osplitter_example.h +SOURCES = osplitter_example.cpp + +INCLUDEPATH += $(OPIEDIR)/include +DEPENDSPATH += $(OPIEDIR)/include + +LIBS += -lqpe -lopieui2 + +include( $(OPIEDIR)/include.pro ) diff --git a/examples/opieui/osplitter_example/osplitter_mail.cpp b/examples/opieui/osplitter_example/osplitter_mail.cpp new file mode 100644 index 0000000..d747bd9 --- a/dev/null +++ b/examples/opieui/osplitter_example/osplitter_mail.cpp @@ -0,0 +1,81 @@ + +#include +#include +#include +#include + +#include + +#include +#include "osplitter_mail.h" + +using namespace Opie::Ui; + +OPIE_EXPORT_APP( OApplicationFactory ) + +class Folder { + int dummy; +}; + +// ----------------------------------------------------------------- + +ListViews::ListViews( QWidget* p, const char* name, WFlags fl ) + : QWidget( p, name, fl ) { + qApp->installEventFilter( this ); + m_lstFolders.setAutoDelete( true ); + QHBoxLayout *lay = new QHBoxLayout(this); + + m_splitter = new OSplitter( Horizontal, this, "SPlitter 1" ); + lay->addWidget( m_splitter ); + connect(m_splitter, SIGNAL(sizeChanged(bool,Orientation) ), + this, SLOT(slotSizeChange(bool,Orientation) ) ); + + m_overview = new QListView( m_splitter ); + m_overview->header()->setClickEnabled( FALSE ); + m_overview->addColumn( tr("Folder") ); +// m_overview->setMaximumWidth( 200 ); + m_splitter->addWidget( m_overview, "zoom", tr("Folder Overview") ); + m_splitter->setSizeChange( 300 ); + + /* OSplitter starts with the small mode */ + m_messages = 0; + m_message = m_attach = 0; + + splitti = new OSplitter( Vertical, m_splitter, "Splitti2" ); + splitti->setSizeChange( 300 ); + splitti->setSizePolicy( QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding ) ); + + QLabel *lbl = new QLabel(splitti); + lbl->setTextFormat ( Qt::RichText ); + lbl->setText("

Test Test Test

Fooooo hjhh

"); + + m_messages = new QListView( splitti ); + m_messages->addColumn(" Messages "); + + folder1 = new QListView( splitti ); + folder1->addColumn( "Messages 2 " ); + + splitti->addWidget(m_messages, "mail", tr("Mails") ); + splitti->addWidget(folder1, "folder", tr("Folder") ); + splitti->addWidget( lbl, "logo", tr("Label") ); + m_message = lbl; + + m_splitter->addWidget( splitti ); + +} + + +ListViews::~ListViews() { + +} + + +bool ListViews::eventFilter( QObject* obj, QEvent* ev ) { + if (!obj->isWidgetType() ) + return false; + if ( ev->type() == QEvent::MouseButtonRelease ) { + owarn << " name " << obj->name() << ", class " << obj->className() << "" << oendl; + } + + return false; +} diff --git a/examples/opieui/osplitter_example/osplitter_mail.h b/examples/opieui/osplitter_example/osplitter_mail.h new file mode 100644 index 0000000..67961fb --- a/dev/null +++ b/examples/opieui/osplitter_example/osplitter_mail.h @@ -0,0 +1,51 @@ +/* + * You may use, modify and distribute this code without any limitation + */ + +/* + * Header file for a more complete email client like + * layout + */ + +#ifndef OPIE_SPLITTER_MAIL_EXAMPLE_H +#define OPIE_SPLITTER_MAIL_EXAMPLE_H + +#include +#include +#include + +#include + + +class Folder; +class QLabel; + +class ListViews : public QWidget { + Q_OBJECT +public: + static QString appName() { return QString::fromLatin1("osplitter-mail"); } + ListViews( QWidget* parent, const char * name, WFlags fl ); + ~ListViews(); + + bool eventFilter( QObject* , QEvent* ); +private: + void initFolders(); + void initFolder( Folder *folder, unsigned int &count ); + + QListView *m_messages, *m_overview; + QLabel *m_message, *m_attach; + QList m_folders; // used in tab mode + QList m_lstFolders; + bool m_mode : 1; // bitfield + Opie::Ui::OSplitter *m_splitter; + Opie::Ui::OSplitter *splitti; + QListView *folder1; +#if 0 +//private slots: +// void slotFolderChanged( QListViewItem* ); +// void slotMessageChanged(); +// void slotSizeChange( bool, const QSize& ); +#endif +}; + +#endif diff --git a/examples/opieui/osplitter_example/osplitter_mail.pro b/examples/opieui/osplitter_example/osplitter_mail.pro new file mode 100644 index 0000000..f9c43ef --- a/dev/null +++ b/examples/opieui/osplitter_example/osplitter_mail.pro @@ -0,0 +1,12 @@ +CONFIG += qt warn_on +TEMPLATE = app +TARGET = osplitter-mail + +INCLUDEPATH += $(OPIEDIR)/include +DEPENDSPATH += $(OPIEDIR)/include + +HEADERS = osplitter_mail.h +SOURCES = osplitter_mail.cpp + +LIBS += -lqpe -lopieui2 +include( $(OPIEDIR)/include.pro ) -- cgit v0.9.0.2