//!------------------------------------------------------------------------- //! create a colormap dialog widget (not embedded mode) //!------------------------------------------------------------------------- void MEColorMapPort::manageDialog() { // create a dialog widget m_dialog = new QDialog(MEUserInterface::instance()); QVBoxLayout *vbox = new QVBoxLayout(m_dialog); m_dialog->setWindowIcon(MEMainHandler::instance()->pm_logo); QString title = node->getTitle() + ":" + portname; m_dialog->setWindowTitle(MEMainHandler::instance()->generateTitle(title)); connect(m_dialog, SIGNAL(finished(int)), this, SLOT(folderCB())); // add the color map widget m_colorMap->setParent(m_dialog); vbox->addWidget(m_colorMap, 1); // create the dialog buttons QDialogButtonBox *bb = new QDialogButtonBox(); bb->addButton("Apply", QDialogButtonBox::AcceptRole); bb->addButton("Close", QDialogButtonBox::RejectRole); connect(bb, SIGNAL(accepted()), m_colorMap, SLOT(applyCB())); connect(bb, SIGNAL(rejected()), this, SLOT(colorMapClosed())); vbox->addWidget(bb); // user can close the window pressing ESC QAction *m_escape_a = new QAction("Escape", this); m_escape_a->setShortcut(Qt::Key_Escape); connect(m_escape_a, SIGNAL(triggered()), this, SLOT(colorMapClosed())); m_dialog->addAction(m_escape_a); }
//!------------------------------------------------------------------------- //! create a material dialog widget (not embedded mode) //!------------------------------------------------------------------------- void MEMaterialPort::manageDialog() { m_dialog = new QDialog(0); m_dialog->setWindowIcon(MEMainHandler::instance()->pm_logo); QString title = node->getTitle() + ":" + portname; m_dialog->setWindowTitle(MEMainHandler::instance()->generateTitle(title)); connect(m_dialog, SIGNAL(finished(int)), this, SLOT(folderCB())); m_chooser = new MEMaterialChooser(); connect(m_chooser, SIGNAL(materialChanged(const QVector<float> &)), this, SLOT(materialChanged(const QVector<float> &))); m_chooser->setParent(m_dialog); QVBoxLayout *vbox = new QVBoxLayout(m_dialog); vbox->addWidget(m_chooser, 1); // create the dialog buttons QDialogButtonBox *bb = new QDialogButtonBox(); QPushButton *pb = NULL; pb = bb->addButton("Apply", QDialogButtonBox::AcceptRole); pb = bb->addButton("Close", QDialogButtonBox::RejectRole); connect(bb, SIGNAL(accepted()), this, SLOT(applyCB())); connect(bb, SIGNAL(rejected()), this, SLOT(materialMapClosed())); pb = bb->addButton(QDialogButtonBox::Reset); connect(pb, SIGNAL(clicked()), this, SLOT(resetCB())); vbox->addWidget(bb); // user can close the window pressing ESC QAction *m_escape_a = new QAction("Escape", this); m_escape_a->setShortcut(Qt::Key_Escape); connect(m_escape_a, SIGNAL(triggered()), this, SLOT(materialMapClosed())); m_dialog->addAction(m_escape_a); }
inline void edisplayconf::cb_but_kbd_apply_i(Fl_Button*, void*) { applyCB(); }