summaryrefslogtreecommitdiff
path: root/noncore/apps
Unidiff
Diffstat (limited to 'noncore/apps') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/oxygen/calcdlgui.cpp8
-rw-r--r--noncore/apps/oxygen/dataTable.cpp24
-rw-r--r--noncore/apps/oxygen/dataTable.h11
-rw-r--r--noncore/apps/oxygen/datawidgetui.cpp25
-rw-r--r--noncore/apps/oxygen/datawidgetui.h18
-rw-r--r--noncore/apps/oxygen/main.cpp8
-rw-r--r--noncore/apps/oxygen/oxyframe.cpp8
-rw-r--r--noncore/apps/oxygen/oxyframe.h7
-rw-r--r--noncore/apps/oxygen/oxygen.cpp8
-rw-r--r--noncore/apps/oxygen/psewidget.cpp8
-rw-r--r--noncore/apps/oxygen/psewidget.h7
11 files changed, 121 insertions, 11 deletions
diff --git a/noncore/apps/oxygen/calcdlgui.cpp b/noncore/apps/oxygen/calcdlgui.cpp
index e40e2c7..b6dfff3 100644
--- a/noncore/apps/oxygen/calcdlgui.cpp
+++ b/noncore/apps/oxygen/calcdlgui.cpp
@@ -1,7 +1,15 @@
1/*************************************************************************** 1/***************************************************************************
2 application: : Oxygen
3
4 begin : September 2002
5 copyright : ( C ) 2002 by Carsten Niehaus
6 email : cniehaus@handhelds.org
7 **************************************************************************/
8
9/***************************************************************************
2 * * 10 * *
3 * 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 *
4 * 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 *
5 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
6 * ( at your option ) any later version. * 14 * ( at your option ) any later version. *
7 * * 15 * *
diff --git a/noncore/apps/oxygen/dataTable.cpp b/noncore/apps/oxygen/dataTable.cpp
index 70b5a6a..ff01417 100644
--- a/noncore/apps/oxygen/dataTable.cpp
+++ b/noncore/apps/oxygen/dataTable.cpp
@@ -1,7 +1,15 @@
1/*************************************************************************** 1/***************************************************************************
2 application: : Oxygen
3
4 begin : September 2002
5 copyright : ( C ) 2002 by Carsten Niehaus
6 email : cniehaus@handhelds.org
7 **************************************************************************/
8
9/***************************************************************************
2 * * 10 * *
3 * 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 *
4 * 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 *
5 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
6 * ( at your option ) any later version. * 14 * ( at your option ) any later version. *
7 * * 15 * *
@@ -16,24 +24,29 @@
16#include <qfont.h> 24#include <qfont.h>
17#include <qlayout.h> 25#include <qlayout.h>
18 26
19OxydataWidget::OxydataWidget(QWidget *parent) : QWidget(parent) 27OxydataWidget::OxydataWidget(QWidget *parent) : QWidget(parent)
20{ 28{
21 QGridLayout *qgrid = new QGridLayout( this, 2,1 ); 29 QGridLayout *qgrid = new QGridLayout( this, 2,1 );
30
22 QHBox *hbox = new QHBox( this ); 31 QHBox *hbox = new QHBox( this );
23 left = new QLabel( hbox ); 32 left = new QLabel( hbox );
24 middle = new QLabel( hbox ); 33 middle = new QLabel( hbox );
25 right = new QLabel( hbox ); 34 right = new QLabel( hbox );
26 35
27 DataTable = new OxydataTable( 9,2, this ); 36 right->setAlignment( AlignRight );
28 37 middle->setAlignment( AlignHCenter );
38
29 QFont bf; 39 QFont bf;
30 bf.setBold( true ); 40 bf.setBold( true );
31 bf.setPointSize( bf.pointSize()+2 ); 41 bf.setPointSize( bf.pointSize()+2 );
32 middle->setFont( bf ); 42 middle->setFont( bf );
33 43
44 DataTable = new OxydataTable( 9,2, this );
45 DataTable->setColumnWidth ( 1 , 118 );
46 DataTable->setColumnWidth ( 0 , 118 );
34 setTable(); 47 setTable();
35 48
36 qgrid->addWidget( hbox,0,0 ); 49 qgrid->addWidget( hbox,0,0 );
37 qgrid->addWidget( DataTable,1,0 ); 50 qgrid->addWidget( DataTable,1,0 );
38} 51}
39 52
@@ -78,12 +91,19 @@ OxydataTable::OxydataTable(int numRows, int numCols, QWidget *parent,
78 this->horizontalHeader()->hide(); 91 this->horizontalHeader()->hide();
79 this->verticalHeader()->hide(); 92 this->verticalHeader()->hide();
80 this->setTopMargin( 0 ); 93 this->setTopMargin( 0 );
81 this->setLeftMargin( 0 ); 94 this->setLeftMargin( 0 );
82} 95}
83 96
97int OxydataTable::alignment() const
98{
99 return AlignLeft | AlignVCenter;
100};
101
102
103
84void OxydataTable::paintCell( QPainter *p, int row, int col, const QRect &cr, bool selected) 104void OxydataTable::paintCell( QPainter *p, int row, int col, const QRect &cr, bool selected)
85{ 105{
86 if ( cr.width() == 0 || cr.height() == 0 ) 106 if ( cr.width() == 0 || cr.height() == 0 )
87 return; 107 return;
88 selected = FALSE; 108 selected = FALSE;
89 109
diff --git a/noncore/apps/oxygen/dataTable.h b/noncore/apps/oxygen/dataTable.h
index ccc4300..00063d4 100644
--- a/noncore/apps/oxygen/dataTable.h
+++ b/noncore/apps/oxygen/dataTable.h
@@ -13,12 +13,13 @@
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;
19class QTableItem;
19 20
20/* 21/*
21 * A OxydataWidget shows all known data of an element. It can 22 * 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 * 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 * a simple QHBox with 2 QStrings in it plus a OxydataTable
24 * which contains the rest of the data. 25 * which contains the rest of the data.
@@ -56,15 +57,25 @@ class OxydataTable : public QTable
56 Q_OBJECT 57 Q_OBJECT
57 58
58 public: 59 public:
59 OxydataTable( int numRows, int numCols, 60 OxydataTable( int numRows, int numCols,
60 QWidget *parent = 0, const char *name = 0 ); 61 QWidget *parent = 0, const char *name = 0 );
61 62
63 virtual int alignment() const;
64// virtual QTableItem *item( int row, int col ) const;
65
62 protected: 66 protected:
63 /* 67 /*
64 * This method is reimplemented form QTable. It implements the colourisation 68 * This method is reimplemented form QTable. It implements the colourisation
65 * of every second row. 69 * of every second row.
66 */ 70 */
67 virtual void paintCell( QPainter *p, int row, int col, const QRect &cr, bool selected ); 71 virtual void paintCell( QPainter *p, int row, int col, const QRect &cr, bool selected );
68}; 72};
69 73
74//X class OxydataQTI : QTableItem
75//X {
76//X Q_OBJECT
77//X
78//X public:
79//X OxydataQTI(
80
70#endif 81#endif
diff --git a/noncore/apps/oxygen/datawidgetui.cpp b/noncore/apps/oxygen/datawidgetui.cpp
index 2e99c0b..4dab109 100644
--- a/noncore/apps/oxygen/datawidgetui.cpp
+++ b/noncore/apps/oxygen/datawidgetui.cpp
@@ -1,42 +1,51 @@
1/*************************************************************************** 1/***************************************************************************
2 application: : Oxygen
3
4 begin : September 2002
5 copyright : ( C ) 2002 by Carsten Niehaus
6 email : cniehaus@handhelds.org
7 **************************************************************************/
8
9/***************************************************************************
2 * * 10 * *
3 * 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 *
4 * 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 *
5 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
6 * ( at your option ) any later version. * 14 * ( at your option ) any later version. *
7 * * 15 * *
8 **************************************************************************/ 16 **************************************************************************/
9 17
10#include "datawidgetui.h" 18#include "datawidgetui.h"
19#include "dataTable.h"
11 20
12#include <qpe/config.h> 21#include <qpe/config.h>
13#include <qstring.h> 22#include <qstring.h>
14#include <qcombobox.h> 23#include <qcombobox.h>
15#include <qlayout.h> 24#include <qlayout.h>
16#include <qhbox.h> 25#include <qhbox.h>
17#include <qlabel.h> 26#include <qlabel.h>
18 27
19dataWidgetUI::dataWidgetUI() : QWidget() 28dataWidgetUI::dataWidgetUI() : QWidget()
20{ 29{
21 this->setCaption( tr( "Chemical Data" )); 30 this->setCaption( tr( "Chemical Data" ));
22
23 QGridLayout *qgrid = new QGridLayout( this, 2,1 ); 31 QGridLayout *qgrid = new QGridLayout( this, 2,1 );
24 32
25 dataCombo = new QComboBox( this ); 33 dataCombo = new QComboBox( this );
26 OxydataWidget *oxyDW = new OxydataWidget(this);
27 oxyDW->setElement( 1 );
28 qgrid->addWidget( dataCombo, 0,0);
29 qgrid->addWidget( oxyDW , 1,0 );
30
31 connect ( dataCombo, SIGNAL( activated(int) ), oxyDW, SLOT( setElement(int) ) );
32 Config configobj( "oxygendata" );
33 34
34 //read in all names of the 118 elements 35 //read in all names of the 118 elements
36 Config configobj( "oxygendata" );
35 for ( int i = 1 ; i < 119 ; i++ ) 37 for ( int i = 1 ; i < 119 ; i++ )
36 { 38 {
37 configobj.setGroup( QString::number( i ) ); 39 configobj.setGroup( QString::number( i ) );
38 QString foo = configobj.readEntry( "Name" ); 40 QString foo = configobj.readEntry( "Name" );
39 dataCombo->insertItem( foo ); 41 dataCombo->insertItem( foo );
40 } 42 }
43
44 OxydataWidget *oxyDW = new OxydataWidget(this);
45 connect ( dataCombo, SIGNAL( activated(int) ), oxyDW, SLOT( setElement(int) ) );
46 oxyDW->setElement( 1 );
47
48 qgrid->addWidget( dataCombo, 0,0);
49 qgrid->addWidget( oxyDW , 1,0 );
41} 50}
42 51
diff --git a/noncore/apps/oxygen/datawidgetui.h b/noncore/apps/oxygen/datawidgetui.h
index 5399c81..cd716ad 100644
--- a/noncore/apps/oxygen/datawidgetui.h
+++ b/noncore/apps/oxygen/datawidgetui.h
@@ -1,18 +1,33 @@
1#ifndef DATAWIDGETUI_H
2#define DATAWIDGETUI_H
3
4
5/***************************************************************************
6 application: : Oxygen
7
8 begin : September 2002
9 copyright : ( C ) 2002 by Carsten Niehaus
10 email : cniehaus@handhelds.org
11 **************************************************************************/
1 12
2/*************************************************************************** 13/***************************************************************************
3 * * 14 * *
4 * This program is free software; you can redistribute it and/or modify * 15 * 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 * 16 * 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 * 17 * the Free Software Foundation; either version 2 of the License, or *
7 * ( at your option ) any later version. * 18 * ( at your option ) any later version. *
8 * * 19 * *
9 **************************************************************************/ 20 **************************************************************************/
10#include "dataTable.h" 21
22
23class OxydataWidget;
24class OxydataTable;
11 25
12class QComboBox; 26class QComboBox;
27#include <qwidget.h>
13 28
14class dataWidgetUI : public QWidget 29class dataWidgetUI : public QWidget
15{ 30{
16 Q_OBJECT 31 Q_OBJECT
17 32
18 public: 33 public:
@@ -20,6 +35,7 @@ class dataWidgetUI : public QWidget
20 35
21 private: 36 private:
22 OxydataTable *DataTable; 37 OxydataTable *DataTable;
23 QComboBox *dataCombo; 38 QComboBox *dataCombo;
24 OxydataWidget *oxyDW; 39 OxydataWidget *oxyDW;
25}; 40};
41#endif
diff --git a/noncore/apps/oxygen/main.cpp b/noncore/apps/oxygen/main.cpp
index 31e44dc..c8fcdb4 100644
--- a/noncore/apps/oxygen/main.cpp
+++ b/noncore/apps/oxygen/main.cpp
@@ -1,7 +1,15 @@
1/*************************************************************************** 1/***************************************************************************
2 application: : Oxygen
3
4 begin : September 2002
5 copyright : ( C ) 2002 by Carsten Niehaus
6 email : cniehaus@handhelds.org
7 **************************************************************************/
8
9/***************************************************************************
2 * * 10 * *
3 * 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 *
4 * 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 *
5 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
6 * ( at your option ) any later version. * 14 * ( at your option ) any later version. *
7 * * 15 * *
diff --git a/noncore/apps/oxygen/oxyframe.cpp b/noncore/apps/oxygen/oxyframe.cpp
index a5f262e..c61c8e5 100644
--- a/noncore/apps/oxygen/oxyframe.cpp
+++ b/noncore/apps/oxygen/oxyframe.cpp
@@ -1,7 +1,15 @@
1/*************************************************************************** 1/***************************************************************************
2 application: : Oxygen
3
4 begin : September 2002
5 copyright : ( C ) 2002 by Carsten Niehaus
6 email : cniehaus@handhelds.org
7 **************************************************************************/
8
9/***************************************************************************
2 * * 10 * *
3 * 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 *
4 * 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 *
5 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
6 * ( at your option ) any later version. * 14 * ( at your option ) any later version. *
7 * * 15 * *
diff --git a/noncore/apps/oxygen/oxyframe.h b/noncore/apps/oxygen/oxyframe.h
index a19f13c..4543504 100644
--- a/noncore/apps/oxygen/oxyframe.h
+++ b/noncore/apps/oxygen/oxyframe.h
@@ -1,6 +1,13 @@
1/***************************************************************************
2 application: : Oxygen
3
4 begin : September 2002
5 copyright : ( C ) 2002 by Carsten Niehaus
6 email : cniehaus@handhelds.org
7 **************************************************************************/
1 8
2/*************************************************************************** 9/***************************************************************************
3 * * 10 * *
4 * 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 *
5 * 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 *
6 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
diff --git a/noncore/apps/oxygen/oxygen.cpp b/noncore/apps/oxygen/oxygen.cpp
index 4e293c7..b3392e1 100644
--- a/noncore/apps/oxygen/oxygen.cpp
+++ b/noncore/apps/oxygen/oxygen.cpp
@@ -1,7 +1,15 @@
1/*************************************************************************** 1/***************************************************************************
2 application: : Oxygen
3
4 begin : September 2002
5 copyright : ( C ) 2002 by Carsten Niehaus
6 email : cniehaus@handhelds.org
7 **************************************************************************/
8
9/***************************************************************************
2 * * 10 * *
3 * 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 *
4 * 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 *
5 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
6 * ( at your option ) any later version. * 14 * ( at your option ) any later version. *
7 * * 15 * *
diff --git a/noncore/apps/oxygen/psewidget.cpp b/noncore/apps/oxygen/psewidget.cpp
index 78e54d5..a3bb505 100644
--- a/noncore/apps/oxygen/psewidget.cpp
+++ b/noncore/apps/oxygen/psewidget.cpp
@@ -1,7 +1,15 @@
1/*************************************************************************** 1/***************************************************************************
2 application: : Oxygen
3
4 begin : September 2002
5 copyright : ( C ) 2002 by Carsten Niehaus
6 email : cniehaus@handhelds.org
7 **************************************************************************/
8
9/***************************************************************************
2 * * 10 * *
3 * 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 *
4 * 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 *
5 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
6 * ( at your option ) any later version. * 14 * ( at your option ) any later version. *
7 * * 15 * *
diff --git a/noncore/apps/oxygen/psewidget.h b/noncore/apps/oxygen/psewidget.h
index f69eeb3..fdf838e 100644
--- a/noncore/apps/oxygen/psewidget.h
+++ b/noncore/apps/oxygen/psewidget.h
@@ -1,6 +1,13 @@
1/***************************************************************************
2 application: : Oxygen
3
4 begin : September 2002
5 copyright : ( C ) 2002 by Carsten Niehaus
6 email : cniehaus@handhelds.org
7 **************************************************************************/
1 8
2/*************************************************************************** 9/***************************************************************************
3 * * 10 * *
4 * 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 *
5 * 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 *
6 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *