19 #include "../wirelabel.h"
23 #include <qlineedit.h>
24 #include <qpushbutton.h>
25 #include <qvalidator.h>
29 : QDialog(parent, 0, true)
31 setCaption(tr(
"Insert Nodename"));
34 gbox =
new QGridLayout(
this,4,3,5,5);
38 Expr1.setPattern(
"[a-zA-Z]([0-9a-zA-Z]|_(?!_))+\\!{0,1}");
39 Validator1 =
new QRegExpValidator(Expr1,
this);
41 QLabel *Label1 =
new QLabel(tr(
"Enter the label:"),
this);
42 gbox->addWidget(Label1,0,0);
47 gbox->addMultiCellWidget(
NodeName,1,1,0,3);
49 Expr2.setPattern(
"[^\"=]+");
50 Validator2 =
new QRegExpValidator(Expr2,
this);
52 Label2 =
new QLabel(tr(
"Initial node voltage:"),
this);
53 gbox->addWidget(Label2,2,0);
57 gbox->addMultiCellWidget(
InitValue,2,2,1,3);
59 ButtonMore =
new QPushButton(tr(
"Less..."),
this);
60 gbox->addWidget(ButtonMore,3,1);
61 ButtonOk =
new QPushButton(tr(
"Ok"),
this);
62 gbox->addWidget(ButtonOk,3,2);
63 ButtonCancel =
new QPushButton(tr(
"Cancel"),
this);
64 gbox->addWidget(ButtonCancel,3,3);
67 if(pLabel)
if(!pLabel->
initValue.isEmpty())
break;
70 ButtonMore->setText(tr(
"More..."));
74 connect(ButtonMore, SIGNAL(clicked()), SLOT(slotExtend()));
75 connect(ButtonOk, SIGNAL(clicked()), SLOT(slotOk()));
76 connect(ButtonCancel, SIGNAL(clicked()), SLOT(slotCancel()));
78 ButtonOk->setDefault(
true);
89 void LabelDialog::slotExtend()
91 if(Label2->isHidden()) {
92 Label2->setHidden(
false);
94 ButtonMore->setText(tr(
"Less..."));
99 ButtonMore->setText(tr(
"More..."));
104 void LabelDialog::slotCancel()
109 void LabelDialog::slotOk()
114 bool changed =
false;