summaryrefslogtreecommitdiff
path: root/examples/opieui/osplitter_example/osplitter_mail.cpp
blob: d747bd96aa2f2c87239b8e0ace1f15a97d50197a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81

#include <qstring.h>
#include <qlabel.h>
#include <qheader.h>
#include <qlayout.h>

#include <qpe/qpeapplication.h>

#include <opie2/oapplicationfactory.h>
#include "osplitter_mail.h"

using namespace Opie::Ui;

OPIE_EXPORT_APP( OApplicationFactory<ListViews> )

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("<br><br><b>Test Test  Test</b><br><br><p>Fooooo hjhh</p>");

    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;
}