Ejemplo n.º 1
0
// ******************************************************************************************
// Create the widget
// ******************************************************************************************
LoadPathWidget::LoadPathWidget( const std::string &title, const std::string &instructions,
                                const bool dir_only, const bool load_only, QWidget* parent )
  : QFrame(parent), dir_only_(dir_only), load_only_(load_only)
{
  // Set frame graphics
  setFrameShape(QFrame::StyledPanel);
  setFrameShadow(QFrame::Raised);
  setLineWidth(1);
  setMidLineWidth(0);

  // Basic widget container
  QVBoxLayout *layout = new QVBoxLayout(this);

  // Horizontal layout splitter
  QHBoxLayout *hlayout = new QHBoxLayout();

  // Widget Title
  QLabel * widget_title = new QLabel(this);
  widget_title->setText( title.c_str() );
  QFont widget_title_font( "Arial", 12, QFont::Bold );
  widget_title->setFont(widget_title_font);
  layout->addWidget( widget_title);
  layout->setAlignment( widget_title, Qt::AlignTop);

  // Widget Instructions
  QLabel * widget_instructions = new QLabel(this);
  widget_instructions->setText( instructions.c_str() );
  widget_instructions->setWordWrap(true);
  widget_instructions->setTextFormat( Qt::RichText );
  layout->addWidget( widget_instructions);
  layout->setAlignment( widget_instructions, Qt::AlignTop);

  // Line Edit
  path_box_ = new QLineEdit(this);
  hlayout->addWidget(path_box_);

  // Button
  QPushButton *browse_button = new QPushButton(this);
  browse_button->setText("Browse");
  connect( browse_button, SIGNAL( clicked() ), this, SLOT( btn_file_dialog() ) );
  hlayout->addWidget(browse_button);

  // Add horizontal layer to verticle layer
  layout->addLayout(hlayout);

  setLayout(layout);
}
// ******************************************************************************************
// Create the widget
// ******************************************************************************************
SelectModeWidget::SelectModeWidget( QWidget* parent )
  : QFrame(parent)
{
  // Set frame graphics
  setFrameShape(QFrame::StyledPanel);
  setFrameShadow(QFrame::Raised);
  setLineWidth(1);
  setMidLineWidth(0);

  // Basic widget container
  QVBoxLayout *layout = new QVBoxLayout(this);

  // Horizontal layout splitter
  QHBoxLayout *hlayout = new QHBoxLayout();

  // Widget Title
  QLabel * widget_title = new QLabel(this);
  widget_title->setText( "Choose mode:" );
  QFont widget_title_font( "Arial", 12, QFont::Bold );
  widget_title->setFont(widget_title_font);
  layout->addWidget( widget_title);
  layout->setAlignment( widget_title, Qt::AlignTop);

  // Widget Instructions
  QLabel * widget_instructions = new QLabel(this);
  widget_instructions->setText( "All settings for MoveIt are stored in a Moveit configuration package. Here you have the option to create a new configuration package, or load an existing one. Note: any changes to a MoveIt configuration package outside this setup assistant will likely be overwritten by this tool." );
  widget_instructions->setWordWrap(true);
  //widget_instructions->setMinimumWidth(1);
  widget_instructions->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
  layout->addWidget( widget_instructions);
  layout->setAlignment( widget_instructions, Qt::AlignTop);

  // New Button
  btn_new_ = new QPushButton(this);
  btn_new_->setText("Create &New MoveIt\nConfiguration Package");
  hlayout->addWidget( btn_new_ );

  // Exist Button
  btn_exist_ = new QPushButton(this);
  btn_exist_->setText("&Edit Existing MoveIt\nConfiguration Package");
  hlayout->addWidget( btn_exist_ );

  // Add horizontal layer to verticle layer
  layout->addLayout(hlayout);
  setLayout(layout);
}