Changeset cbf01e for src/UIElements
- Timestamp:
- Feb 25, 2010, 2:23:33 PM (15 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
- Children:
- 2561df
- Parents:
- 326a43b (diff), 5a7243 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src/UIElements
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Dialog.cpp
r326a43b rcbf01e 142 142 *target = *tmp; 143 143 } 144 145 // Element Queries 146 Dialog::ElementQuery::ElementQuery(std::string title, element **_target) : 147 Query(title), 148 target(_target), 149 tmp(0) 150 {} 151 152 Dialog::ElementQuery::~ElementQuery(){} 153 154 void Dialog::ElementQuery::setResult(){ 155 *target=tmp; 156 } -
src/UIElements/Dialog.hpp
r326a43b rcbf01e 15 15 class molecule; 16 16 class Vector; 17 class element; 17 18 18 19 class Dialog … … 27 28 virtual void queryMolecule(const char*,molecule**,MoleculeListClass*)=0; 28 29 virtual void queryVector(const char*,Vector *,const double *const,bool)=0; 30 virtual void queryElement(const char*,element **)=0; 29 31 30 32 virtual bool display(); … … 48 50 public: 49 51 Query(std::string _title); 50 ~Query();52 virtual ~Query(); 51 53 virtual bool handle()=0; 52 54 virtual void setResult()=0; … … 61 63 public: 62 64 IntQuery(std::string title,int *_target); 63 ~IntQuery();65 virtual ~IntQuery(); 64 66 virtual bool handle()=0; 65 67 virtual void setResult(); … … 73 75 public: 74 76 DoubleQuery(std::string title,double *_target); 75 ~DoubleQuery();77 virtual ~DoubleQuery(); 76 78 virtual bool handle()=0; 77 79 virtual void setResult(); … … 85 87 public: 86 88 StringQuery(std::string title,std::string *_target); 87 ~StringQuery();89 virtual ~StringQuery(); 88 90 virtual bool handle()=0; 89 91 virtual void setResult(); … … 98 100 public: 99 101 MoleculeQuery(std::string title, molecule **_target, MoleculeListClass *_molecules); 100 ~MoleculeQuery();102 virtual ~MoleculeQuery(); 101 103 virtual bool handle()=0; 102 104 virtual void setResult(); … … 111 113 public: 112 114 VectorQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check); 113 ~VectorQuery();115 virtual ~VectorQuery(); 114 116 virtual bool handle()=0; 115 117 virtual void setResult(); … … 122 124 }; 123 125 126 class ElementQuery : public Query { 127 public: 128 ElementQuery(std::string title, element**_target); 129 virtual ~ElementQuery(); 130 virtual bool handle()=0; 131 virtual void setResult(); 132 protected: 133 element *tmp; 134 private: 135 element **target; 136 }; 137 124 138 void registerQuery(Query* query); 125 139 -
src/UIElements/QT4/QTDialog.cpp
r326a43b rcbf01e 21 21 #include <Qt/qcombobox.h> 22 22 23 #include "World.hpp" 24 #include "periodentafel.hpp" 23 25 #include "atom.hpp" 26 #include "element.hpp" 24 27 #include "molecule.hpp" 25 28 … … 95 98 } 96 99 100 void QTDialog::queryElement(const char* title, element **target){ 101 registerQuery(new ElementQTQuery(title,target,inputLayout,this)); 102 } 103 97 104 /************************** Query Objects *******************************/ 98 105 … … 192 199 for(iter = molecules->ListOfMolecules.begin(); 193 200 iter != molecules->ListOfMolecules.end(); 194 iter++) {201 ++iter) { 195 202 stringstream sstr; 196 203 sstr << (*iter)->IndexNr << "\t" << (*iter)->getName(); … … 255 262 256 263 264 QTDialog::ElementQTQuery::ElementQTQuery(std::string _title, element **_target, QBoxLayout *_parent, QTDialog *_dialog) : 265 Dialog::ElementQuery(_title,_target), 266 parent(_parent) 267 { 268 periodentafel *periode = World::get()->getPeriode(); 269 thisLayout = new QHBoxLayout(); 270 titleLabel = new QLabel(QString(getTitle().c_str())); 271 inputBox = new QComboBox(); 272 element* Elemental = 0; 273 for(Elemental = periode->start->next; 274 Elemental!=periode->end; 275 Elemental = Elemental->next) 276 { 277 stringstream sstr; 278 sstr << Elemental->Z << "\t" << Elemental->name; 279 inputBox->addItem(QString(sstr.str().c_str()),QVariant(Elemental->Z)); 280 } 281 parent->addLayout(thisLayout); 282 thisLayout->addWidget(titleLabel); 283 thisLayout->addWidget(inputBox); 284 285 pipe = new ElementQTQueryPipe(&tmp,_dialog,inputBox); 286 pipe->update(inputBox->currentIndex()); 287 connect(inputBox,SIGNAL(currentIndexChanged(int)),pipe,SLOT(update(int))); 288 } 289 290 QTDialog::ElementQTQuery::~ElementQTQuery() 291 { 292 delete pipe; 293 } 294 295 bool QTDialog::ElementQTQuery::handle(){ 296 return true; 297 } 298 257 299 /*************************** Plumbing *******************************/ 258 300 … … 313 355 } 314 356 357 ElementQTQueryPipe::ElementQTQueryPipe(element **_content, QTDialog *_dialog, QComboBox *_theBox) : 358 content(_content), 359 dialog(_dialog), 360 theBox(_theBox) 361 {} 362 363 ElementQTQueryPipe::~ElementQTQueryPipe() 364 {} 365 366 void ElementQTQueryPipe::update(int newIndex) { 367 QVariant data = theBox->itemData(newIndex); 368 int idx = data.toInt(); 369 (*content) = World::get()->getPeriode()->FindElement(idx); 370 dialog->update(); 371 } 372 -
src/UIElements/QT4/QTDialog.hpp
r326a43b rcbf01e 26 26 class DoubleQTQueryPipe; 27 27 class MoleculeQTQueryPipe; 28 class ElementQTQueryPipe; 28 29 29 30 class QTDialog : public QDialog, public Dialog … … 39 40 virtual void queryMolecule(const char*,molecule**,MoleculeListClass*); 40 41 virtual void queryVector(const char*,Vector *,const double *const,bool); 42 virtual void queryElement(const char*,element **); 41 43 42 44 virtual bool display(); … … 48 50 public: 49 51 IntQTQuery(std::string _title, int *_target,QBoxLayout *_parent,QTDialog *_dialog); 50 ~IntQTQuery();52 virtual ~IntQTQuery(); 51 53 virtual bool handle(); 52 54 private: … … 62 64 public: 63 65 DoubleQTQuery(std::string title, double *_target,QBoxLayout *_parent,QTDialog *_dialog); 64 ~DoubleQTQuery();66 virtual ~DoubleQTQuery(); 65 67 virtual bool handle(); 66 68 private: … … 76 78 public: 77 79 StringQTQuery(std::string _title, std::string *_target, QBoxLayout *_parent,QTDialog *_dialog); 78 ~StringQTQuery();80 virtual ~StringQTQuery(); 79 81 virtual bool handle(); 80 82 private: … … 90 92 public: 91 93 MoleculeQTQuery(std::string _title, molecule **_target, MoleculeListClass *_molecules, QBoxLayout *_parent,QTDialog *_dialog); 92 ~MoleculeQTQuery();94 virtual ~MoleculeQTQuery(); 93 95 virtual bool handle(); 94 96 private: … … 104 106 public: 105 107 VectorQTQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check,QBoxLayout *,QTDialog *); 106 ~VectorQTQuery();108 virtual ~VectorQTQuery(); 107 109 virtual bool handle(); 108 110 private: … … 118 120 }; 119 121 122 class ElementQTQuery : public Dialog::ElementQuery { 123 public: 124 ElementQTQuery(std::string _title, element **_target, QBoxLayout *_parent, QTDialog *_dialog); 125 virtual ~ElementQTQuery(); 126 virtual bool handle(); 127 private: 128 QBoxLayout *parent; 129 QBoxLayout *thisLayout; 130 QLabel *titleLabel; 131 QComboBox *inputBox; 132 133 ElementQTQueryPipe *pipe; 134 }; 135 120 136 private: 121 137 QBoxLayout *mainLayout; … … 133 149 public: 134 150 StringQTQueryPipe(std::string *_content, QTDialog *_dialog); 135 ~StringQTQueryPipe();151 virtual ~StringQTQueryPipe(); 136 152 137 153 public slots: … … 148 164 public: 149 165 IntQTQueryPipe(int *_content, QTDialog *_dialog); 150 ~IntQTQueryPipe();166 virtual ~IntQTQueryPipe(); 151 167 152 168 public slots: … … 163 179 public: 164 180 DoubleQTQueryPipe(double *_content, QTDialog *_dialog); 165 ~DoubleQTQueryPipe();181 virtual ~DoubleQTQueryPipe(); 166 182 167 183 public slots: … … 178 194 public: 179 195 MoleculeQTQueryPipe(molecule **_content, QTDialog *_dialog, QComboBox *_theBox, MoleculeListClass *_molecules); 180 ~MoleculeQTQueryPipe();196 virtual ~MoleculeQTQueryPipe(); 181 197 182 198 public slots: … … 190 206 191 207 }; 208 209 class ElementQTQueryPipe : public QWidget { 210 Q_OBJECT 211 public: 212 ElementQTQueryPipe(element **_content, QTDialog *_dialog, QComboBox *_theBox); 213 virtual ~ElementQTQueryPipe(); 214 215 public slots: 216 void update(int); 217 218 private: 219 element **content; 220 QTDialog *dialog; 221 QComboBox *theBox; 222 }; 192 223 #endif /* QTDIALOG_HPP_ */ -
src/UIElements/TextDialog.cpp
r326a43b rcbf01e 10 10 #include "UIElements/TextDialog.hpp" 11 11 12 #include "World.hpp" 13 #include "periodentafel.hpp" 12 14 #include "atom.hpp" 13 15 #include "molecule.hpp" … … 45 47 void TextDialog::queryVector(const char* title, Vector *target,const double *const cellSize, bool check) { 46 48 registerQuery(new VectorTextQuery(title,target,cellSize,check)); 49 } 50 51 void TextDialog::queryElement(const char* title, element **target){ 52 registerQuery(new ElementTextQuery(title,target)); 47 53 } 48 54 … … 113 119 114 120 bool TextDialog::VectorTextQuery::handle() { 121 Log() << Verbose(0) << getTitle(); 115 122 tmp->AskPosition(cellSize,check); 116 123 return true; 117 124 } 125 126 127 TextDialog::ElementTextQuery::ElementTextQuery(std::string title, element **target) : 128 Dialog::ElementQuery(title,target) 129 {} 130 131 TextDialog::ElementTextQuery::~ElementTextQuery() 132 {} 133 134 bool TextDialog::ElementTextQuery::handle() { 135 int Z; 136 Log() << Verbose(0) << getTitle(); 137 cin >> Z; 138 tmp = World::get()->getPeriode()->FindElement(Z); 139 return tmp; 140 } -
src/UIElements/TextDialog.hpp
r326a43b rcbf01e 24 24 virtual void queryMolecule(const char*,molecule**,MoleculeListClass*); 25 25 virtual void queryVector(const char*,Vector *,const double * const,bool); 26 virtual void queryElement(const char*,element **); 26 27 27 28 protected: … … 30 31 public: 31 32 IntTextQuery(std::string title, int *_target); 32 ~IntTextQuery();33 virtual ~IntTextQuery(); 33 34 virtual bool handle(); 34 35 }; … … 37 38 public: 38 39 DoubleTextQuery(std::string title, double *_target); 39 ~DoubleTextQuery();40 virtual ~DoubleTextQuery(); 40 41 virtual bool handle(); 41 42 }; … … 44 45 public: 45 46 StringTextQuery(std::string title, std::string *_target); 46 ~StringTextQuery();47 virtual ~StringTextQuery(); 47 48 virtual bool handle(); 48 49 }; … … 51 52 public: 52 53 MoleculeTextQuery(std::string title, molecule **_target, MoleculeListClass *_molecules); 53 ~MoleculeTextQuery();54 virtual ~MoleculeTextQuery(); 54 55 virtual bool handle(); 55 56 }; … … 58 59 public: 59 60 VectorTextQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check); 60 ~VectorTextQuery(); 61 virtual ~VectorTextQuery(); 62 virtual bool handle(); 63 }; 64 65 class ElementTextQuery : public Dialog::ElementQuery { 66 public: 67 ElementTextQuery(std::string title, element **_target); 68 virtual ~ElementTextQuery(); 61 69 virtual bool handle(); 62 70 }; -
src/UIElements/TextWindow.cpp
r326a43b rcbf01e 36 36 #include "Menu/DisplayMenuItem.hpp" 37 37 #include "Menu/SubMenuItem.hpp" 38 #include "UIElements/TextStatusIndicator.hpp" 38 39 #include "Actions/MethodAction.hpp" 39 40 #include "Actions/ErrorAction.hpp" … … 97 98 98 99 editMoleculesMenu->addDefault(returnItem); 100 101 // Add status indicators etc... 102 103 statusIndicator = new TextStatusIndicator(); 99 104 } 100 105 … … 105 110 delete returnFromEditMoleculeAction; 106 111 delete moleculeView; 112 delete statusIndicator; 107 113 delete main_menu; 108 114 } -
src/UIElements/TextWindow.hpp
r326a43b rcbf01e 15 15 class oldmenu; 16 16 class StringView; 17 class TextStatusIndicator; 17 18 18 19 class TextWindow : public MainWindow … … 31 32 // all views that are contained in the main Menu 32 33 StringView *moleculeView; 34 TextStatusIndicator *statusIndicator; 33 35 34 36 // This class still contains a lot of scattered functionality
Note:
See TracChangeset
for help on using the changeset viewer.