Changeset 397 in PSPA


Ignore:
Timestamp:
Mar 22, 2013, 4:32:52 PM (11 years ago)
Author:
garnier
Message:

Améliorations de l'interface graphique

Location:
Interface_Web/branches/12_03_12-managerComboBox/pspaWT
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • Interface_Web/branches/12_03_12-managerComboBox/pspaWT/History

    r395 r397  
    66     =========================================================
    77
     822 Mars : Laurent Garnier
     9- GWt_sectionToExecute : Amélioration du layout
     10- GWt_softwarePanel : Suppression de la version avec les lineEdit
     11- Améliorations de l'interface graphique
     12- Restructuration de la console
     13- Remise en ordre des éléments de la barre d'icone à gauche
     14- Toujours quelques problemes à regler sur les comboBox
     15
     16Passage sur les comboBox
    81720 Mars : Laurent Garnier
    918- GWt_LigneFaisceau : renommage
  • Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/controler/include/nomDeLogiciel.h

    r316 r397  
    1919  };
    2020
    21 
     21   
    2222 private:
    2323
  • Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/include/GWt_console.h

    r272 r397  
    1515   
    1616public:
    17     GWt_console();
    18     virtual ~GWt_console();
    19     void addConsoleMessage(WString msg);
     17  GWt_console();
     18  virtual ~GWt_console();
     19  void addConsoleMessage(WString msg);
     20private:
     21  WText* output_;
    2022};
    2123
  • Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/include/GWt_ligneFaisceau.h

    r385 r397  
    8181    void update(int);
    8282
     83    void initializeSoftwares();
     84
    8385    private :
    8486    void manageLineFaisceauLayout();
  • Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/include/GWt_pspaApplication.h

    r381 r397  
    6565  WText* createTitle(const WString&);
    6666  WWidget* createPalette();
    67   void createBeamLine();
     67  WWidget* createBeamLine();
    6868  WWidget* createGlobalParamWidget();
    6969  WWidget* createExecuteWidget();
  • Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/src/GWt_abstractElementFactory.cc

    r343 r397  
    9999{
    100100  vector <GWt_abstractElement*> elems;
    101   if (isDriftElementEnable) {
    102     elems.push_back(new GWt_drift());
     101  if (isRFGunElementEnable) {
     102    elems.push_back(new GWt_rfgun());
    103103  }
    104104  if (isBeamElementEnable) {
    105105    elems.push_back(new GWt_beam());
     106  }
     107  if (isDriftElementEnable) {
     108    elems.push_back(new GWt_drift());
    106109  }
    107110  if (isBendElementEnable) {
     
    111114    elems.push_back(new GWt_cell());
    112115  }
     116  if (isSolenoElementEnable) {
     117    elems.push_back(new GWt_soleno());
     118  }
    113119  if (isFitElementEnable) {
    114120    elems.push_back(new GWt_fit());
    115   }
    116   if (isRFGunElementEnable) {
    117     elems.push_back(new GWt_rfgun());
    118   }
    119   if (isSolenoElementEnable) {
    120     elems.push_back(new GWt_soleno());
    121121  }
    122122  if (isSnapshotElementEnable) {
  • Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/src/GWt_console.cc

    r272 r397  
    33#include <Wt/WApplication>
    44#include <Wt/WText>
     5#include <Wt/WBorder>
     6#include <Wt/WLayout>
     7#include <Wt/WPanel>
     8#include <Wt/WScrollArea>
    59
    610GWt_console::GWt_console()
     
    812{
    913    setObjectName("console");
     14
     15    // le panel
     16    WPanel *panelConsole = new WPanel(this);
     17    WScrollArea* container = new  WScrollArea();
     18   
     19    panelConsole->setTitle(" output");
     20    output_ = new WText(this);
     21    output_->setTextFormat(PlainText);
     22    output_->setInline(false);
     23
     24    container->setWidget(output_);
     25
     26    panelConsole->setCentralWidget(container);
     27    output_->setMinimumSize(270,100);
     28    output_->setMaximumSize(400,400);
     29
     30
    1031}
    1132
     
    1839void GWt_console::addConsoleMessage(WString msg) {
    1940   
    20     WText *w = new WText(this);
    21     w->setTextFormat(PlainText);
    22     w->setText(msg);
    23     w->setInline(false);
     41    output_->setText(output_->text()+msg);
    2442   
    2543    /*
    2644     * Little javascript trick to make sure we scroll along with new content
    2745     */
    28     wApp->doJavaScript(this->jsRef() + ".scrollTop += "
    29                        + this->jsRef() + ".scrollHeight;");
     46    wApp->doJavaScript(output_->jsRef() + ".scrollTop += "
     47                       + output_->jsRef() + ".scrollHeight;");
    3048   
    3149}
  • Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/src/GWt_globalParameters.cc

    r272 r397  
    1818    pspa_ = ps;
    1919    WVBoxLayout* globLayout = new WVBoxLayout();
    20     decorationStyle().setBackgroundColor (WColor("blue"));
    2120    //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
    2221    WContainerWidget *result = new WContainerWidget();
  • Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/src/GWt_ligneFaisceau.cc

    r395 r397  
    99#include "GWt_soleno.h"
    1010#include "GWt_bend.h"
     11#include "nomDeLogiciel.h"
    1112
    1213#include "mixedTools.h"
     
    2425  ligneFaisceauLayout_ = new WHBoxLayout();
    2526  //  decorationStyle().setBackgroundColor (WColor(245,245,245));
    26   setLayout(ligneFaisceauLayout_);
    2727  ligneFaisceauLayout_->setContentsMargins(0,0,0,0);
    2828  ligneFaisceauLayout_->setSpacing(0);
    2929 
     30  setLayout(ligneFaisceauLayout_);
     31
    3032  // set the object name
    31   setObjectName("ligneFaisceau"); 
     33  setObjectName("ligneFaisceau");
    3234  clear();
    3335}
     
    282284}
    283285
     286
     287void GWt_LigneFaisceau::initializeSoftwares(){
     288   
     289  vector <abstractElement*> elems = getAllAbstractElements();
     290    for (int a=0; a< elems.size(); a++) {
     291        elems[a]->setSoftware(nomDeLogiciel::unknownSoftware);
     292    }
     293}
     294
     295
  • Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/src/GWt_pspaApplication.cc

    r381 r397  
    7777 
    7878  /*
    79    * The main layout is a 3x2 grid layout.
     79   * The main layout is a 4x3 grid layout.
    8080   */
    81   WGridLayout *layout = new WGridLayout();
     81  WGridLayout *mainGridLayout = new WGridLayout();
    8282  //  layout->addWidget(createTitle("<a href='workingArea/parmin'> Menu (In future)</a>"), 0, 0, 1, 2);
    8383  //  layout->addWidget(createTitle("Menu (In future)"), 0, 0, 1, 2);
     
    131131  toolbarLayout->addWidget(new WText("") , 1,Wt::AlignMiddle);
    132132 
    133   WContainerWidget * layoutContainer = new WContainerWidget();
    134   layoutContainer->setLayout(toolbarLayout);
    135   layoutContainer->decorationStyle().setBackgroundImage ("/htdocs/fond_toolbar.png");
    136   layout->addWidget(layoutContainer, 1, 0, 1, 2);
    137   layout->addWidget(createPalette(), 2, 0, 4, 1);
    138  
    139   createBeamLine();
     133  WContainerWidget * toolbarLayoutContainer = new WContainerWidget();
     134  toolbarLayoutContainer->setLayout(toolbarLayout);
     135  toolbarLayoutContainer->decorationStyle().setBackgroundImage ("/htdocs/fond_toolbar.png");
     136   
     137  mainGridLayout->addWidget(toolbarLayoutContainer, 1, 0, 1, 3);
     138  mainGridLayout->addWidget(createPalette(), 2, 0, 4, 1);
     139
    140140 
    141141  WScrollArea* scroll = new  WScrollArea();
    142   scroll->setWidget(beamLine_);
    143   layout->addWidget(scroll, 2, 1, 1, 1);
     142  scroll->setWidget(createBeamLine());
     143  scroll->setMinimumSize(300,150);
     144
     145  mainGridLayout->addWidget(scroll, 2, 1, 1, 2);
    144146 
    145147 
     
    151153  // console_->setOverflow(WContainerWidget::OverflowAuto);
    152154 
    153  
    154   console_ = new GWt_console();
    155   console_->clear();
    156   console_->decorationStyle().setBackgroundColor (WColor("lightgray"));
    157   console_->setMaximumSize(600,200);
    158   console_->setMinimumSize(300,100);
    159   console_->setOverflow(WContainerWidget::OverflowAuto);
    160   layout->addWidget(console_, 3, 2);
    161155 
    162156  //-----------
     
    171165  executeWidget_ = new GWt_softwarePanel(dtmanage_,this);
    172166 
    173   layout->addWidget( globalParam_, 3, 1);
     167  mainGridLayout->addWidget( globalParam_, 3, 1);
    174168  //  layout->addWidget( leDessin_, 3, 2);
    175   layout->addWidget( executeWidget_ , 4, 1);
     169  mainGridLayout->addWidget( executeWidget_ , 4, 1);
    176170  //-----------
    177171 
    178   layout->setColumnResizable(1);
    179   layout->setRowResizable(2);
     172  console_ = new GWt_console();
     173
     174  console_->setMinimumSize(300,100);
     175 
     176  mainGridLayout->addWidget(console_, 3, 2,2,1);
     177 
     178 
    180179  /*
    181180   * Let row 2 and column 1 take the excess space.
    182181   */
    183   layout->setRowStretch(2, 1);
    184   layout->setColumnStretch(1, 1);
    185  
    186   widroot->setLayout(layout);
     182  mainGridLayout->setRowStretch(4, 1);
     183  mainGridLayout->setColumnStretch(2, 1);
     184 
     185  widroot->setLayout(mainGridLayout);
     186
     187  // set auto scrollbar if needed
     188  widroot->setOverflow(WContainerWidget::OverflowAuto);
     189
    187190}
    188191
     
    210213}
    211214
    212 void PspaApplication::createBeamLine()
     215Wt::WWidget* PspaApplication::createBeamLine()
    213216{
    214217  extensionFile_= 0;
     
    220223  beamLine_->setMinimumSize(300,100);
    221224  setTitle(applicationDefaultTitle_);
     225
     226  return beamLine_;
    222227}
    223228
     
    225230{
    226231    WContainerWidget* globalParam = new GWt_globalParameters(this);
    227     globalParam->setMaximumSize(600,150);
    228     globalParam->setMinimumSize(600,150);
    229232    return globalParam;
    230233}
  • Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/src/GWt_sectionToExecute.cc

    r396 r397  
    1515softwarePanel(sPanel)
    1616{
    17     Wt::WGridLayout* mainContainerLayout = new Wt::WGridLayout();
     17    Wt::WHBoxLayout* mainContainerLayout = new Wt::WHBoxLayout();
     18    mainContainerLayout->setContentsMargins(0,0,0,0);
     19
     20    Wt::WContainerWidget* labelAndComboContainer = new Wt::WContainerWidget();
     21    Wt::WVBoxLayout* labelAndComboContainerLayout = new Wt::WVBoxLayout();
     22    labelAndComboContainerLayout->setContentsMargins(0,0,0,0);
     23
     24    Wt::WContainerWidget* labelAndComboInsideContainer = new Wt::WContainerWidget();
     25    Wt::WHBoxLayout* labelAndComboInsideContainerLayout = new Wt::WHBoxLayout();
     26    labelAndComboInsideContainerLayout->setContentsMargins(0,0,0,0);
    1827   
    19     mainContainerLayout->addWidget(new Wt::WText(" from : "),0,0);
    20     mainContainerLayout->addWidget(first,0,1);
    21     mainContainerLayout->addWidget(new Wt::WText(" to : "),0,2);
    22     mainContainerLayout->addWidget(last,0,3);
    23     mainContainerLayout->addWidget(soft,0,4);
     28    labelAndComboInsideContainerLayout->addWidget(new Wt::WText(" from : "));
     29    labelAndComboInsideContainerLayout->addWidget(first);
     30    labelAndComboInsideContainerLayout->addWidget(new Wt::WText(" to : "));
     31    labelAndComboInsideContainerLayout->addWidget(last);
     32    labelAndComboInsideContainerLayout->addWidget(soft);
    2433
     34    labelAndComboInsideContainer->setLayout(labelAndComboInsideContainerLayout);
     35
     36    labelAndComboContainerLayout->addWidget(labelAndComboInsideContainer);
     37    labelAndComboContainerLayout->addStretch (10);
     38   
     39    labelAndComboContainer->setLayout(labelAndComboContainerLayout);
     40   
     41    // add label and Combo containers
     42    mainContainerLayout->addWidget(labelAndComboContainer);
     43
     44           
    2545    // add errors and warning layout
    2646    warningsContainer_ = new Wt::WContainerWidget();
     
    4666    imgError->resize(20,20);
    4767   
    48     warningsLabel_ = new Wt::WLabel("--warnings---");
    49     errorsLabel_ = new Wt::WLabel("---errors--");
     68    warningsLabel_ = new Wt::WLabel("");
     69    errorsLabel_ = new Wt::WLabel("");
    5070
    5171    hLayoutContainerWarnings->addWidget(imgWarning);
     
    6585
    6686    // add warnings and errors containers
    67     mainContainerLayout->addWidget(warningsAndErrorsContainer,0,5,2,1);
    68     mainContainerLayout->addWidget(new WLabel("--"),1,1);
     87//    mainContainerLayout->addWidget(warningsAndErrorsContainer);
    6988
    7089    this->setLayout(mainContainerLayout);
     
    7493    lastElement->activated().connect(softwarePanel,&GWt_softwarePanel::updateSections);
    7594    software->activated().connect(softwarePanel,&GWt_softwarePanel::updateSections);
     95
     96    manageWarningsAndErrors();
    7697}
    7798
  • Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc

    r396 r397  
    2525  dtmanage_ = dataManager;
    2626  pspa_ = pspa;
    27   setMaximumSize(600,150);
    28   setMinimumSize(600,150);
    29    
     27 
    3028  // bouton execute
    3129  exec_go_ = new WPushButton("execute!");
     
    4846  // le panel
    4947  WPanel *panelLogiciels = new WPanel(this);
    50   panelLogiciels->setTitle(" sections of beam Line for executing softwares ");
     48  panelLogiciels->setTitle(" sections of beam line for executing softwares ");
    5149 
    5250  contenuSections_ = new WContainerWidget();
     
    303301  bool caMarche = true;
    304302  trivaluedBool tbResume = TBoolOk;
     303
     304  // initialize dataManager
    305305  dtmanage_->initializeExecution();
     306 
     307  // intialize User Interface
     308  if (pspa_->getBeamLine()) {
     309    pspa_->getBeamLine()->initializeSoftwares();
     310  }
     311 
    306312  string diagnostic;
    307313   
Note: See TracChangeset for help on using the changeset viewer.