void SceneSaveLoad::play(GameObject * _game_obj)
{
	game_obj = _game_obj;
	
	button_press = menu->verificaEventos(EGL_CLIQUE_ESQ);

	switch(button_press){
		case 0:
			saveSlot(1);
			break;
		case 1:
			loadSlot(1);
			break;
	}

	button_press = panel->verificaEventos(EGL_CLIQUE_ESQ);
	
	switch(button_press){
		case SceneActual::WORKSHOP:
			nextScene(SceneActual::WORKSHOP);
			break;
	}

	if(key[SDLK_ESCAPE]){
        game_obj->exit = true;
    }
}
CQGnuPlotDataDialog::
CQGnuPlotDataDialog(CQGnuPlotMainWindow *window, const CGnuPlotFile &file) :
 window_(window)
{
  setWindowTitle("Data Dialog");

  setObjectName("dataDialog");

  enum_ = new CQGnuPlotEnum;

  enum_->setPlotStyle(CQGnuPlotEnum::PlotLinesPoints);

  QVBoxLayout *layout = new QVBoxLayout(this);
  layout->setMargin(2); layout->setSpacing(2);

  //------

  QGroupBox *loadGroup = new QGroupBox("File Data");

  QVBoxLayout *loadLayout = new QVBoxLayout(loadGroup);
  loadLayout->setMargin(2); loadLayout->setSpacing(2);

  layout->addWidget(loadGroup);

  //--

  QHBoxLayout *fileLayout = new QHBoxLayout;
  fileLayout->setMargin(2); fileLayout->setSpacing(2);

  fileEdit_ = new CQGnuPlotFilename;

  fileEdit_->setName(file.fileName().c_str());
  fileEdit_->setPattern("Text (*.txt);; CSV (*.csv);; File (*.*);; All (*)");

  QPushButton *loadButton = new QPushButton("Load");

  connect(loadButton, SIGNAL(clicked()), this, SLOT(loadSlot()));

  fileLayout->addWidget(new QLabel("File"));
  fileLayout->addWidget(fileEdit_);
  fileLayout->addWidget(loadButton);

  loadLayout->addLayout(fileLayout);

  //------

  QHBoxLayout *numberLayout = new QHBoxLayout;
  numberLayout->setMargin(2); numberLayout->setSpacing(2);

  numberEdit_ = new CQIntegerSpin;

  numberEdit_->setValue(100);

  QPushButton *generateButton = new QPushButton("Generate");

  connect(generateButton, SIGNAL(clicked()), this, SLOT(generateSlot()));

  numberLayout->addWidget(generateButton);
  numberLayout->addWidget(numberEdit_);
  numberLayout->addWidget(new QLabel("Points"));
  numberLayout->addStretch(1);

  loadLayout->addLayout(numberLayout);

  //------

  QHBoxLayout *formatLayout = new QHBoxLayout;
  formatLayout->setMargin(2); formatLayout->setSpacing(2);

  formatLayout->addWidget(csvCheck_ = new QCheckBox("CSV"));
  formatLayout->addWidget(headerCheck_ = new QCheckBox("Header"));
  formatLayout->addStretch(1);

  loadLayout->addLayout(formatLayout);

  //------

  QHBoxLayout *separatorLayout = new QHBoxLayout;
  separatorLayout->setMargin(2); separatorLayout->setSpacing(2);

  separatorLayout->addWidget(new QLabel("Separator"));
  separatorLayout->addWidget(separatorEdit_ = new QLineEdit);
  separatorLayout->addStretch(1);

  loadLayout->addLayout(separatorLayout);

  char sepChar = file.separator();

  std::string sepStr(&sepChar, 1);

  separatorEdit_->setText(sepStr.c_str());

  //------

  QHBoxLayout *missingLayout = new QHBoxLayout;
  missingLayout->setMargin(2); missingLayout->setSpacing(2);

  missingLayout->addWidget(new QLabel("Missing"));
  missingLayout->addWidget(missingEdit_ = new QLineEdit);
  missingLayout->addStretch(1);

  loadLayout->addLayout(missingLayout);

  missingEdit_->setText(file.missingStr().c_str());

  //------

  tree_ = new CQGnuPlotDataTree(file);

  layout->addWidget(tree_);

  //------

  QGroupBox *filterGroup = new QGroupBox("Filter Data");

  QVBoxLayout *filterLayout = new QVBoxLayout(filterGroup);
  filterLayout->setMargin(2); filterLayout->setSpacing(2);

  layout->addWidget(filterGroup);

  //--

  QHBoxLayout *usingLayout = new QHBoxLayout;
  usingLayout->setMargin(2); usingLayout->setSpacing(2);

  usingLayout->addWidget(new QLabel("Using"));
  usingLayout->addWidget(usingEdit_ = new QLineEdit);

  filterLayout->addLayout(usingLayout);

  usingEdit_->setText(window_->qapp()->usingString().c_str());

  //--

  QHBoxLayout *indexLayout = new QHBoxLayout;
  indexLayout->setMargin(2); indexLayout->setSpacing(2);

  indexLayout->addWidget(new QLabel("Index"));
  indexLayout->addWidget(indexEdit_ = new QLineEdit);

  filterLayout->addLayout(indexLayout);

  //--

  QHBoxLayout *everyLayout = new QHBoxLayout;
  everyLayout->setMargin(2); everyLayout->setSpacing(2);

  everyLayout->addWidget(new QLabel("Every"));
  everyLayout->addWidget(everyEdit_ = new QLineEdit);

  filterLayout->addLayout(everyLayout);

  //--

  QHBoxLayout *whereLayout = new QHBoxLayout;
  whereLayout->setMargin(2); whereLayout->setSpacing(2);

  whereLayout->addWidget(new QLabel("Where"));
  whereLayout->addWidget(whereEdit_ = new QLineEdit);

  filterLayout->addLayout(whereLayout);

  //--

  QHBoxLayout *filterOptionsLayout = new QHBoxLayout;
  filterOptionsLayout->setMargin(2); filterOptionsLayout->setSpacing(2);

  filterOptionsLayout->addWidget(averageCheck_ = new QCheckBox("Average"));
  filterOptionsLayout->addWidget(summedCheck_  = new QCheckBox("Summed" ));
  filterOptionsLayout->addStretch(1);

  filterLayout->addLayout(filterOptionsLayout);

  //------

  QGroupBox *plotGroup = new QGroupBox("Plot Style");

  QVBoxLayout *plotPlayout = new QVBoxLayout(plotGroup);
  plotPlayout->setMargin(2); plotPlayout->setSpacing(2);

  layout->addWidget(plotGroup);

  //--

  enum_->setPlotStyle(CQGnuPlotEnum::plotStyleConv(window_->qapp()->plotStyle()));

  QHBoxLayout *styleLayout = new QHBoxLayout;
  styleLayout->setMargin(2); styleLayout->setSpacing(2);

  CQEnumCombo *styleCombo = new CQEnumCombo(this, enum_, "plotStyle");

  styleLayout->addWidget(new QLabel("Style"));
  styleLayout->addWidget(styleCombo);
  styleLayout->addStretch(1);

  plotPlayout->addLayout(styleLayout);

  //--

  QHBoxLayout *dimensionLayout = new QHBoxLayout;
  dimensionLayout->setMargin(2); dimensionLayout->setSpacing(2);

  dimensionLayout->addWidget(new QLabel("Dimension"));
  dimensionLayout->addWidget(dimension2DRadio_ = new QRadioButton("2D"));
  dimensionLayout->addWidget(dimension3DRadio_ = new QRadioButton("3D"));
  dimensionLayout->addStretch(1);

  dimension2DRadio_->setChecked(true);

  plotPlayout->addLayout(dimensionLayout);

  //--

  QHBoxLayout *lineStyleLayout = new QHBoxLayout;
  lineStyleLayout->setMargin(2); lineStyleLayout->setSpacing(2);

  lineStyleLayout->addWidget(new QLabel("Line Style"));
  lineStyleLayout->addWidget(lineTypeEdit_ = new CQIntegerSpin);
  lineStyleLayout->addStretch(1);

  lineTypeEdit_->setValue(-1);

  plotPlayout->addLayout(lineStyleLayout);

  //--

  QHBoxLayout *plotButtonsLayout = new QHBoxLayout;
  plotButtonsLayout->setMargin(2); plotButtonsLayout->setSpacing(2);

  QPushButton *filterButton      = new QPushButton("Filter");
  QPushButton *overlayPlotButton = new QPushButton("Overlay Plot");
  QPushButton *addPlotButton     = new QPushButton("Add Plot");

  connect(filterButton     , SIGNAL(clicked()), this, SLOT(filterSlot()));
  connect(overlayPlotButton, SIGNAL(clicked()), this, SLOT(overlayPlotSlot()));
  connect(addPlotButton    , SIGNAL(clicked()), this, SLOT(addPlotSlot()));

  plotButtonsLayout->addWidget(filterButton);
  plotButtonsLayout->addWidget(overlayPlotButton);
  plotButtonsLayout->addWidget(addPlotButton);
  plotButtonsLayout->addStretch(1);

  layout->addLayout(plotButtonsLayout);

  //---

  QHBoxLayout *buttonLayout = new QHBoxLayout;
  buttonLayout->setMargin(2); buttonLayout->setSpacing(2);

  buttonLayout->addStretch(1);

  QPushButton *closeButton  = new QPushButton("Close");

  buttonLayout->addWidget(closeButton);

  connect(closeButton, SIGNAL(clicked()), this, SLOT(closeSlot()));

  layout->addLayout(buttonLayout);
}