author | alwin <alwin> | 2004-04-07 11:10:21 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-04-07 11:10:21 (UTC) |
commit | 6095b1f70bcac407208e7473598f2bbf53339810 (patch) (unidiff) | |
tree | e76d8ad85b79de56a7aa7dd95c824da485901c6f /noncore/graphics/opie-eye/gui/imageview.cpp | |
parent | 364971c08f3d761102daab01889b9fab394f8f08 (diff) | |
download | opie-6095b1f70bcac407208e7473598f2bbf53339810.zip opie-6095b1f70bcac407208e7473598f2bbf53339810.tar.gz opie-6095b1f70bcac407208e7473598f2bbf53339810.tar.bz2 |
the ImageScrollView wrapped with another class where just the
opie-eye specifics are implemented. So we can move that into the
MM lib and use it in other programs.
Diffstat (limited to 'noncore/graphics/opie-eye/gui/imageview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/gui/imageview.cpp | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/noncore/graphics/opie-eye/gui/imageview.cpp b/noncore/graphics/opie-eye/gui/imageview.cpp new file mode 100644 index 0000000..8fc258e --- a/dev/null +++ b/noncore/graphics/opie-eye/gui/imageview.cpp | |||
@@ -0,0 +1,55 @@ | |||
1 | #include "imageview.h" | ||
2 | |||
3 | #include <opie2/odebug.h> | ||
4 | #include <opie2/oconfig.h> | ||
5 | #include <opie2/okeyconfigwidget.h> | ||
6 | |||
7 | #include <qpe/resource.h> | ||
8 | |||
9 | using namespace Opie::Core; | ||
10 | |||
11 | ImageView::ImageView( QWidget* parent, const char* name, WFlags fl ) | ||
12 | : ImageScrollView(parent,name,fl) | ||
13 | { | ||
14 | m_viewManager = 0; | ||
15 | initKeys(); | ||
16 | } | ||
17 | |||
18 | ImageView::~ImageView() | ||
19 | { | ||
20 | } | ||
21 | |||
22 | Opie::Ui::OKeyConfigManager* ImageView::manager() | ||
23 | { | ||
24 | if (!m_viewManager) { | ||
25 | initKeys(); | ||
26 | } | ||
27 | return m_viewManager; | ||
28 | } | ||
29 | |||
30 | void ImageView::initKeys() | ||
31 | { | ||
32 | odebug << "init imageview keys" << oendl; | ||
33 | m_cfg = new Opie::Core::OConfig("phunkview"); | ||
34 | m_cfg->setGroup("Zecke_view" ); | ||
35 | Opie::Ui::OKeyPair::List lst; | ||
36 | lst.append( Opie::Ui::OKeyPair::upArrowKey() ); | ||
37 | lst.append( Opie::Ui::OKeyPair::downArrowKey() ); | ||
38 | lst.append( Opie::Ui::OKeyPair::leftArrowKey() ); | ||
39 | lst.append( Opie::Ui::OKeyPair::rightArrowKey() ); | ||
40 | lst.append( Opie::Ui::OKeyPair::returnKey() ); | ||
41 | |||
42 | m_viewManager = new Opie::Ui::OKeyConfigManager(m_cfg, "Imageview-KeyBoard-Config", | ||
43 | lst, false,this, "keyconfig name" ); | ||
44 | m_viewManager->addKeyConfig( Opie::Ui::OKeyConfigItem(tr("View Image Info"), "view", | ||
45 | Resource::loadPixmap("1to1"), ViewInfo, | ||
46 | Opie::Ui::OKeyPair(Qt::Key_I,Qt::ShiftButton), | ||
47 | this, SLOT(slotShowImageInfo()))); | ||
48 | m_viewManager->load(); | ||
49 | m_viewManager->handleWidget( this ); | ||
50 | } | ||
51 | |||
52 | void ImageView::slotShowImageInfo() | ||
53 | { | ||
54 | emit dispImageInfo(m_lastName); | ||
55 | } | ||