summaryrefslogtreecommitdiff
authorcniehaus <cniehaus>2002-09-30 13:05:45 (UTC)
committer cniehaus <cniehaus>2002-09-30 13:05:45 (UTC)
commitb753c264b7acd26aba9f5a73c1fa0a7deb0b73a3 (patch) (side-by-side diff)
treea5579c7242791b2602a764a781051c7f9a298be1
parentece83520d6bf5c481275a3d4a8e792749119fa08 (diff)
downloadopie-b753c264b7acd26aba9f5a73c1fa0a7deb0b73a3.zip
opie-b753c264b7acd26aba9f5a73c1fa0a7deb0b73a3.tar.gz
opie-b753c264b7acd26aba9f5a73c1fa0a7deb0b73a3.tar.bz2
fixed one typo
I tried to fix the layouting problem but I give up. /me is to lame
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/oxygen/calcdlg.ui4
-rw-r--r--noncore/apps/oxygen/dataTable.cpp10
-rw-r--r--noncore/apps/oxygen/dataTable.h3
-rw-r--r--noncore/apps/oxygen/datawidgetui.cpp1
-rw-r--r--noncore/apps/oxygen/psewidget.cpp1
5 files changed, 15 insertions, 4 deletions
diff --git a/noncore/apps/oxygen/calcdlg.ui b/noncore/apps/oxygen/calcdlg.ui
index a8ed170..c817a47 100644
--- a/noncore/apps/oxygen/calcdlg.ui
+++ b/noncore/apps/oxygen/calcdlg.ui
@@ -1,38 +1,38 @@
<!DOCTYPE UI><UI>
<class>CalcDlg</class>
<widget>
<class>QWidget</class>
<property stdset="1">
<name>name</name>
<cstring>CalcDlg</cstring>
</property>
<property stdset="1">
<name>geometry</name>
<rect>
<x>0</x>
<y>0</y>
- <width>241</width>
+ <width>237</width>
<height>318</height>
</rect>
</property>
<property stdset="1">
<name>caption</name>
<string>Form1</string>
</property>
<widget>
<class>QTabWidget</class>
<property stdset="1">
<name>name</name>
<cstring>TabWidget3</cstring>
</property>
<property stdset="1">
<name>geometry</name>
<rect>
<x>0</x>
<y>0</y>
<width>240</width>
<height>320</height>
</rect>
</property>
<widget>
<class>QWidget</class>
@@ -55,49 +55,49 @@
<rect>
<x>0</x>
<y>0</y>
<width>230</width>
<height>290</height>
</rect>
</property>
<vbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget>
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>TextLabel2</cstring>
</property>
<property stdset="1">
<name>text</name>
- <string>chemical Formula</string>
+ <string>Chemical Formula</string>
</property>
</widget>
<widget>
<class>QLineEdit</class>
<property stdset="1">
<name>name</name>
<cstring>formula</cstring>
</property>
</widget>
<widget>
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>Layout3</cstring>
</property>
<hbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
diff --git a/noncore/apps/oxygen/dataTable.cpp b/noncore/apps/oxygen/dataTable.cpp
index 98d3bd8..82b425e 100644
--- a/noncore/apps/oxygen/dataTable.cpp
+++ b/noncore/apps/oxygen/dataTable.cpp
@@ -22,89 +22,97 @@
#include <qhbox.h>
#include <qlabel.h>
#include <qfont.h>
#include <qlayout.h>
#include <qpe/qpeapplication.h>
OxydataWidget::OxydataWidget(QWidget *parent) : QWidget(parent)
{
QGridLayout *qgrid = new QGridLayout( this, 2,1 );
QHBox *hbox = new QHBox( this );
left = new QLabel( hbox );
middle = new QLabel( hbox );
right = new QLabel( hbox );
right->setAlignment( AlignRight );
middle->setAlignment( AlignHCenter );
QFont bf;
bf.setBold( true );
bf.setPointSize( bf.pointSize()+2 );
middle->setFont( bf );
DataTable = new OxydataTable( 9,2, this );
- //DataTable->setColumnWidth ( 1 , ( parent->width())-10 );
setTable();
qgrid->addWidget( hbox,0,0 );
qgrid->addWidget( DataTable,1,0 );
}
void OxydataWidget::setElement( int el )
{
Config configobj( QPEApplication::qpeDir() +"share/oxygen/oxygendata", Config::File );
configobj.setGroup( QString::number( el+1 ));
left->setText( configobj.readEntry( "Symbol" ) );
middle->setText( configobj.readEntry( "Name" ) );
right->setText( QString::number( el+1 ) );
DataTable->setText( 0,1,tr( "%1 u" ).arg( configobj.readEntry( "Weight" ) ) );
DataTable->setText( 1,1,configobj.readEntry( "Block" ) );
DataTable->setText( 2,1,configobj.readEntry( "Group" ) );
DataTable->setText( 3,1,tr( "%1 J").arg( configobj.readEntry( "EN" ) ) );
DataTable->setText( 4,1,tr( "%1 nm" ).arg( configobj.readEntry( "AR" ) ) ) ;
DataTable->setText( 5,1,tr( "%1 J" ).arg( configobj.readEntry( "IE" ) ) );
DataTable->setText( 6,1,configobj.readEntry( "Density" ) );
DataTable->setText( 7,1,tr( "%1 K" ).arg( configobj.readEntry( "BP" ) ) );
DataTable->setText( 8,1,tr( "%1 K" ).arg( configobj.readEntry( "MP" ) ) );
}
void OxydataWidget::setTable() const
{
DataTable->setText( 0,0, tr( "Weight:" ) );
DataTable->setText( 1,0, tr( "Block" )) ;
DataTable->setText( 2,0, tr( "Group" )) ;
DataTable->setText( 3,0, tr( "Electronegativity" )) ;
DataTable->setText( 4,0, tr( "Atomic radius" )) ;
DataTable->setText( 5,0, tr( "Ionizationenergie" )) ;
DataTable->setText( 6,0, tr( "Density" )) ;
DataTable->setText( 7,0, tr( "Boilingpoint" ) );
DataTable->setText( 8,0, tr( "Meltingpoint" ) );
+}
+
+void OxydataWidget::setLayout()
+{
+#warning this is not working and I have no idea why!
+// DataTable->setColumnWidth ( 0 , this->width()/2 );
+// DataTable->setColumnWidth ( 1 , this->width()/2 );
+ DataTable->setColumnWidth ( 0 , 110 );
+ DataTable->setColumnWidth ( 1 , 110 );
}
OxydataTable::OxydataTable(int numRows, int numCols, QWidget *parent,
const char *name) : QTable(numRows, numCols,parent, name)
{
for (int zeile = 0; zeile < numRows; zeile++)
for ( int spalte = 0; spalte < numCols; spalte++ )
{
OxydataQTI *testus = new OxydataQTI (this, OxydataQTI::Never, "hm" );
setItem(zeile, spalte, (QTableItem*)testus);
}
this->setShowGrid( false );
this->setHScrollBarMode(QScrollView::AlwaysOff);
this->horizontalHeader()->hide();
this->verticalHeader()->hide();
this->setTopMargin( 0 );
this->setLeftMargin( 0 );
}
void OxydataTable::paintCell( QPainter *p, int row, int col, const QRect &cr, bool selected)
{
diff --git a/noncore/apps/oxygen/dataTable.h b/noncore/apps/oxygen/dataTable.h
index a4a3b18..f2eb71d 100644
--- a/noncore/apps/oxygen/dataTable.h
+++ b/noncore/apps/oxygen/dataTable.h
@@ -13,52 +13,53 @@
#include <qwidget.h>
#include <qtable.h>
class QLabel;
class OxydataTable;
/*
* A OxydataWidget shows all known data of an element. It can
* be used for both the PSE and the pure Data-Dialog. It is
* a simple QHBox with 2 QStrings in it plus a OxydataTable
* which contains the rest of the data.
*
* Author: Carsten Niehaus <cniehaus@handhelds.org>
*/
class OxydataWidget : public QWidget
{
Q_OBJECT
public:
OxydataWidget(QWidget *parent=0);
QLabel *left, *middle, *right;
+ void setLayout();
private:
- OxydataTable *DataTable;
void setTable() const;
+ OxydataTable *DataTable;
public slots:
void setElement( int );
};
/*
* A OxydataTable is derived from QTable. I recoded the paintCell to have
* different colors in the backgound. Furthermore this widget never has a
* grid, thus I removed that code in paintCell.
*
* Author: Carsten Niehaus <cniehaus@handhelds.org>
*/
class OxydataTable : public QTable
{
Q_OBJECT
public:
OxydataTable( int numRows, int numCols,
QWidget *parent = 0, const char *name = 0 );
protected:
/*
* This method is reimplemented form QTable. It implements the colourisation
diff --git a/noncore/apps/oxygen/datawidgetui.cpp b/noncore/apps/oxygen/datawidgetui.cpp
index c7afa32..99c4fd7 100644
--- a/noncore/apps/oxygen/datawidgetui.cpp
+++ b/noncore/apps/oxygen/datawidgetui.cpp
@@ -24,29 +24,30 @@
#include <qlayout.h>
#include <qhbox.h>
#include <qlabel.h>
#include <qpe/qpeapplication.h>
dataWidgetUI::dataWidgetUI() : QWidget()
{
this->setCaption( tr( "Chemical Data" ));
QGridLayout *qgrid = new QGridLayout( this, 2,1 );
dataCombo = new QComboBox( this );
//read in all names of the 118 elements
Config configobj( QPEApplication::qpeDir() +"share/oxygen/oxygendata", Config::File );
for ( int i = 1 ; i < 119 ; i++ )
{
configobj.setGroup( QString::number( i ) );
QString foo = configobj.readEntry( "Name" );
dataCombo->insertItem( QString::number( i )+" - "+foo );
}
OxydataWidget *oxyDW = new OxydataWidget(this);
connect ( dataCombo, SIGNAL( activated(int) ), oxyDW, SLOT( setElement(int) ) );
oxyDW->setElement( 0 );
+ oxyDW->setLayout();
qgrid->addWidget( dataCombo, 0,0);
qgrid->addWidget( oxyDW , 1,0 );
}
diff --git a/noncore/apps/oxygen/psewidget.cpp b/noncore/apps/oxygen/psewidget.cpp
index ba9b71a..18b41c3 100644
--- a/noncore/apps/oxygen/psewidget.cpp
+++ b/noncore/apps/oxygen/psewidget.cpp
@@ -28,48 +28,49 @@ PSEWidget::PSEWidget() : QWidget()
{
this->setCaption( tr( "Periodic System" ) );
QVBoxLayout *vlay = new QVBoxLayout( this );
QGridLayout *grid = new QGridLayout( 18,10 );
int h=0, v=0;
Config configobj( QPEApplication::qpeDir() +"share/oxygen/oxygendata", Config::File );
for( int n = 0 ; n < 118 ; n++ )
{
configobj.setGroup( QString::number( n+1 ));
position( n+1,h,v );
QList<OxyFrame> PSEframe;
PSEframe.append( new OxyFrame( this , QString::number(n) ) );
grid->addWidget( PSEframe.current() , v/40+1 , h/40 );
PSEframe.current()->setMinimumHeight( 11 );
PSEframe.current()->setPalette( QPalette( PSEColor( configobj.readEntry( "Block" ) ) ) );
connect( PSEframe.current(), SIGNAL( num(QString) ), this, SLOT( slotShowElement(QString) ));
}
oxyDW = new OxydataWidget(this);
oxyDW->setElement( 0 );
+ oxyDW->setLayout();
vlay->addLayout( grid );
vlay->addWidget( oxyDW );
}
QColor PSEWidget::PSEColor( QString block )
{
QColor c;
if ( block == "s" ) c.setRgb( 213 , 233 , 231 );
else if ( block == "d" ) c.setRgb( 200,230,160 );
else if ( block == "p" ) c.setRgb( 238,146,138 );
else if ( block == "f" ) c.setRgb( 190 , 190 , 190 );
return c;
};
void PSEWidget::slotShowElement(QString number)
{
oxyDW->setElement( number.toInt() );
};
void PSEWidget::position(int n, int& h, int& v)
{
//Hydrogen
if (n == 1)