Added Preview tab.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2017-08-12 13:19:13 +03:00
parent 0c13d610eb
commit 4aa002f510
3 changed files with 306 additions and 224 deletions

View File

@ -58,7 +58,8 @@ DialogEditLabel::DialogEditLabel(QWidget *parent)
connect(ui->toolButtonTextLeft, &QToolButton::toggled, this, &DialogEditLabel::SaveTextFormating); connect(ui->toolButtonTextLeft, &QToolButton::toggled, this, &DialogEditLabel::SaveTextFormating);
connect(ui->toolButtonTextCenter, &QToolButton::toggled, this, &DialogEditLabel::SaveTextFormating); connect(ui->toolButtonTextCenter, &QToolButton::toggled, this, &DialogEditLabel::SaveTextFormating);
connect(ui->toolButtonTextRight, &QToolButton::toggled, this, &DialogEditLabel::SaveTextFormating); connect(ui->toolButtonTextRight, &QToolButton::toggled, this, &DialogEditLabel::SaveTextFormating);
connect(ui->listWidget, &QListWidget::itemSelectionChanged, this, &DialogEditLabel::ShowLineDetails); connect(ui->listWidgetEdit, &QListWidget::itemSelectionChanged, this, &DialogEditLabel::ShowLineDetails);
connect(ui->tabWidget, &QTabWidget::currentChanged, this, &DialogEditLabel::TabChanged);
connect(ui->toolButtonNewLabel, &QToolButton::clicked, this, &DialogEditLabel::NewTemplate); connect(ui->toolButtonNewLabel, &QToolButton::clicked, this, &DialogEditLabel::NewTemplate);
connect(ui->toolButtonExportLabel, &QToolButton::clicked, this, &DialogEditLabel::ExportTemplate); connect(ui->toolButtonExportLabel, &QToolButton::clicked, this, &DialogEditLabel::ExportTemplate);
connect(ui->toolButtonImportLabel, &QToolButton::clicked, this, &DialogEditLabel::ImportTemplate); connect(ui->toolButtonImportLabel, &QToolButton::clicked, this, &DialogEditLabel::ImportTemplate);
@ -78,14 +79,13 @@ DialogEditLabel::~DialogEditLabel()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogEditLabel::ShowLineDetails() void DialogEditLabel::ShowLineDetails()
{ {
if (ui->listWidget->count() > 0) if (ui->listWidgetEdit->count() > 0)
{ {
const QListWidgetItem *line = ui->listWidget->currentItem(); const QListWidgetItem *line = ui->listWidgetEdit->currentItem();
if (line) if (line)
{ {
ui->lineEditLine->blockSignals(true); ui->lineEditLine->blockSignals(true);
ui->lineEditLine->setText(line->text()); ui->lineEditLine->setText(line->text());
ui->lineEditLine->setFocus();
ui->lineEditLine->blockSignals(false); ui->lineEditLine->blockSignals(false);
const QFont lineFont = line->font(); const QFont lineFont = line->font();
@ -135,28 +135,28 @@ void DialogEditLabel::ShowLineDetails()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogEditLabel::AddLine() void DialogEditLabel::AddLine()
{ {
int row = ui->listWidget->currentRow(); int row = ui->listWidgetEdit->currentRow();
ui->listWidget->insertItem(++row, new QListWidgetItem(tr("<empty>"))); ui->listWidgetEdit->insertItem(++row, new QListWidgetItem(tr("<empty>")));
ui->listWidget->setCurrentRow(row); ui->listWidgetEdit->setCurrentRow(row);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogEditLabel::RemoveLine() void DialogEditLabel::RemoveLine()
{ {
ui->listWidget->blockSignals(true); ui->listWidgetEdit->blockSignals(true);
QListWidgetItem *curLine = ui->listWidget->takeItem(ui->listWidget->currentRow()); QListWidgetItem *curLine = ui->listWidgetEdit->takeItem(ui->listWidgetEdit->currentRow());
if (curLine) if (curLine)
{ {
delete curLine; delete curLine;
} }
ui->listWidget->blockSignals(false); ui->listWidgetEdit->blockSignals(false);
ShowLineDetails(); ShowLineDetails();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogEditLabel::SaveLineText(const QString &text) void DialogEditLabel::SaveLineText(const QString &text)
{ {
QListWidgetItem *curLine = ui->listWidget->currentItem(); QListWidgetItem *curLine = ui->listWidgetEdit->currentItem();
if (curLine) if (curLine)
{ {
curLine->setText(text); curLine->setText(text);
@ -166,7 +166,7 @@ void DialogEditLabel::SaveLineText(const QString &text)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogEditLabel::SaveFontStyle(bool checked) void DialogEditLabel::SaveFontStyle(bool checked)
{ {
QListWidgetItem *curLine = ui->listWidget->currentItem(); QListWidgetItem *curLine = ui->listWidgetEdit->currentItem();
if (curLine) if (curLine)
{ {
QFont lineFont = curLine->font(); QFont lineFont = curLine->font();
@ -191,7 +191,7 @@ void DialogEditLabel::SaveFontStyle(bool checked)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogEditLabel::SaveTextFormating(bool checked) void DialogEditLabel::SaveTextFormating(bool checked)
{ {
QListWidgetItem *curLine = ui->listWidget->currentItem(); QListWidgetItem *curLine = ui->listWidgetEdit->currentItem();
if (curLine) if (curLine)
{ {
QToolButton *button = qobject_cast<QToolButton *>(sender()); QToolButton *button = qobject_cast<QToolButton *>(sender());
@ -254,7 +254,7 @@ void DialogEditLabel::SaveTextFormating(bool checked)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogEditLabel::NewTemplate() void DialogEditLabel::NewTemplate()
{ {
if (ui->listWidget->count() > 0) if (ui->listWidgetEdit->count() > 0)
{ {
const QMessageBox::StandardButton answer = QMessageBox::question(this, tr("Create new template"), const QMessageBox::StandardButton answer = QMessageBox::question(this, tr("Create new template"),
tr("Creating new template will overwrite the current, do " tr("Creating new template will overwrite the current, do "
@ -266,9 +266,9 @@ void DialogEditLabel::NewTemplate()
} }
} }
ui->listWidget->blockSignals(true); ui->listWidgetEdit->blockSignals(true);
ui->listWidget->clear(); ui->listWidgetEdit->clear();
ui->listWidget->blockSignals(false); ui->listWidgetEdit->blockSignals(false);
ShowLineDetails(); ShowLineDetails();
} }
@ -333,7 +333,7 @@ void DialogEditLabel::ExportTemplate()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogEditLabel::ImportTemplate() void DialogEditLabel::ImportTemplate()
{ {
if (ui->listWidget->count() > 0) if (ui->listWidgetEdit->count() > 0)
{ {
const QMessageBox::StandardButton answer = QMessageBox::question(this, tr("Import template"), const QMessageBox::StandardButton answer = QMessageBox::question(this, tr("Import template"),
tr("Import template will overwrite the current, do " tr("Import template will overwrite the current, do "
@ -358,7 +358,7 @@ void DialogEditLabel::ImportTemplate()
{ {
VLabelTemplate ltemplate; VLabelTemplate ltemplate;
ltemplate.setXMLContent(VLabelTemplateConverter(fileName).Convert()); ltemplate.setXMLContent(VLabelTemplateConverter(fileName).Convert());
InitLines(ltemplate.ReadLines()); InitEditLines(ltemplate.ReadLines());
} }
catch (VException &e) catch (VException &e)
{ {
@ -378,10 +378,26 @@ void DialogEditLabel::InsertPlaceholder()
} }
} }
//---------------------------------------------------------------------------------------------------------------------
void DialogEditLabel::TabChanged(int index)
{
if (index == ui->tabWidget->indexOf(ui->tabPreview))
{
ui->toolButtonNewLabel->setDisabled(true);
ui->toolButtonImportLabel->setDisabled(true);
InitPreviewLines(PrepareLines());
}
else
{
ui->toolButtonNewLabel->setEnabled(ui->listWidgetEdit->count() > 0);
ui->toolButtonImportLabel->setEnabled(true);
}
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogEditLabel::SetupControls() void DialogEditLabel::SetupControls()
{ {
const bool enabled = ui->listWidget->count() > 0; const bool enabled = ui->listWidgetEdit->count() > 0;
if (not enabled) if (not enabled)
{ {
@ -426,14 +442,26 @@ void DialogEditLabel::InitPlaceholders()
m_placeholders.insert("%date%", qMakePair(tr("Date"), locale.toString(QDate::currentDate(), "dd MMMM yyyy"))); m_placeholders.insert("%date%", qMakePair(tr("Date"), locale.toString(QDate::currentDate(), "dd MMMM yyyy")));
} }
//---------------------------------------------------------------------------------------------------------------------
QString DialogEditLabel::ReplacePlaceholders(QString line) const
{
auto i = m_placeholders.constBegin();
while (i != m_placeholders.constEnd())
{
line.replace(i.key(), i.value().second);
++i;
}
return line;
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QVector<VLabelTemplateLine> DialogEditLabel::PrepareLines() const QVector<VLabelTemplateLine> DialogEditLabel::PrepareLines() const
{ {
QVector<VLabelTemplateLine> lines; QVector<VLabelTemplateLine> lines;
for (int i=0; i<ui->listWidget->count(); ++i) for (int i=0; i<ui->listWidgetEdit->count(); ++i)
{ {
const QListWidgetItem *lineItem = ui->listWidget->item(i); const QListWidgetItem *lineItem = ui->listWidgetEdit->item(i);
if (lineItem) if (lineItem)
{ {
VLabelTemplateLine line; VLabelTemplateLine line;
@ -452,10 +480,10 @@ QVector<VLabelTemplateLine> DialogEditLabel::PrepareLines() const
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogEditLabel::InitLines(const QVector<VLabelTemplateLine> &lines) void DialogEditLabel::InitEditLines(const QVector<VLabelTemplateLine> &lines)
{ {
ui->listWidget->blockSignals(true); ui->listWidgetEdit->blockSignals(true);
ui->listWidget->clear(); ui->listWidgetEdit->clear();
int row = -1; int row = -1;
@ -469,13 +497,39 @@ void DialogEditLabel::InitLines(const QVector<VLabelTemplateLine> &lines)
font.setItalic(lines.at(i).italic); font.setItalic(lines.at(i).italic);
item->setFont(font); item->setFont(font);
ui->listWidget->insertItem(++row, item); ui->listWidgetEdit->insertItem(++row, item);
} }
ui->listWidget->blockSignals(false); ui->listWidgetEdit->blockSignals(false);
if (ui->listWidget->count() > 0) if (ui->listWidgetEdit->count() > 0)
{ {
ui->listWidget->setCurrentRow(0); ui->listWidgetEdit->setCurrentRow(0);
}
}
//---------------------------------------------------------------------------------------------------------------------
void DialogEditLabel::InitPreviewLines(const QVector<VLabelTemplateLine> &lines)
{
ui->listWidgetPreview->clear();
int row = -1;
for (int i=0; i<lines.size(); ++i)
{
QListWidgetItem *item = new QListWidgetItem(ReplacePlaceholders(lines.at(i).line));
item->setTextAlignment(lines.at(i).alignment);
QFont font = item->font();
font.setBold(lines.at(i).bold);
font.setItalic(lines.at(i).italic);
item->setFont(font);
ui->listWidgetPreview->insertItem(++row, item);
}
if (ui->listWidgetPreview->count() > 0)
{
ui->listWidgetPreview->setCurrentRow(0);
} }
} }

View File

@ -59,6 +59,7 @@ private slots:
void ExportTemplate(); void ExportTemplate();
void ImportTemplate(); void ImportTemplate();
void InsertPlaceholder(); void InsertPlaceholder();
void TabChanged(int index);
private: private:
Q_DISABLE_COPY(DialogEditLabel) Q_DISABLE_COPY(DialogEditLabel)
@ -71,8 +72,11 @@ private:
void InitPlaceholdersMenu(); void InitPlaceholdersMenu();
void InitPlaceholders(); void InitPlaceholders();
QString ReplacePlaceholders(QString line) const;
QVector<VLabelTemplateLine> PrepareLines() const; QVector<VLabelTemplateLine> PrepareLines() const;
void InitLines(const QVector<VLabelTemplateLine> &lines); void InitEditLines(const QVector<VLabelTemplateLine> &lines);
void InitPreviewLines(const QVector<VLabelTemplateLine> &lines);
}; };
#endif // DIALOGEDITLABEL_H #endif // DIALOGEDITLABEL_H

View File

@ -9,8 +9,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>494</width> <width>437</width>
<height>384</height> <height>464</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -23,7 +23,7 @@
<property name="modal"> <property name="modal">
<bool>true</bool> <bool>true</bool>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_9"> <layout class="QHBoxLayout" name="horizontalLayout_9">
<item> <item>
@ -108,209 +108,233 @@
</layout> </layout>
</item> </item>
<item> <item>
<widget class="QListWidget" name="listWidget"> <widget class="QTabWidget" name="tabWidget">
<property name="sizePolicy"> <property name="currentIndex">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <number>0</number>
<horstretch>0</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property> </property>
<property name="dragDropMode"> <widget class="QWidget" name="tabEdit">
<enum>QAbstractItemView::InternalMove</enum> <attribute name="title">
</property> <string>Edit</string>
</widget> </attribute>
</item> <layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_11">
<property name="spacing">
<number>6</number>
</property>
<item> <item>
<widget class="QToolButton" name="toolButtonBold"> <widget class="QListWidget" name="listWidgetEdit">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string comment="Font formating">Bold</string>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset theme="format-text-bold">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButtonItalic">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string comment="Font formating">Italic</string>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset theme="format-text-italic">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButtonTextLeft">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Aligns with the left edge</string>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset theme="format-justify-left">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButtonTextCenter">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Centers horizontally in the available space</string>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset theme="format-justify-center">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButtonTextRight">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Aligns with the right edge</string>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset theme="format-justify-right">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item alignment="Qt::AlignRight">
<widget class="QToolButton" name="toolButtonAdd">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>1</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text"> <property name="dragDropMode">
<string notr="true">...</string> <enum>QAbstractItemView::InternalMove</enum>
</property>
<property name="icon">
<iconset theme="list-add">
<normaloff>../../../../app/valentina/dialogs</normaloff>../../../../app/valentina/dialogs</iconset>
</property>
</widget>
</item>
<item alignment="Qt::AlignLeft">
<widget class="QToolButton" name="toolButtonRemove">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset theme="list-remove">
<normaloff>../../../../app/valentina/dialogs</normaloff>../../../../app/valentina/dialogs</iconset>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Text:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="VLineEdit" name="lineEditLine">
<property name="enabled">
<bool>false</bool>
</property>
<property name="placeholderText">
<string>Line of text</string>
</property>
<property name="clearButtonEnabled">
<bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="pushButtonInsert"> <layout class="QFormLayout" name="formLayout">
<property name="enabled"> <item row="0" column="1">
<bool>false</bool> <layout class="QHBoxLayout" name="horizontalLayout_11">
</property> <property name="spacing">
<property name="toolTip"> <number>6</number>
<string>Insert placeholders</string> </property>
</property> <item>
<property name="text"> <widget class="QToolButton" name="toolButtonBold">
<string>Insert...</string> <property name="enabled">
</property> <bool>false</bool>
</widget> </property>
<property name="toolTip">
<string comment="Font formating">Bold</string>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset theme="format-text-bold">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButtonItalic">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string comment="Font formating">Italic</string>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset theme="format-text-italic">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButtonTextLeft">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Aligns with the left edge</string>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset theme="format-justify-left">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButtonTextCenter">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Centers horizontally in the available space</string>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset theme="format-justify-center">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButtonTextRight">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Aligns with the right edge</string>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset theme="format-justify-right">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item alignment="Qt::AlignRight">
<widget class="QToolButton" name="toolButtonAdd">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset theme="list-add">
<normaloff>../../../../app/valentina/dialogs</normaloff>../../../../app/valentina/dialogs</iconset>
</property>
</widget>
</item>
<item alignment="Qt::AlignLeft">
<widget class="QToolButton" name="toolButtonRemove">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset theme="list-remove">
<normaloff>../../../../app/valentina/dialogs</normaloff>../../../../app/valentina/dialogs</iconset>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Text:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="VLineEdit" name="lineEditLine">
<property name="enabled">
<bool>false</bool>
</property>
<property name="placeholderText">
<string>Line of text</string>
</property>
<property name="clearButtonEnabled">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonInsert">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Insert placeholders</string>
</property>
<property name="text">
<string>Insert...</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item> </item>
</layout> </layout>
</item> </widget>
</layout> <widget class="QWidget" name="tabPreview">
<attribute name="title">
<string>Preview</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QListWidget" name="listWidgetPreview"/>
</item>
</layout>
</widget>
</widget>
</item> </item>
<item> <item>
<widget class="QDialogButtonBox" name="buttonBox"> <widget class="QDialogButtonBox" name="buttonBox">