Ignore:
Timestamp:
Oct 25, 2013, 3:51:05 PM (11 years ago)
Author:
touze
Message:

preparation pour ajouter une maille FODO

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_pspaApplication.cc

    r424 r427  
    88#include "GWt_softwarePanel.h"
    99#include "GWt_globalParameters.h"
    10 // #include "GWt_dialog.h"
    1110#include "GWt_draggableImage.h"
    1211#include "particleBeam.h"
     
    3635#include <Wt/WRadioButton>
    3736
     37#include <Wt/WPanel>
     38#include <Wt/WMessageBox>
     39
    3840#define HAS_IMAGEMAGIC 1
    3941
     
    7678  useStyleSheet("htdocs/pspa.css");
    7779  dtmanage_ = new dataManager(this);
    78   // dtmanage_->setWorkingDir(workingDir_);
    79  
    80   /*
    81    * The main layout is a 4x3 grid layout.
    82    */
    83   WGridLayout *mainGridLayout = new WGridLayout();
    84   //  layout->addWidget(createTitle("<a href='workingArea/parmin'> Menu (In future)</a>"), 0, 0, 1, 2);
    85   //  layout->addWidget(createTitle("Menu (In future)"), 0, 0, 1, 2);
    86  
     80
     81  // The main layout is a 4x3 grid layout.
     82  WGridLayout *mainGridLayout = new WGridLayout(); 
    8783  WHBoxLayout *toolbarLayout = new WHBoxLayout();
    8884 
     
    10096 
    10197  boutonSauve->setToolTip ("sauvegarder votre configuration");
    102   boutonRestaure->setToolTip (" restaurer la configuration depuis le serveur");
     98  boutonRestaure->setToolTip ("restaurer la configuration depuis le serveur");
    10399  boutonLoadNew->setToolTip ("charger une configuration");
    104100  boutongraphicalAnalysis->setToolTip ("analyse graphique");
     
    118114  boutonSauve->clicked().connect(this, &PspaApplication::sauver);
    119115  boutonRestaure->clicked().connect(this, &PspaApplication::restaurer);
    120   // Upload when the button is clicked.
    121   // React to a succesfull upload.
     116  // Upload when the button is clicked. React to a succesfull upload.
    122117  boutonLoadNew->clicked().connect(this, &PspaApplication::openFileSelector);
    123  
    124118  boutongraphicalAnalysis->clicked().connect(this, &PspaApplication::dialogOnGraphics);
    125  
    126119  boutonTrash->clicked().connect(this, &PspaApplication::removeBeamLine);
    127  
    128120  toolbarLayout->addWidget(boutonSauve , 0,Wt::AlignMiddle);
    129121  toolbarLayout->addWidget(boutonRestaure , 0,Wt::AlignMiddle);
     
    140132  mainGridLayout->addWidget(createPalette(), 2, 0, 4, 1);
    141133
    142  
    143134  WScrollArea* scroll = new  WScrollArea();
    144135  scroll->setWidget(createBeamLine());
    145136  scroll->setMinimumSize(300,150);
    146 
    147137  mainGridLayout->addWidget(scroll, 2, 1, 1, 2);
    148  
    149  
    150   // console_ = new WContainerWidget();
    151   // console_->decorationStyle().setBackgroundColor (WColor("lightgray"));
    152   // console_->setMaximumSize(600,200);
    153   // layout->addWidget(console_, 3, 1);
    154   // console_->setMinimumSize(300,100);
    155   // console_->setOverflow(WContainerWidget::OverflowAuto);
    156  
    157  
     138
    158139  //-----------
     140
    159141  // A supprimer et a mettre en fenetre
    160   globalParam_ = createGlobalParamWidget();
    161   //  leDessin_ = new WContainerWidget();
    162   //  leDessin_ = createDrawingWidget();
     142  // xx globalParam_ = createGlobalParamWidget();
     143  // xx mainGridLayout->addWidget(globalParam_,3,1);
     144
     145  WWidget* dboard = createDashBoard();
     146  dboard->setMinimumSize(300,100);
     147  mainGridLayout->addWidget(dboard,3,1);
     148  //-----------
     149
    163150  graphicsDialog_ = new GWt_dialog("graphical analysis",createDrawingWidget(),false);
    164151  graphicsDialog_->setMinimumSize(400,400);
     
    167154 
    168155  executeWidget_ = new GWt_softwarePanel(dtmanage_,this);
    169  
    170   mainGridLayout->addWidget( globalParam_, 3, 1);
    171   //  layout->addWidget( leDessin_, 3, 2);
    172   mainGridLayout->addWidget( executeWidget_ , 4, 1);
    173   //-----------
     156  executeWidget_->setMinimumSize(400,100);
     157  mainGridLayout->addWidget(executeWidget_,4,1);
    174158 
    175159  console_ = new GWt_console();
    176 
    177   // manage sizes
    178160  console_->setMinimumSize(300,100);
    179   executeWidget_->setMinimumSize(400,100);
    180 
    181   mainGridLayout->addWidget(console_, 3, 2,2,1);
    182  
    183  
    184   /*
    185    * Let row 2 and column 1 take the excess space.
    186    */
    187   mainGridLayout->setRowStretch(4, 1);
    188   mainGridLayout->setColumnStretch(2, 1);
     161  mainGridLayout->addWidget(console_,3,2,2,1);
     162
     163  // Let row 2 and column 1 take the excess space.
     164  mainGridLayout->setRowStretch(4,1);
     165  mainGridLayout->setColumnStretch(2,1);
    189166 
    190167  widroot->setLayout(mainGridLayout);
    191 
    192168  // set auto scrollbar if needed
    193169  widroot->setOverflow(WContainerWidget::OverflowAuto);
    194 
     170}
     171
     172// WWidget* PspaApplication::createGlobalParamWidget()
     173// {
     174//   WContainerWidget* globalParam = new GWt_globalParameters(this);
     175//   globalParam->setMinimumSize(300,100);
     176//   return globalParam;
     177// }
     178
     179WWidget* PspaApplication::createDashBoard()
     180{
     181  WContainerWidget *result = new WContainerWidget();
     182 
     183  WPanel *panel = new WPanel(result);
     184  panel->setTitle("dashboard");
     185 
     186  WContainerWidget *textdiv;
     187  textdiv = new WContainerWidget();
     188  textdiv->setStyleClass("text");
     189 
     190  globalParam_ = new GWt_globalParameters(dtmanage_,textdiv);
     191
     192  WContainerWidget *cnt = new WContainerWidget();
     193  WContainerWidget *buttons = new WContainerWidget();
     194  buttons->setStyleClass("buttons");
     195
     196  WPushButton *button;
     197  button = new WPushButton("globalParameters", buttons);
     198  button->clicked().connect(this, &PspaApplication::messageBox1);
     199 
     200  button = new WPushButton("fodoCells", buttons);
     201  button->clicked().connect(this, &PspaApplication::messageBox2);
     202 
     203  styleSheet().addRule(".buttons","padding: 5px;");
     204  styleSheet().addRule(".text", "padding: 4px 8px");
     205  styleSheet().addRule("body", "margin: 0px;");
     206
     207  cnt->addWidget(buttons);
     208  cnt->addWidget(textdiv);
     209  panel->setCentralWidget(cnt);
     210  return result;
     211}
     212
     213void PspaApplication::messageBox1()
     214{
     215  globalParam_->initilializeDialog();
     216  return;
     217}
     218
     219void PspaApplication::messageBox2()
     220{
     221  return;
    195222}
    196223
     
    203230    new WBreak(palette);
    204231  }
    205 
    206232  return palette; 
    207233}
     
    231257  return beamLine_;
    232258}
    233 
    234 WWidget* PspaApplication::createGlobalParamWidget()
    235 {
    236   WContainerWidget* globalParam = new GWt_globalParameters(this);
    237   globalParam->setMinimumSize(300,100);
    238   return globalParam;
    239 }
    240 
    241259
    242260void PspaApplication::dialogOnGraphics()
     
    639657  new WText(" after element :  " + elementLabel, phaseSpaceDialog->contents());
    640658
    641   for (int k=0 ; k < legende.size(); k++) {
     659  for (int k=0 ; k < (int)legende.size(); k++) {
    642660    new WBreak(phaseSpaceDialog->contents());
    643661    new WText(legende.at(k), phaseSpaceDialog->contents());
     
    10621080  new WText(" after element :  " + elementLabel, w);
    10631081
    1064   for (int k=0 ; k < legende.size(); k++) {
     1082  for (int k=0 ; k < (int)legende.size(); k++) {
    10651083    new WBreak(w);
    10661084    new WText(legende.at(k), w);
Note: See TracChangeset for help on using the changeset viewer.