summaryrefslogtreecommitdiff
path: root/examples/opieui
authordrw <drw>2005-06-15 22:39:20 (UTC)
committer drw <drw>2005-06-15 22:39:20 (UTC)
commite0205bac48b9d23af9feb48004c24fcf7a5e8200 (patch) (unidiff)
tree2faa077192fd0bfc4fc409f0513cc0e82113fa9e /examples/opieui
parentd2474c8e654d223b85b6200ce09fabd3a40af8e3 (diff)
downloadopie-e0205bac48b9d23af9feb48004c24fcf7a5e8200.zip
opie-e0205bac48b9d23af9feb48004c24fcf7a5e8200.tar.gz
opie-e0205bac48b9d23af9feb48004c24fcf7a5e8200.tar.bz2
Resource -> OResource
Diffstat (limited to 'examples/opieui') (more/less context) (ignore whitespace changes)
-rw-r--r--examples/opieui/config.in2
-rw-r--r--examples/opieui/owidgetstack_example/owidgetstack_example.cpp14
-rw-r--r--examples/opieui/owidgetstack_example/owidgetstack_example.pro2
3 files changed, 9 insertions, 9 deletions
diff --git a/examples/opieui/config.in b/examples/opieui/config.in
index f538430..cf5fd01 100644
--- a/examples/opieui/config.in
+++ b/examples/opieui/config.in
@@ -1,4 +1,4 @@
1 config EXAMPLE_LIBOPIE2UI 1 config EXAMPLE_LIBOPIE2UI
2 boolean "libopieui2 examples" 2 boolean "libopieui2 examples"
3 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2UI 3 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2UI && EXAMPLES
4 4
diff --git a/examples/opieui/owidgetstack_example/owidgetstack_example.cpp b/examples/opieui/owidgetstack_example/owidgetstack_example.cpp
index 272e42b..ded3b0c 100644
--- a/examples/opieui/owidgetstack_example/owidgetstack_example.cpp
+++ b/examples/opieui/owidgetstack_example/owidgetstack_example.cpp
@@ -1,26 +1,26 @@
1/* 1/*
2 * You may use, modify and distribute this example without any limitation 2 * You may use, modify and distribute this example without any limitation
3 */ 3 */
4 4
5#include "owidgetstack_example.h" 5#include "owidgetstack_example.h"
6 6
7/* OPIE */ 7/* OPIE */
8#include <opie2/oapplicationfactory.h> 8#include <opie2/oapplicationfactory.h>
9#include <opie2/owidgetstack.h> 9#include <opie2/owidgetstack.h>
10#include <qpe/resource.h> 10#include <opie2/oresource.h>
11 11
12/* QT */ 12/* QT */
13#include <qaction.h> 13#include <qaction.h>
14#include <qtoolbar.h> 14#include <qtoolbar.h>
15#include <qpopupmenu.h> 15#include <qpopupmenu.h>
16#include <qmenubar.h> 16#include <qmenubar.h>
17#include <qlayout.h> 17#include <qlayout.h>
18#include <qlabel.h> 18#include <qlabel.h>
19#include <qpushbutton.h> 19#include <qpushbutton.h>
20#include <qsignalmapper.h> 20#include <qsignalmapper.h>
21 21
22using namespace Opie::Core; 22using namespace Opie::Core;
23using namespace Opie::Ui; 23using namespace Opie::Ui;
24 24
25OPIE_EXPORT_APP( OApplicationFactory<StackExample> ) 25OPIE_EXPORT_APP( OApplicationFactory<StackExample> )
26 26
@@ -31,95 +31,95 @@ StackExample::StackExample( QWidget* parent, const char* name, WFlags fl )
31 setCentralWidget( m_stack ); 31 setCentralWidget( m_stack );
32 32
33 /* nice Signal Mapper ;) */ 33 /* nice Signal Mapper ;) */
34 QSignalMapper *sm = new QSignalMapper(this); 34 QSignalMapper *sm = new QSignalMapper(this);
35 connect(sm, SIGNAL(mapped(int) ), m_stack, SLOT(raiseWidget(int)) ); 35 connect(sm, SIGNAL(mapped(int) ), m_stack, SLOT(raiseWidget(int)) );
36 36
37 /* toolbar first but this should be known from the other examples */ 37 /* toolbar first but this should be known from the other examples */
38 setToolBarsMovable( false ); 38 setToolBarsMovable( false );
39 39
40 /* only a menubar here */ 40 /* only a menubar here */
41 QToolBar* holder = new QToolBar( this ); 41 QToolBar* holder = new QToolBar( this );
42 holder->setHorizontalStretchable( true ); 42 holder->setHorizontalStretchable( true );
43 43
44 QMenuBar *bar = new QMenuBar( holder ); 44 QMenuBar *bar = new QMenuBar( holder );
45 QPopupMenu *menu = new QPopupMenu( this ); 45 QPopupMenu *menu = new QPopupMenu( this );
46 46
47 QAction* a = new QAction( tr("Show MainWidget"), Resource::loadPixmap("zoom"), 47 QAction* a = new QAction( tr("Show MainWidget"), Opie::Core::OResource::loadPixmap("zoom", Opie::Core::OResource::SmallIcon),
48 QString::null, 0, this, 0 ); 48 QString::null, 0, this, 0 );
49 sm->setMapping(a, 1 ); 49 sm->setMapping(a, 1 );
50 connect(a, SIGNAL(activated() ), 50 connect(a, SIGNAL(activated() ),
51 sm, SLOT(map() ) ); 51 sm, SLOT(map() ) );
52 a->addTo( menu ); 52 a->addTo( menu );
53 53
54 a = new QAction( tr("Show Details Small"), Resource::loadPixmap("zoom"), 54 a = new QAction( tr("Show Details Small"), Opie::Core::OResource::loadPixmap("zoom", Opie::Core::OResource::SmallIcon),
55 QString::null, 0, this, 0 ); 55 QString::null, 0, this, 0 );
56 sm->setMapping(a, 2 ); 56 sm->setMapping(a, 2 );
57 connect(a, SIGNAL(activated() ), 57 connect(a, SIGNAL(activated() ),
58 sm, SLOT(map() ) ); 58 sm, SLOT(map() ) );
59 a->addTo( menu ); 59 a->addTo( menu );
60 60
61 a = new QAction( tr("Show Details More"), Resource::loadPixmap("zoom"), 61 a = new QAction( tr("Show Details More"), Opie::Core::OResource::loadPixmap("zoom", Opie::Core::OResource::SmallIcon),
62 QString::null, 0, this, 0 ); 62 QString::null, 0, this, 0 );
63 sm->setMapping(a, 3 ); 63 sm->setMapping(a, 3 );
64 connect(a, SIGNAL(activated() ), 64 connect(a, SIGNAL(activated() ),
65 sm, SLOT(map() ) ); 65 sm, SLOT(map() ) );
66 a->addTo( menu ); 66 a->addTo( menu );
67 67
68 a = new QAction( tr("Show Details All"), Resource::loadPixmap("zoom"), 68 a = new QAction( tr("Show Details All"), Opie::Core::OResource::loadPixmap("zoom", Opie::Core::OResource::SmallIcon),
69 QString::null, 0, this, 0 ); 69 QString::null, 0, this, 0 );
70 sm->setMapping(a, 4 ); 70 sm->setMapping(a, 4 );
71 connect(a, SIGNAL(activated() ), 71 connect(a, SIGNAL(activated() ),
72 sm, SLOT(map() ) ); 72 sm, SLOT(map() ) );
73 73
74 bar->insertItem( tr("Actions"), menu ); 74 bar->insertItem( tr("Actions"), menu );
75 75
76 /* now the gui */ 76 /* now the gui */
77 77
78 /* first widget, main widget */ 78 /* first widget, main widget */
79 QWidget * wid = new QWidget( m_stack ); 79 QWidget * wid = new QWidget( m_stack );
80 QGridLayout *grid = new QGridLayout(wid, 2, 2 ); 80 QGridLayout *grid = new QGridLayout(wid, 2, 2 );
81 81
82 QPushButton *btn = new QPushButton( tr("Show Details Small"), wid, "details1" ); 82 QPushButton *btn = new QPushButton( tr("Show Details Small"), wid, "details1" );
83 sm->setMapping(btn, 2 ); 83 sm->setMapping(btn, 2 );
84 connect(btn, SIGNAL(clicked()), sm, SLOT(map() ) ); 84 connect(btn, SIGNAL(clicked()), sm, SLOT(map() ) );
85 grid->addWidget( btn, 0, 0 ); 85 grid->addWidget( btn, 0, 0 );
86 86
87 btn = new QPushButton( tr("Show Details Medium"), wid, "details2"); 87 btn = new QPushButton( tr("Show Details Medium"), wid, "details2");
88 sm->setMapping(btn, 3 ); 88 sm->setMapping(btn, 3 );
89 connect(btn, SIGNAL(clicked()), sm, SLOT(map() ) ); 89 connect(btn, SIGNAL(clicked()), sm, SLOT(map() ) );
90 grid->addWidget( btn, 0, 1 ); 90 grid->addWidget( btn, 0, 1 );
91 91
92 btn = new QPushButton( tr("Show Details All"), wid, "details3"); 92 btn = new QPushButton( tr("Show Details All"), wid, "details3");
93 sm->setMapping(btn, 4 ); 93 sm->setMapping(btn, 4 );
94 connect(btn, SIGNAL(clicked()), sm, SLOT(map() ) ); 94 connect(btn, SIGNAL(clicked()), sm, SLOT(map() ) );
95 grid->addWidget( btn, 1, 1 ); 95 grid->addWidget( btn, 1, 1 );
96 96
97 m_stack->addWidget( wid, 1 ); 97 m_stack->addWidget( wid, 1 );
98 m_main = wid; 98 m_main = wid;
99 99
100 QLabel *lbl = new QLabel(m_stack ); 100 QLabel *lbl = new QLabel(m_stack );
101 lbl->setText(tr("Only small Details are shown here. Määh") ); 101 lbl->setText(tr("Only small Details are shown here. M�h") );
102 m_stack->addWidget( lbl, 2 ); 102 m_stack->addWidget( lbl, 2 );
103 103
104 lbl = new QLabel( m_stack ); 104 lbl = new QLabel( m_stack );
105 lbl->setText( tr("Some more details....Wo ist das Schaf?") ); 105 lbl->setText( tr("Some more details....Wo ist das Schaf?") );
106 m_stack->addWidget( lbl, 3 ); 106 m_stack->addWidget( lbl, 3 );
107 107
108 lbl = new QLabel( m_stack ); 108 lbl = new QLabel( m_stack );
109 lbl->setText( tr("<qt>Ne nicht in Bayerisch Gmain sondern in Berlin<br>Vermiss und meine Augen werden nicht eckig, da mein Bildschirm abgerundet ist<br>Es lebe Hamburg Süd,weiss du, verstehst du? ;)<br>Susi ist dOOf, es lebe die Ofenecke...", "hard to translate that") ); 109 lbl->setText( tr("<qt>Ne nicht in Bayerisch Gmain sondern in Berlin<br>Vermiss und meine Augen werden nicht eckig, da mein Bildschirm abgerundet ist<br>Es lebe Hamburg Sd,weiss du, verstehst du? ;)<br>Susi ist dOOf, es lebe die Ofenecke...", "hard to translate that") );
110 m_stack->addWidget( lbl, 4 ); 110 m_stack->addWidget( lbl, 4 );
111 111
112 112
113 /* THE signal mapper does all the magic */ 113 /* THE signal mapper does all the magic */
114 m_stack->raiseWidget( m_main ); 114 m_stack->raiseWidget( m_main );
115} 115}
116 116
117 117
118StackExample::~StackExample() { 118StackExample::~StackExample() {
119 119
120} 120}
121 121
122 122
123 123
124void StackExample::closeEvent( QCloseEvent* ev) { 124void StackExample::closeEvent( QCloseEvent* ev) {
125 /* if the close even came when we displayed a details */ 125 /* if the close even came when we displayed a details */
diff --git a/examples/opieui/owidgetstack_example/owidgetstack_example.pro b/examples/opieui/owidgetstack_example/owidgetstack_example.pro
index 4cfce9c..8960f03 100644
--- a/examples/opieui/owidgetstack_example/owidgetstack_example.pro
+++ b/examples/opieui/owidgetstack_example/owidgetstack_example.pro
@@ -1,13 +1,13 @@
1CONFIG += qt warn_on 1CONFIG += qt warn_on
2TEMPLATE = app 2TEMPLATE = app
3TARGET = owidgetstack-example 3TARGET = owidgetstack-example
4 4
5SOURCES = owidgetstack_example.cpp 5SOURCES = owidgetstack_example.cpp
6HEADERS = owidgetstack_example.h 6HEADERS = owidgetstack_example.h
7 7
8INCLUDEPATH += $(OPIEDIR)/include 8INCLUDEPATH += $(OPIEDIR)/include
9DEPENDSPATH += $(OPIEDIR)/include 9DEPENDSPATH += $(OPIEDIR)/include
10 10
11LIBS += -lqpe -lopieui2 11LIBS += -lqpe -lopiecore2 -lopieui2
12 12
13include( $(OPIEDIR)/include.pro ) 13include( $(OPIEDIR)/include.pro )