-rw-r--r-- | noncore/apps/oxygen/oxyframe.cpp | 10 | ||||
-rw-r--r-- | noncore/apps/oxygen/oxyframe.h | 6 | ||||
-rw-r--r-- | noncore/apps/oxygen/psewidget.cpp | 2 |
3 files changed, 13 insertions, 5 deletions
diff --git a/noncore/apps/oxygen/oxyframe.cpp b/noncore/apps/oxygen/oxyframe.cpp index c61c8e5..2ce40e7 100644 --- a/noncore/apps/oxygen/oxyframe.cpp +++ b/noncore/apps/oxygen/oxyframe.cpp | |||
@@ -6,28 +6,36 @@ | |||
6 | email : cniehaus@handhelds.org | 6 | email : cniehaus@handhelds.org |
7 | **************************************************************************/ | 7 | **************************************************************************/ |
8 | 8 | ||
9 | /*************************************************************************** | 9 | /*************************************************************************** |
10 | * * | 10 | * * |
11 | * This program is free software; you can redistribute it and/or modify * | 11 | * This program is free software; you can redistribute it and/or modify * |
12 | * it under the terms of the GNU General Public License as published by * | 12 | * it under the terms of the GNU General Public License as published by * |
13 | * the Free Software Foundation; either version 2 of the License, or * | 13 | * the Free Software Foundation; either version 2 of the License, or * |
14 | * ( at your option ) any later version. * | 14 | * ( at your option ) any later version. * |
15 | * * | 15 | * * |
16 | **************************************************************************/ | 16 | **************************************************************************/ |
17 | #include "oxygen.h" | 17 | #include "oxygen.h" |
18 | 18 | ||
19 | #include <qpe/config.h> | 19 | #include <qpe/config.h> |
20 | #include "oxyframe.h" | 20 | #include "oxyframe.h" |
21 | 21 | ||
22 | OxyFrame::OxyFrame(QWidget *parent, const char *name) : QFrame(parent,name) | 22 | OxyFrame::OxyFrame(QWidget *parent, const char *name, QString symbol ) |
23 | : QLabel(parent,name) | ||
23 | { | 24 | { |
24 | N = name; | 25 | N = name; |
25 | this->setFrameStyle( QFrame::Box ); | 26 | this->setFrameStyle( QFrame::Box ); |
26 | this->setLineWidth( 0 ); | 27 | this->setLineWidth( 0 ); |
27 | this->setMidLineWidth( 1 ); | 28 | this->setMidLineWidth( 1 ); |
28 | this->setFrameShadow( QFrame::Sunken ); | 29 | this->setFrameShadow( QFrame::Sunken ); |
30 | setMinimumSize(6,6); | ||
31 | setScaledContents( true ); | ||
32 | QFont font; | ||
33 | font.setWeight(QFont::Light); | ||
34 | font.setPixelSize(3); | ||
35 | setFont( font ); | ||
36 | setText( symbol ); | ||
29 | } | 37 | } |
30 | 38 | ||
31 | void OxyFrame::mousePressEvent ( QMouseEvent * e ){ | 39 | void OxyFrame::mousePressEvent ( QMouseEvent * e ){ |
32 | emit num( N ); | 40 | emit num( N ); |
33 | }; | 41 | }; |
diff --git a/noncore/apps/oxygen/oxyframe.h b/noncore/apps/oxygen/oxyframe.h index 4543504..9736ea9 100644 --- a/noncore/apps/oxygen/oxyframe.h +++ b/noncore/apps/oxygen/oxyframe.h | |||
@@ -5,37 +5,37 @@ | |||
5 | copyright : ( C ) 2002 by Carsten Niehaus | 5 | copyright : ( C ) 2002 by Carsten Niehaus |
6 | email : cniehaus@handhelds.org | 6 | email : cniehaus@handhelds.org |
7 | **************************************************************************/ | 7 | **************************************************************************/ |
8 | 8 | ||
9 | /*************************************************************************** | 9 | /*************************************************************************** |
10 | * * | 10 | * * |
11 | * This program is free software; you can redistribute it and/or modify * | 11 | * This program is free software; you can redistribute it and/or modify * |
12 | * it under the terms of the GNU General Public License as published by * | 12 | * it under the terms of the GNU General Public License as published by * |
13 | * the Free Software Foundation; either version 2 of the License, or * | 13 | * the Free Software Foundation; either version 2 of the License, or * |
14 | * ( at your option ) any later version. * | 14 | * ( at your option ) any later version. * |
15 | * * | 15 | * * |
16 | **************************************************************************/ | 16 | **************************************************************************/ |
17 | #ifndef _OXYFRAME_H | 17 | #ifndef _OXYFRAME_H |
18 | #define _OXYFRAME_H | 18 | #define _OXYFRAME_H |
19 | 19 | ||
20 | 20 | ||
21 | #include <qframe.h> | 21 | #include <qlabel.h> |
22 | 22 | ||
23 | class OxyFrame : public QFrame | 23 | class OxyFrame : public QLabel |
24 | { | 24 | { |
25 | Q_OBJECT | 25 | Q_OBJECT |
26 | 26 | ||
27 | public: | 27 | public: |
28 | OxyFrame( QWidget *parent=0, const char *name=0); | 28 | OxyFrame( QWidget *parent=0, const char *name=0, QString symbol="" ); |
29 | 29 | ||
30 | void mousePressEvent( QMouseEvent *); | 30 | void mousePressEvent( QMouseEvent *); |
31 | 31 | ||
32 | QString N; | 32 | QString N; |
33 | 33 | ||
34 | signals: | 34 | signals: |
35 | /* | 35 | /* |
36 | * this signal emits the name ( the elemen-number ) | 36 | * this signal emits the name ( the elemen-number ) |
37 | */ | 37 | */ |
38 | void num(QString); | 38 | void num(QString); |
39 | }; | 39 | }; |
40 | 40 | ||
41 | #endif | 41 | #endif |
diff --git a/noncore/apps/oxygen/psewidget.cpp b/noncore/apps/oxygen/psewidget.cpp index 18b41c3..d742e9c 100644 --- a/noncore/apps/oxygen/psewidget.cpp +++ b/noncore/apps/oxygen/psewidget.cpp | |||
@@ -27,33 +27,33 @@ | |||
27 | PSEWidget::PSEWidget() : QWidget() | 27 | PSEWidget::PSEWidget() : QWidget() |
28 | { | 28 | { |
29 | this->setCaption( tr( "Periodic System" ) ); | 29 | this->setCaption( tr( "Periodic System" ) ); |
30 | 30 | ||
31 | QVBoxLayout *vlay = new QVBoxLayout( this ); | 31 | QVBoxLayout *vlay = new QVBoxLayout( this ); |
32 | 32 | ||
33 | QGridLayout *grid = new QGridLayout( 18,10 ); | 33 | QGridLayout *grid = new QGridLayout( 18,10 ); |
34 | int h=0, v=0; | 34 | int h=0, v=0; |
35 | 35 | ||
36 | Config configobj( QPEApplication::qpeDir() +"share/oxygen/oxygendata", Config::File ); | 36 | Config configobj( QPEApplication::qpeDir() +"share/oxygen/oxygendata", Config::File ); |
37 | for( int n = 0 ; n < 118 ; n++ ) | 37 | for( int n = 0 ; n < 118 ; n++ ) |
38 | { | 38 | { |
39 | configobj.setGroup( QString::number( n+1 )); | 39 | configobj.setGroup( QString::number( n+1 )); |
40 | 40 | ||
41 | position( n+1,h,v ); | 41 | position( n+1,h,v ); |
42 | QList<OxyFrame> PSEframe; | 42 | QList<OxyFrame> PSEframe; |
43 | PSEframe.append( new OxyFrame( this , QString::number(n) ) ); | 43 | PSEframe.append( new OxyFrame( this , QString::number(n), configobj.readEntry( "Symbol" ) ) ); |
44 | grid->addWidget( PSEframe.current() , v/40+1 , h/40 ); | 44 | grid->addWidget( PSEframe.current() , v/40+1 , h/40 ); |
45 | PSEframe.current()->setMinimumHeight( 11 ); | 45 | PSEframe.current()->setMinimumHeight( 11 ); |
46 | PSEframe.current()->setPalette( QPalette( PSEColor( configobj.readEntry( "Block" ) ) ) ); | 46 | PSEframe.current()->setPalette( QPalette( PSEColor( configobj.readEntry( "Block" ) ) ) ); |
47 | connect( PSEframe.current(), SIGNAL( num(QString) ), this, SLOT( slotShowElement(QString) )); | 47 | connect( PSEframe.current(), SIGNAL( num(QString) ), this, SLOT( slotShowElement(QString) )); |
48 | } | 48 | } |
49 | 49 | ||
50 | oxyDW = new OxydataWidget(this); | 50 | oxyDW = new OxydataWidget(this); |
51 | oxyDW->setElement( 0 ); | 51 | oxyDW->setElement( 0 ); |
52 | oxyDW->setLayout(); | 52 | oxyDW->setLayout(); |
53 | 53 | ||
54 | vlay->addLayout( grid ); | 54 | vlay->addLayout( grid ); |
55 | vlay->addWidget( oxyDW ); | 55 | vlay->addWidget( oxyDW ); |
56 | } | 56 | } |
57 | 57 | ||
58 | QColor PSEWidget::PSEColor( QString block ) | 58 | QColor PSEWidget::PSEColor( QString block ) |
59 | { | 59 | { |