#include "mxob.h" #include #include using namespace si; MxObPanel::MxObPanel(QWidget *parent) : Panel(parent) { int row = 0; layout()->addWidget(new QLabel(tr("Type")), row, 0); type_combo_ = new QComboBox(); for (int i=0; iaddItem(MxOb::GetTypeName(MxOb::Type(i))); } layout()->addWidget(type_combo_, row, 1); row++; layout()->addWidget(new QLabel(tr("Name")), row, 0); name_edit_ = new QLineEdit(); layout()->addWidget(name_edit_, row, 1); row++; layout()->addWidget(new QLabel(tr("Filename")), row, 0); filename_edit_ = new QLineEdit(); layout()->addWidget(filename_edit_, row, 1); row++; layout()->addWidget(new QLabel(tr("Object ID")), row, 0); obj_id_edit_ = new QSpinBox(); obj_id_edit_->setMinimum(0); obj_id_edit_->setMaximum(INT_MAX); layout()->addWidget(obj_id_edit_, row, 1); row++; layout()->addWidget(new QLabel(tr("Presenter")), row, 0); presenter_edit_ = new QLineEdit(); layout()->addWidget(presenter_edit_, row, 1); FinishLayout(); } void MxObPanel::OnOpeningData(si::Chunk *chunk) { auto mxob = chunk->data().cast(); type_combo_->setCurrentIndex(mxob->wType); name_edit_->setText(mxob->szName); filename_edit_->setText(mxob->szFilename); presenter_edit_->setText(mxob->szPresenter); obj_id_edit_->setValue(mxob->dwObjectID); } void MxObPanel::OnClosingData(si::Chunk *chunk) { auto mxob = chunk->data().cast(); mxob->wType = type_combo_->currentIndex(); }