source: PSPA/Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_machine.cc @ 496

Last change on this file since 496 was 496, checked in by lemeur, 10 years ago

deplacement bouton expand machine vers computing view

File size: 2.6 KB
Line 
1#include "GWt_machine.h"
2
3#include <Wt/WPushButton>
4#include <Wt/WLabel>
5#include <Wt/WPanel>
6#include <Wt/WColor>
7#include <Wt/WVBoxLayout>
8#include <Wt/WHBoxLayout>
9#include <Wt/WComboBox>
10
11GWt_machine::GWt_machine(GWt_accelerator* parent,expandedMachine* mach) :
12UI_Accelerator_(parent),
13machineControler_(mach)
14{
15  displayWidgetComputing();
16}
17
18GWt_machine::~GWt_machine()
19{
20}
21
22void GWt_machine::createWidgetComputing(WContainerWidget* parent) {
23
24  // suppress old detailled view if present
25  parent->clear();
26 
27  // add the detailled view
28  WContainerWidget* wdg = new WContainerWidget(parent);
29
30  wdg->setObjectName("machine");
31  wdg->addStyleClass("machinePanel");
32  Wt::WVBoxLayout* vContainerLayout = new WVBoxLayout();
33  vContainerLayout->setContentsMargins(0,0,0,0);
34  Wt::WPanel *collapsiblePanel = new Wt::WPanel(wdg);
35  collapsiblePanel->setTitle("Machine panel");
36  collapsiblePanel->setCollapsible(true);
37 
38  WContainerWidget* menu = new WContainerWidget(wdg);
39  menu->addStyleClass("machineMenu");
40 
41 
42  //  new WLabel(sectorControler_->getName()+" ",menu);
43 
44  WPushButton* actionParameters = new WPushButton("",menu);
45  // set tooltips
46  actionParameters->setToolTip("change parameters");
47 
48  // Set class for actions elements
49  actionParameters->setStyleClass("Button WhiteButton parameters");
50  actionParameters->setMaximumSize(32,32);
51  actionParameters->setMinimumSize(32,32);
52 
53  // expand machine
54  WPushButton* expandMachine = new WPushButton("init/expand machine",menu);
55  // set tooltips
56  expandMachine->setToolTip("expand the machine");
57  // Set class for actions elements
58  expandMachine->setStyleClass("Button WhiteButton expand");
59  expandMachine->setMaximumSize(128,32);
60  expandMachine->setMinimumSize(128,32);
61
62  // action
63    expandMachine->clicked().connect(this,&GWt_machine::expandMachine);
64
65 
66  menu->setWidth(20+7+7+1+1+2);
67 
68  vContainerLayout->addWidget(menu);
69 
70  // Add beamLine for this sector
71  //  UI_beamLine_ = new GWt_ligneFaisceau(getAccelerator()->getDataManager(),this);
72  //  vContainerLayout->addWidget(UI_beamLine_);
73 
74  // add the software panel
75  cout << " GWt_machine::createWidgetComputing APPEL sofwarepanel" << endl;
76    GWt_softwarePanel*  computeWidget = new GWt_softwarePanel(getAccelerator()->getDataManager(),this);
77    vContainerLayout->addWidget(computeWidget);
78 
79
80  wdg->setLayout(vContainerLayout);
81}
82
83void GWt_machine::displayWidgetComputing() {
84  createWidgetComputing(getAccelerator()->getAcceleratorComputingView());
85}
86
87void GWt_machine::expandMachine() {
88  if (getAccelerator()->getDataManager()->expandMachine()) new GWt_machine(getAccelerator(), getAccelerator()->getDataManager()->getCurrentMachine());
89}
Note: See TracBrowser for help on using the repository browser.