Exemplo n.º 1
0
static gboolean backspace_key_clicked(GtkWidget *widget, GdkEventKey *event, XmiMsimGuiLayerDialog *dialog) {
  if (event->keyval == gdk_keyval_from_name("BackSpace")) {
    remove_button_clicked(NULL, dialog);
    return TRUE;
  }
  return FALSE;
}
Exemplo n.º 2
0
btNodeEditWidget::btNodeEditWidget(QWidget * parent)
{
    Q_UNUSED(parent)
    model = 0;
    m_selectedNode = 0;
    mainLayout      = new QVBoxLayout(this);
    buttonLayout    = new QHBoxLayout();
    editLayout      = new QGridLayout();

    name            = new QLabel(tr("Name"));
    classname       = new QLabel(tr("Classname"));
    description     = new QLabel(tr("Description"));
    properties      = new QLabel(tr("Properties"));

    QRegExp re("[A-Za-z]{1,1}[A-Za-z0-9_]{0,}");
    QRegExpValidator* v = new QRegExpValidator(re, this);
    nameedit        = new QLineEdit();
    classnameedit   = new QLineEdit();
    classnameedit->setValidator(v);
    descriptionedit = new QLineEdit();

    add_button      = new QPushButton(tr("Add Property"));
    remove_button   = new QPushButton(tr("Remove Property"));

    propertyList    = new QTableView();

    editLayout->addWidget(name,0,0);
    editLayout->addWidget(nameedit,0,1);
    editLayout->addWidget(classname,0,2);
    editLayout->addWidget(classnameedit,0,3);
    editLayout->addWidget(description,1,0);
    editLayout->addWidget(descriptionedit,1,1,1,3);

    buttonLayout->addStretch();
    buttonLayout->addWidget(add_button);
    buttonLayout->addWidget(remove_button);

    mainLayout->addLayout(editLayout);
    mainLayout->addWidget(properties);
    mainLayout->addWidget(propertyList);
    mainLayout->addLayout(buttonLayout);

    connectSignals();

    connect(classnameedit, SIGNAL(textChanged(QString)), this, SLOT(classnameEdited(QString)));
    connect(descriptionedit, SIGNAL(textChanged(QString)), this, SLOT(descriptionEdited(QString)));
    connect(add_button,SIGNAL(clicked()),this,SLOT(add_button_clicked()));
    connect(remove_button,SIGNAL(clicked()),this,SLOT(remove_button_clicked()));

    delegate = new btQListDeletgate(this);
    propertyList->setItemDelegateForColumn(1, delegate);
}