Changeset 47 in PSPA for Interface_Web/trunk/pspaWT


Ignore:
Timestamp:
Oct 30, 2012, 3:46:54 PM (12 years ago)
Author:
garnier
Message:

ajout de ComboBox en dessous des icones

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Interface_Web/trunk/pspaWT/src/LigneFaisceau.cc

    r41 r47  
    66#include <iostream>
    77#include "nomdElements.h"
     8
     9#include <Wt/WComboBox>
     10#include <Wt/WVBoxLayout>
    811
    912LigneFaisceau::LigneFaisceau(PspaApplication* ps):
     
    5154    //  beamLayout_->addWidget(droppedElement_.back());
    5255
     56
     57  WPushButton* dropped = NULL;
     58
    5359  if ( strstr(evt.mimeType().c_str() , "drift") )
    5460    {
     
    5763      GWt_drift* gdrift = new GWt_drift(pspa_,newDrift, evt.mimeType());
    5864
    59       WPushButton* dropped = gdrift->getButton();
     65      dropped = gdrift->getButton();
    6066      //      WDialog* driftDialog = gdrift->getDialog();
    61       beamLayout_->addWidget(dropped);
    6267    }
    6368  else
     
    6974          GWt_initialBeam* gwInitialBeam = new GWt_initialBeam(pspa_,newInitialBeam, evt.mimeType());
    7075
    71           WPushButton* dropped = gwInitialBeam->getButton();
    72           beamLayout_->addWidget(dropped);
     76          dropped = gwInitialBeam->getButton();
    7377        }
    7478      else
     
    7983              abstractElement* newCell = pspa_->getDataManager()->addCell();
    8084              GWt_cell* gwCell = new GWt_cell(pspa_,newCell, evt.mimeType());
    81               WPushButton* dropped = gwCell->getButton();
    82               beamLayout_->addWidget(dropped);
     85              dropped = gwCell->getButton();
    8386            }
    8487          else
     
    8891        }
    8992    }
     93  WVBoxLayout* tempVBox = new WVBoxLayout();
     94
     95  if (!dropped) {
     96    dropped = new WPushButton();
     97    dropped->setIcon(evt.mimeType());
     98    dropped->setMaximumSize(50,50);
     99  }
     100
     101  WComboBox *selectionBox = new WComboBox();
     102  selectionBox->addItem("Parmela");
     103  selectionBox->addItem("Transport");
     104  selectionBox->addItem("Autre");
     105 
     106  selectionBox->setCurrentIndex(1); // Parmela
     107  //  selectionBox->activated().connect(this, &MyWidget::comboChanged);
     108
     109  tempVBox->addWidget(dropped);
     110  tempVBox->addWidget(selectionBox);
     111
     112  WContainerWidget* tempWidget = new WContainerWidget();
     113  tempWidget->setLayout(tempVBox);
     114  beamLayout_->addWidget(tempWidget);
    90115}
Note: See TracChangeset for help on using the changeset viewer.