summaryrefslogtreecommitdiff
authorcniehaus <cniehaus>2002-09-19 13:54:25 (UTC)
committer cniehaus <cniehaus>2002-09-19 13:54:25 (UTC)
commit477a620e5745bd30222fe72d9c9b842785c285ab (patch) (unidiff)
treed458aefeacb29d2d863db693349328a0a29e8bb4
parent71af43c57ea311efbd1cc9b9b18996718a48b3a1 (diff)
downloadopie-477a620e5745bd30222fe72d9c9b842785c285ab.zip
opie-477a620e5745bd30222fe72d9c9b842785c285ab.tar.gz
opie-477a620e5745bd30222fe72d9c9b842785c285ab.tar.bz2
will continue in some hours... The new class Element should work now. Data
storage is still lacking
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/oxygen/dataTable.h9
-rw-r--r--noncore/apps/oxygen/psewidget.cpp10
-rw-r--r--noncore/apps/oxygen/psewidget.h47
3 files changed, 66 insertions, 0 deletions
diff --git a/noncore/apps/oxygen/dataTable.h b/noncore/apps/oxygen/dataTable.h
index 624e8bd..bdcaa99 100644
--- a/noncore/apps/oxygen/dataTable.h
+++ b/noncore/apps/oxygen/dataTable.h
@@ -1,61 +1,70 @@
1 1
2/*************************************************************************** 2/***************************************************************************
3 * * 3 * *
4 * This program is free software; you can redistribute it and/or modify * 4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by * 5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or * 6 * the Free Software Foundation; either version 2 of the License, or *
7 * ( at your option ) any later version. * 7 * ( at your option ) any later version. *
8 * * 8 * *
9 **************************************************************************/ 9 **************************************************************************/
10 10
11#ifndef _DATATABLE_H 11#ifndef _DATATABLE_H
12#define _DATATABLE_H 12#define _DATATABLE_H
13 13
14#include <qwidget.h> 14#include <qwidget.h>
15#include <qtable.h> 15#include <qtable.h>
16 16
17class QLabel; 17class QLabel;
18class OxydataTable; 18class OxydataTable;
19 19
20/*
21 * A OxydataWidget shows all known data of an element. It can
22 * be used for both the PSE and the pure Data-Dialog. It is
23 * a simple QHBox with 2 QStrings in it plus a OxydataTable
24 * which contains the rest of the data.
25 *
26 * Author: Carsten Niehaus <cniehaus@handhelds.org>
27 */
28
20class OxydataWidget : public QWidget 29class OxydataWidget : public QWidget
21{ 30{
22 Q_OBJECT 31 Q_OBJECT
23 32
24 public: 33 public:
25 OxydataWidget(QWidget *parent=0); 34 OxydataWidget(QWidget *parent=0);
26 35
27 QLabel *left, *middle, *right; 36 QLabel *left, *middle, *right;
28 37
29 private: 38 private:
30 OxydataTable *DataTable; 39 OxydataTable *DataTable;
31 void setTable(); 40 void setTable();
32 41
33 public slots: 42 public slots:
34 void setElement( int ); 43 void setElement( int );
35}; 44};
36 45
37/* 46/*
38 * A OxydataTable is derived from QTable. I recoded the paintCell to have 47 * A OxydataTable is derived from QTable. I recoded the paintCell to have
39 * different colors in the backgound. Furthermore this widget never has a 48 * different colors in the backgound. Furthermore this widget never has a
40 * grid, thus I removed that code in paintCell. 49 * grid, thus I removed that code in paintCell.
41 * 50 *
42 * Author: Carsten Niehaus <cniehaus@handhelds.org> 51 * Author: Carsten Niehaus <cniehaus@handhelds.org>
43 */ 52 */
44 53
45class OxydataTable : public QTable 54class OxydataTable : public QTable
46{ 55{
47 Q_OBJECT 56 Q_OBJECT
48 57
49 public: 58 public:
50 OxydataTable( int numRows, int numCols, 59 OxydataTable( int numRows, int numCols,
51 QWidget *parent = 0, const char *name = 0 ); 60 QWidget *parent = 0, const char *name = 0 );
52 61
53 protected: 62 protected:
54 /* 63 /*
55 * This method is reimplemented form QTable. It implements the colourisation 64 * This method is reimplemented form QTable. It implements the colourisation
56 * of every second row. 65 * of every second row.
57 */ 66 */
58 virtual void paintCell( QPainter *p, int row, int col, const QRect &cr, bool selected ); 67 virtual void paintCell( QPainter *p, int row, int col, const QRect &cr, bool selected );
59}; 68};
60 69
61#endif 70#endif
diff --git a/noncore/apps/oxygen/psewidget.cpp b/noncore/apps/oxygen/psewidget.cpp
index cf55635..4e002d1 100644
--- a/noncore/apps/oxygen/psewidget.cpp
+++ b/noncore/apps/oxygen/psewidget.cpp
@@ -1,19 +1,29 @@
1/*************************************************************************** 1/***************************************************************************
2 * * 2 * *
3 * This program is free software; you can redistribute it and/or modify * 3 * This program is free software; you can redistribute it and/or modify *
4 * it under the terms of the GNU General Public License as published by * 4 * it under the terms of the GNU General Public License as published by *
5 * the Free Software Foundation; either version 2 of the License, or * 5 * the Free Software Foundation; either version 2 of the License, or *
6 * ( at your option ) any later version. * 6 * ( at your option ) any later version. *
7 * * 7 * *
8 **************************************************************************/ 8 **************************************************************************/
9 9
10#include <qpe/config.h> 10#include <qpe/config.h>
11#include <qlayout.h> 11#include <qlayout.h>
12#include <qlist.h>
12#include "psewidget.h" 13#include "psewidget.h"
13#include "oxyframe.h" 14#include "oxyframe.h"
14 15
16
17Element::Element( const QString &name )
18{
19}
20
15PSEWidget::PSEWidget() : QWidget() 21PSEWidget::PSEWidget() : QWidget()
16{ 22{
23 QList<Element> elements;
24 elements.setAutoDelete( TRUE );
25 elements.append( new Element( "1" ) );
26
17 maingrid = new QGridLayout( 18 , 10 , -1 , "maingridlayout" ); 27 maingrid = new QGridLayout( 18 , 10 , -1 , "maingridlayout" );
18 OxyFrame *configobj = new OxyFrame(this); 28 OxyFrame *configobj = new OxyFrame(this);
19} 29}
diff --git a/noncore/apps/oxygen/psewidget.h b/noncore/apps/oxygen/psewidget.h
index a0ab701..9f574ce 100644
--- a/noncore/apps/oxygen/psewidget.h
+++ b/noncore/apps/oxygen/psewidget.h
@@ -1,29 +1,76 @@
1 1
2/*************************************************************************** 2/***************************************************************************
3 * * 3 * *
4 * This program is free software; you can redistribute it and/or modify * 4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by * 5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or * 6 * the Free Software Foundation; either version 2 of the License, or *
7 * ( at your option ) any later version. * 7 * ( at your option ) any later version. *
8 * * 8 * *
9 **************************************************************************/ 9 **************************************************************************/
10#ifndef _PSEWIDGET_H 10#ifndef _PSEWIDGET_H
11#define _PSEWIDGET_H 11#define _PSEWIDGET_H
12 12
13#include <qwidget.h> 13#include <qwidget.h>
14 14
15class QGridLayout; 15class QGridLayout;
16 16
17class Element
18{
19 public:
20 Element(const QString &elnum);
21 ~Element();
22
23 void setName( QString c){ name = c;};
24 void setWeight( QString c){ weight = c;};
25 void setDensityName( QString c){density = c;};
26 void setGroup( QString c){group = c;};
27 void setIE( QString c){ie = c;};
28 void setNum( QString c){num = c;};
29 void setAZ( QString c){az = c;};
30 void setDate( QString c){date = c;};
31 void setEN( QString c){en = c;};
32 void setMP( QString c){mp = c;};
33 void setBP( QString c){bp = c;};
34 void setAR( QString c){ar = c;};
35
36 QString elname() const{ return name; };
37 QString elweight() const{ return weight; };
38 QString eldensity() const{ return density; };
39 QString elgroup() const{ return group; };
40 QString elie() const{ return ie; };
41 QString elnum() const{ return num; };
42 QString elaz() const{ return az; };
43 QString eldate() const{ return date; };
44 QString elen() const{ return en; };
45 QString elmp() const{ return mp; };
46 QString elbp() const{ return bp; };
47 QString elar() const{ return ar; };
48
49 private:
50 QString name, // The name of the element
51 weight, // weight
52 density, // density
53 group, // group
54 ie, // ionisationenergie
55 num, // number ( e.g. Carbon is 6 )
56 az, // state of aggregation
57 date, // date of discovery
58 en, // electronegativity
59 mp, // meltingpoint
60 bp, // boilingpoint
61 ar; // atomic radius
62};
63
17class PSEWidget : public QWidget 64class PSEWidget : public QWidget
18{ 65{
19 Q_OBJECT 66 Q_OBJECT
20 67
21 public: 68 public:
22 PSEWidget(); 69 PSEWidget();
23 70
24 private: 71 private:
25 QGridLayout *maingrid; 72 QGridLayout *maingrid;
26 73
27}; 74};
28 75
29#endif 76#endif