Diffstat (limited to 'libopie/big-screen/example/osplitter_mail.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie/big-screen/example/osplitter_mail.cpp | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/libopie/big-screen/example/osplitter_mail.cpp b/libopie/big-screen/example/osplitter_mail.cpp new file mode 100644 index 0000000..91442c8 --- a/dev/null +++ b/libopie/big-screen/example/osplitter_mail.cpp | |||
@@ -0,0 +1,70 @@ | |||
1 | |||
2 | #include <qstring.h> | ||
3 | #include <qlabel.h> | ||
4 | #include <qheader.h> | ||
5 | #include <qlayout.h> | ||
6 | |||
7 | #include <qpe/qpeapplication.h> | ||
8 | #include <opie/oapplicationfactory.h> | ||
9 | |||
10 | #include "../osplitter.h" | ||
11 | |||
12 | #include "osplitter_mail.h" | ||
13 | |||
14 | |||
15 | OPIE_EXPORT_APP( OApplicationFactory<ListViews> ) | ||
16 | |||
17 | class Folder { | ||
18 | int dummy; | ||
19 | }; | ||
20 | |||
21 | // ----------------------------------------------------------------- | ||
22 | |||
23 | ListViews::ListViews( QWidget* p, const char* name, WFlags fl ) | ||
24 | : QWidget( p, name, fl ) { | ||
25 | m_lstFolders.setAutoDelete( true ); | ||
26 | QHBoxLayout *lay = new QHBoxLayout(this); | ||
27 | |||
28 | m_splitter = new OSplitter( Horizontal, this, "SPlitter 1" ); | ||
29 | lay->addWidget( m_splitter ); | ||
30 | connect(m_splitter, SIGNAL(sizeChange(bool, const QSize& ) ), | ||
31 | this, SLOT(slotSizeChange(bool, const QSize& ) ) ); | ||
32 | |||
33 | m_overview = new QListView( m_splitter ); | ||
34 | m_overview->header()->setClickEnabled( FALSE ); | ||
35 | m_overview->addColumn( tr("Folder") ); | ||
36 | m_overview->setMaximumWidth( 200 ); | ||
37 | m_splitter->addWidget( m_overview, "zoom", tr("Folder Overview") ); | ||
38 | m_splitter->setSizeChange( 300 ); | ||
39 | |||
40 | /* OSplitter starts with the small mode */ | ||
41 | m_messages = 0; | ||
42 | m_message = m_attach = 0; | ||
43 | |||
44 | splitti = new OSplitter( Vertical, m_splitter, "Splitti2" ); | ||
45 | splitti->setSizeChange( 300 ); | ||
46 | splitti->setSizePolicy( QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding ) ); | ||
47 | |||
48 | QLabel *lbl = new QLabel(splitti); | ||
49 | lbl->setTextFormat ( Qt::RichText ); | ||
50 | lbl->setText("<br><br><b>Test Test Test</b><br><br><p>Fooooo hjhh</p>"); | ||
51 | |||
52 | m_messages = new QListView( splitti ); | ||
53 | m_messages->addColumn(" Messages "); | ||
54 | |||
55 | folder1 = new QListView( splitti ); | ||
56 | folder1->addColumn( "Messages 2 " ); | ||
57 | |||
58 | splitti->addWidget(m_messages, "mail", tr("Mails") ); | ||
59 | splitti->addWidget(folder1, "folder", tr("Folder") ); | ||
60 | splitti->addWidget( lbl, "logo", tr("Label") ); | ||
61 | m_message = lbl; | ||
62 | |||
63 | m_splitter->addWidget( splitti ); | ||
64 | |||
65 | } | ||
66 | |||
67 | |||
68 | ListViews::~ListViews() { | ||
69 | |||
70 | } | ||