-rw-r--r-- | noncore/apps/oxygen/calcdlg.ui | 252 | ||||
-rw-r--r-- | noncore/apps/oxygen/calcdlgui.cpp | 1 | ||||
-rw-r--r-- | noncore/apps/oxygen/dataTable.cpp | 4 | ||||
-rw-r--r-- | noncore/apps/oxygen/oxygen.cpp | 49 | ||||
-rw-r--r-- | noncore/apps/oxygen/oxygen.h | 8 |
5 files changed, 115 insertions, 199 deletions
diff --git a/noncore/apps/oxygen/calcdlg.ui b/noncore/apps/oxygen/calcdlg.ui index b4e54f1..2d30164 100644 --- a/noncore/apps/oxygen/calcdlg.ui +++ b/noncore/apps/oxygen/calcdlg.ui @@ -1,230 +1,180 @@ <!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>253</width> - <height>352</height> + <width>245</width> + <height>318</height> </rect> </property> <property stdset="1"> <name>caption</name> - <string>Calculations</string> - </property> - <property> - <name>layoutMargin</name> - </property> - <property> - <name>layoutSpacing</name> + <string>Form1</string> </property> <widget> <class>QTabWidget</class> <property stdset="1"> <name>name</name> - <cstring>TabWidgetMain</cstring> + <cstring>TabWidget3</cstring> </property> <property stdset="1"> <name>geometry</name> <rect> <x>0</x> <y>0</y> - <width>250</width> - <height>350</height> + <width>240</width> + <height>320</height> </rect> </property> - <property> - <name>layoutMargin</name> - </property> - <property> - <name>layoutSpacing</name> - </property> <widget> <class>QWidget</class> <property stdset="1"> <name>name</name> - <cstring>tabMain</cstring> + <cstring>tab</cstring> </property> <attribute> <name>title</name> - <string>Molweight</string> + <string>Tab 1</string> </attribute> <widget> - <class>QFrame</class> + <class>QLayoutWidget</class> <property stdset="1"> <name>name</name> - <cstring>FrameSystemTime</cstring> + <cstring>Layout6</cstring> </property> <property stdset="1"> <name>geometry</name> <rect> <x>0</x> <y>0</y> - <width>240</width> - <height>310</height> + <width>230</width> + <height>290</height> </rect> </property> - <property stdset="1"> - <name>frameShape</name> - <enum>StyledPanel</enum> - </property> - <property stdset="1"> - <name>frameShadow</name> - <enum>Raised</enum> - </property> - <widget> - <class>QLayoutWidget</class> + <vbox> <property stdset="1"> - <name>name</name> - <cstring>Layout7</cstring> + <name>margin</name> + <number>0</number> </property> <property stdset="1"> - <name>geometry</name> - <rect> - <x>0</x> - <y>0</y> - <width>240</width> - <height>310</height> - </rect> + <name>spacing</name> + <number>6</number> </property> - <vbox> + <widget> + <class>QLabel</class> <property stdset="1"> - <name>margin</name> - <number>0</number> + <name>name</name> + <cstring>TextLabel2</cstring> </property> <property stdset="1"> - <name>spacing</name> - <number>6</number> + <name>text</name> + <string>TextLabel2</string> </property> - <widget> - <class>QLabel</class> - <property stdset="1"> - <name>name</name> - <cstring>TextLabel1_4</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Formula:</string> - </property> - </widget> - <widget> - <class>QLineEdit</class> + </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>name</name> - <cstring>formula</cstring> + <name>margin</name> + <number>0</number> </property> - </widget> - <widget> - <class>QLayoutWidget</class> <property stdset="1"> - <name>name</name> - <cstring>Layout7</cstring> + <name>spacing</name> + <number>6</number> </property> - <hbox> + <widget> + <class>QPushButton</class> <property stdset="1"> - <name>margin</name> - <number>0</number> + <name>name</name> + <cstring>calculate</cstring> </property> <property stdset="1"> - <name>spacing</name> - <number>6</number> + <name>text</name> + <string>PushButton3</string> </property> - <widget> - <class>QPushButton</class> - <property stdset="1"> - <name>name</name> - <cstring>calculate</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Calculate</string> - </property> - </widget> - <widget> - <class>QPushButton</class> - <property stdset="1"> - <name>name</name> - <cstring>clear_fields</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Clear</string> - </property> - </widget> - </hbox> - </widget> - <widget> - <class>QLabel</class> - <property stdset="1"> - <name>name</name> - <cstring>TextLabel2_4</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Result:</string> - </property> - </widget> - <widget> - <class>QLineEdit</class> - <property stdset="1"> - <name>name</name> - <cstring>result</cstring> - </property> - </widget> - <widget> - <class>QLabel</class> - <property stdset="1"> - <name>name</name> - <cstring>TextLabel1</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Elemental composition (%):</string> - </property> - </widget> - <widget> - <class>QMultiLineEdit</class> - <property stdset="1"> - <name>name</name> - <cstring>anal_display</cstring> - </property> - <property stdset="1"> - <name>readOnly</name> - <bool>true</bool> - </property> - </widget> - </vbox> - </widget> + </widget> + <widget> + <class>QPushButton</class> + <property stdset="1"> + <name>name</name> + <cstring>clear_fields</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>PushButton4</string> + </property> + </widget> + </hbox> + </widget> + <widget> + <class>QLabel</class> + <property stdset="1"> + <name>name</name> + <cstring>TextLabel3</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>TextLabel3</string> + </property> + </widget> + <widget> + <class>QLineEdit</class> + <property stdset="1"> + <name>name</name> + <cstring>result</cstring> + </property> + </widget> + <widget> + <class>QLabel</class> + <property stdset="1"> + <name>name</name> + <cstring>TextLabel1</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>TextLabel1</string> + </property> + </widget> + <widget> + <class>QMultiLineEdit</class> + <property stdset="1"> + <name>name</name> + <cstring>anal_display</cstring> + </property> + </widget> + </vbox> </widget> </widget> <widget> <class>QWidget</class> <property stdset="1"> <name>name</name> - <cstring>tabNtp</cstring> + <cstring>tab</cstring> </property> <attribute> <name>title</name> - <string>Nernst</string> + <string>Tab 2</string> </attribute> - <grid> - <property stdset="1"> - <name>margin</name> - <number>1</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>2</number> - </property> - </grid> </widget> </widget> </widget> </UI> diff --git a/noncore/apps/oxygen/calcdlgui.cpp b/noncore/apps/oxygen/calcdlgui.cpp index b6dfff3..ca3a9f2 100644 --- a/noncore/apps/oxygen/calcdlgui.cpp +++ b/noncore/apps/oxygen/calcdlgui.cpp @@ -3,49 +3,48 @@ begin : September 2002 copyright : ( C ) 2002 by Carsten Niehaus email : cniehaus@handhelds.org **************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * ( at your option ) any later version. * * * **************************************************************************/ #include "oxygen.h" #include "calcdlgui.h" #include "kmolcalc.h" #include <qlineedit.h> #include <qmultilineedit.h> #include <qpushbutton.h> calcDlgUI::calcDlgUI() : CalcDlg() { - this->showMaximized(); kmolcalc = new KMolCalc; connect( calculate, SIGNAL( clicked() ), this, SLOT( calc() ) ); connect( clear_fields, SIGNAL( clicked() ), this, SLOT( clear() ) ); result->setReadOnly( true ); } void calcDlgUI::calc() { QString compound( formula->text() ); if ( compound.isEmpty() ) { clear(); return; } QString errors( kmolcalc->readFormula( compound ) ); QString mw, ea; double weight = kmolcalc->getWeight(); if ( errors == "OK" ) { mw.setNum( weight ); ea = kmolcalc->getEmpFormula() + " :\n" + kmolcalc->getEA(); } else { mw = "???"; ea = tr( "ERROR: \n" ) + errors + "\n"; } result->setText( mw ); diff --git a/noncore/apps/oxygen/dataTable.cpp b/noncore/apps/oxygen/dataTable.cpp index 45c2ffd..e027c16 100644 --- a/noncore/apps/oxygen/dataTable.cpp +++ b/noncore/apps/oxygen/dataTable.cpp @@ -22,50 +22,50 @@ #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 , 118 ); - DataTable->setColumnWidth ( 0 , 118 ); +// DataTable->setColumnWidth ( 1 , 118 ); +// DataTable->setColumnWidth ( 0 , 118 ); 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,configobj.readEntry( "Weight" ) ); DataTable->setText( 1,1,configobj.readEntry( "Block" ) ); DataTable->setText( 2,1,configobj.readEntry( "Group" ) ); DataTable->setText( 3,1,configobj.readEntry( "EN" ) ); DataTable->setText( 4,1,configobj.readEntry( "AR" ) ) ; DataTable->setText( 5,1,configobj.readEntry( "IE" ) ); DataTable->setText( 6,1,configobj.readEntry( "Density" ) ); diff --git a/noncore/apps/oxygen/oxygen.cpp b/noncore/apps/oxygen/oxygen.cpp index b3392e1..bc99d89 100644 --- a/noncore/apps/oxygen/oxygen.cpp +++ b/noncore/apps/oxygen/oxygen.cpp @@ -1,67 +1,42 @@ /*************************************************************************** application: : Oxygen begin : September 2002 copyright : ( C ) 2002 by Carsten Niehaus email : cniehaus@handhelds.org **************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * ( at your option ) any later version. * * * **************************************************************************/ #include "oxygen.h" #include <qlabel.h> #include <qapplication.h> #include <qpushbutton.h> #include <qvbox.h> +#include <qtabwidget.h> #include "calcdlg.h" #include "calcdlgui.h" #include "datawidgetui.h" #include "psewidget.h" -Oxygen::Oxygen() - : QMainWindow() +Oxygen::Oxygen() : QMainWindow() { - this->setCaption( tr( "Oxygen" ) ); - vbox = new QVBox( this ); - QPushButton *dataButton = new QPushButton( "Data", vbox ); - connect ( dataButton, SIGNAL( clicked() ), this, SLOT( slotData() ) ); - QPushButton *calcButton = new QPushButton( "Calculations", vbox ); - connect ( calcButton, SIGNAL( clicked() ), this, SLOT( slotCalculations() ) ); - QPushButton *pseButton = new QPushButton( "PSE", vbox ); - connect ( pseButton, SIGNAL( clicked() ), this, SLOT( slotPSE() ) ); - - setCentralWidget( vbox ); -} - - -void Oxygen::close() const -{ - QApplication::exit(); -} - -//SLOTS - -void Oxygen::slotCalculations() const{ + PSEWidget *pse = new PSEWidget(); calcDlgUI *CalcDlgUI = new calcDlgUI(); - CalcDlgUI->show(); -}; - -void Oxygen::slotData() const{ dataWidgetUI *DataWidgetUI = new dataWidgetUI(); - DataWidgetUI->showMaximized(); - DataWidgetUI->show(); -}; - -void Oxygen::slotPSE() const{ - PSEWidget *pse = new PSEWidget(); - pse->showMaximized(); - pse->show(); -}; - + + this->setCaption( tr( "Oxygen" ) ); + + QTabWidget *tabw = new QTabWidget( this , "qtab" ); + tabw->addTab( pse, tr( "PSE" )); + tabw->addTab( DataWidgetUI , tr( "Data" ) ); + tabw->addTab( CalcDlgUI, tr( "Calculations" ) ); + setCentralWidget( tabw ); +} diff --git a/noncore/apps/oxygen/oxygen.h b/noncore/apps/oxygen/oxygen.h index 2a10666..782cc3e 100644 --- a/noncore/apps/oxygen/oxygen.h +++ b/noncore/apps/oxygen/oxygen.h @@ -1,26 +1,18 @@ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * ( at your option ) any later version. * * * **************************************************************************/ #include <qmainwindow.h> -class QVBox; - class Oxygen : public QMainWindow { Q_OBJECT public: Oxygen(); - QVBox *vbox; - private slots: - void slotCalculations() const; - void slotData() const; - void slotPSE() const; - void close() const; }; |