Changeset 835a0f
- Timestamp:
- Dec 16, 2009, 12:30:16 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:
- c68025
- Parents:
- a306a2
- git-author:
- Tillmann Crueger <crueger@…> (12/16/09 09:49:55)
- git-committer:
- Frederik Heber <heber@…> (12/16/09 12:30:16)
- Location:
- src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Menu/DisplayMenuItem.cpp
ra306a2 r835a0f 6 6 */ 7 7 8 #include <sstream> 9 #include <cmath> 10 8 11 #include "Menu/DisplayMenuItem.hpp" 9 12 #include "Views/StringView.hpp" 10 13 11 #include <iostream>12 14 13 15 DisplayMenuItem::DisplayMenuItem(Menu* _menu, StringView *_view): 14 16 MenuItem('\0',"",_menu), 15 view(_view) 17 view(_view), 18 title("") 16 19 { 20 } 17 21 22 DisplayMenuItem::DisplayMenuItem(Menu* _menu, StringView *_view, string _title, char _spacer, int _length ): 23 MenuItem('\0',"",_menu), 24 view(_view), 25 title(_title), 26 spacer(_spacer), 27 length(_length) 28 { 18 29 } 19 30 … … 28 39 29 40 const string DisplayMenuItem::formatEntry(){ 30 return view->toString(); 41 stringstream s; 42 if(title.length()>0) { 43 int pre = floor((length-title.length())/2.0); 44 int post = ceil((length-title.length())/2.0); 45 for(int i=0;i<pre;i++) 46 s << spacer; 47 s << title; 48 for(int i=0;i<post;i++) 49 s << spacer; 50 s << "\n"; 51 } 52 s << view->toString(); 53 return s.str(); 31 54 } 32 55 -
src/Menu/DisplayMenuItem.hpp
ra306a2 r835a0f 10 10 11 11 #include "Menu/MenuItem.hpp" 12 #include "defs.hpp" 12 13 13 14 class StringView; … … 17 18 public: 18 19 DisplayMenuItem(Menu* _menu, StringView *_view); 20 DisplayMenuItem(Menu* _menu, StringView *_view, string _title, 21 char _spacer=STD_MENU_TITLE_SPACER, int _length=STD_MENU_LENGTH); 19 22 virtual ~DisplayMenuItem(); 20 23 … … 28 31 private: 29 32 StringView *view; 33 string title; 34 int length; 35 char spacer; 30 36 }; 31 37 -
src/menu.cpp
ra306a2 r835a0f 1229 1229 1230 1230 StringView *moleculeView = new StreamStringView(boost::bind(&MoleculeListClass::Enumerate,molecules,_1)); 1231 new DisplayMenuItem(main_menu,moleculeView );1231 new DisplayMenuItem(main_menu,moleculeView,"Molecule List"); 1232 1232 1233 1233 new SeperatorItem(main_menu); -
src/moleculelist.cpp
ra306a2 r835a0f 142 142 143 143 // header 144 Log() << Verbose(0) << "Index\tName\t\tAtoms\tFormula\tCenter\tSize" << endl;145 Log() << Verbose(0) << "-----------------------------------------------" << endl;144 (*out) << "Index\tName\t\tAtoms\tFormula\tCenter\tSize" << endl; 145 (*out) << "-----------------------------------------------" << endl; 146 146 if (ListOfMolecules.size() == 0) 147 Log() << Verbose(0) << "\tNone" << endl;147 (*out) << "\tNone" << endl; 148 148 else { 149 149 Origin.Zero(); … … 162 162 } 163 163 // output Index, Name, number of atoms, chemical formula 164 Log() << Verbose(0) << ((*ListRunner)->ActiveFlag ? "*" : " ") << (*ListRunner)->IndexNr << "\t" << (*ListRunner)->name << "\t\t" << (*ListRunner)->AtomCount << "\t";164 (*out) << ((*ListRunner)->ActiveFlag ? "*" : " ") << (*ListRunner)->IndexNr << "\t" << (*ListRunner)->name << "\t\t" << (*ListRunner)->AtomCount << "\t"; 165 165 Elemental = (*ListRunner)->elemente->end; 166 166 while(Elemental->previous != (*ListRunner)->elemente->start) { 167 167 Elemental = Elemental->previous; 168 168 if (Counts[Elemental->Z] != 0) 169 Log() << Verbose(0) << Elemental->symbol << Counts[Elemental->Z];169 (*out) << Elemental->symbol << Counts[Elemental->Z]; 170 170 } 171 171 // Center and size 172 Log() << Verbose(0) << "\t" << (*ListRunner)->Center << "\t" << sqrt(size) << endl;172 (*out) << "\t" << (*ListRunner)->Center << "\t" << sqrt(size) << endl; 173 173 } 174 174 }
Note:
See TracChangeset
for help on using the changeset viewer.