1
1
////////////////////////////////////////////////////////////////////////////////
2
/*! @file AttrDlg.cpp Редактирование имён атрибутов.
2
/*! @file AttrDlg.cpp Class sAttrDlg.
3
3
- Part of RAGUI - Research Assistant Graphical User Interface.
4
4
- Uses QtGui v.4.6 - http://qt.nokia.com/
5
5
- Uses RANet - Research Assistant Net Library (based on ANSI C++).
135
134
connect(btnSymbolic,SIGNAL(clicked()),fldSymbolicName,SLOT(setFocus()));
137
136
btnAtomic->setEnabled(false);
138
SetAttrName(sAttributeName());
137
SetAttrName(sAttrName());
142
void sAttrDlg::SetAttrName (sAttributeName name)
141
void sAttrDlg::SetAttrName (sAttrName name)
144
143
TheAttrName=name;
145
144
switch( TheAttrName.Type() ){
146
case sAttributeName::NamelessAttr:
145
case sAttrName::cNameless:
147
146
btnNameless->setChecked(true);
148
147
fldAtomId->setVisible(false);
149
148
fldNumber->setVisible(false);
150
149
fldSymbolicName->setVisible(false);
152
case sAttributeName::AtomicAttr:
153
btnAtomic->setChecked(true);
154
fldAtomId->setVisible(true);
155
fldAtomId->setText(literal(TheAttrName.TextWithoutTypeIndication()));
156
fldNumber->setVisible(false);
157
fldSymbolicName->setVisible(false);
159
case sAttributeName::NumericAttr:
151
case sAttrName::cNumeric:
160
152
btnNumeric->setChecked(true);
161
153
fldAtomId->setVisible(false);
162
154
fldNumber->setVisible(true);
163
fldNumber->setValue((unsigned int)TheAttrName);
155
fldNumber->setValue(TheAttrName.ToNumber());
164
156
fldSymbolicName->setVisible(false);
165
157
fldNumber->setFocus();
167
case sAttributeName::SymbolicAttr:
159
case sAttrName::cSymbolic:
168
160
btnSymbolic->setChecked(true);
169
161
fldAtomId->setVisible(false);
170
162
fldNumber->setVisible(false);
171
163
fldSymbolicName->setVisible(true);
172
fldSymbolicName->setText(ToQString(TheAttrName
173
.TextWithoutTypeIndication()));
164
fldSymbolicName->setText(ToQString(TheAttrName.ToString()));
174
165
fldSymbolicName->setFocus();
167
// case sAttrName::cAtomic:
168
// btnAtomic->setChecked(true);
169
// fldAtomId->setVisible(true);
170
// fldAtomId->setText(literal(TheAttrName.TextWithoutTypeIndication()));
171
// fldNumber->setVisible(false);
172
// fldSymbolicName->setVisible(false);
211
209
if( btnAtomic->isChecked() ){
213
211
}else if( btnNumeric->isChecked() ){
214
TheAttrName=sAttributeName(fldNumber->value());
212
TheAttrName=sAttrName(fldNumber->value());
216
214
}else if( btnSymbolic->isChecked() ){
217
215
if( ! fldSymbolicName->text().isEmpty() ){
218
TheAttrName=sAttributeName(FromQString(fldSymbolicName->text()));
216
TheAttrName=sAttrName(FromQString(fldSymbolicName->text()));