30 #include "ui_PageSetup.h"
31 #include "../../core/pattern/mvc/OutsideObserver.h"
32 #include "../../core/pattern/mvc/OutsideController.h"
33 #include "../../core/pattern/singleton/Context.h"
40 #include <QColorDialog>
46 #include <QMessageBox>
47 #include <QObjectList>
53 m_paperType(te::layout::
A4),
54 m_ui(new Ui::PageSetup)
58 setWindowFlags( Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint
59 | Qt::WindowTitleHint | Qt::WindowStaysOnTopHint );
71 m_ui->lneCustomWidth->setValidator(
new QDoubleValidator(
this));
72 m_ui->lneCustomHeight->setValidator(
new QDoubleValidator(
this));
77 setVisible(context.
isShow());
78 if(context.
isShow() ==
true)
93 qreal valuex = posF.x();
94 qreal valuey = posF.y();
97 coordinate.
x = valuex;
98 coordinate.
y = valuey;
111 configureOrientationPage();
119 m_ui->rdbLandscape->setChecked(
true);
123 m_ui->rdbPortrait->setChecked(
true);
129 m_ui->cmbPageSize->clear();
131 index = m_ui->cmbPageSize->findData(
"ISO A0 - 841 x 1189 mm");
132 m_ui->cmbPageSize->insertItem(index,
"ISO A0 - 841 x 1189 mm");
134 index = m_ui->cmbPageSize->findData(
"ISO A1 - 594 x 841 mm");
135 m_ui->cmbPageSize->insertItem(index,
"ISO A1 - 594 x 841 mm");
137 index = m_ui->cmbPageSize->findData(
"ISO A2 - 420 x 594 mm");
138 m_ui->cmbPageSize->insertItem(index,
"ISO A2 - 420 x 594 mm");
140 index = m_ui->cmbPageSize->findData(
"ISO A3 - 297 x 420 mm");
141 m_ui->cmbPageSize->insertItem(index,
"ISO A3 - 297 x 420 mm");
143 index = m_ui->cmbPageSize->findData(
"ISO A4 - 210 x 297 mm");
144 m_ui->cmbPageSize->insertItem(index,
"ISO A4 - 210 x 297 mm");
146 index = m_ui->cmbPageSize->findData(
"ISO A5 - 148 x 210 mm");
147 m_ui->cmbPageSize->insertItem(index,
"ISO A5 - 148 x 210 mm");
156 curItem =
"ISO A0 - 841 x 1189 mm";
158 curItem =
"ISO A1 - 594 x 841 mm";
160 curItem =
"ISO A2 - 420 x 594 mm";
162 curItem =
"ISO A3 - 297 x 420 mm";
164 curItem =
"ISO A4 - 210 x 297 mm";
166 curItem =
"ISO A5 - 148 x 210 mm";
174 m_ui->gbCustom->setEnabled(
true);
187 m_ui->lneCustomWidth->setText(wv.toString());
189 m_ui->lneCustomHeight->setText(hv.toString());
195 if (text.toStdString().compare(
"ISO A0 - 841 x 1189 mm") == 0)
197 else if (text.toStdString().compare(
"ISO A1 - 594 x 841 mm") == 0)
199 else if (text.toStdString().compare(
"ISO A2 - 420 x 594 mm") == 0)
201 else if (text.toStdString().compare(
"ISO A3 - 297 x 420 mm") == 0)
203 else if (text.toStdString().compare(
"ISO A4 - 210 x 297 mm") == 0)
205 else if (text.toStdString().compare(
"ISO A5 - 148 x 210 mm") == 0)
226 if(m_ui->rdbLandscape->isChecked())
234 if(m_ui->rdbPortrait->isChecked())
Abstract class to represent an observable. "Model" part of MVC component.
Class responsible for maintaining the drawing context of a MVC component. It is always used by the "M...
Class responsible for paper setting. Size, orientation, custom size, etc.
virtual void configurePageSize()
Configures the page size getting from layout.
virtual void on_rdbPortrait_clicked()
Abstract class to represent an observer. "View" part of MVC widget. All classes representing the grap...
virtual void on_rdbLandscape_clicked()
An utility struct for representing 2D coordinates.
virtual LayoutOrientationType getPaperOrientantion()
Returns paper orientation type enum.
virtual ~PageSetupOutside()
virtual void switchSize()
virtual te::gm::Coord2D getPosition()
Method that returns the position llx, lly Reimplement this function in a ItemObserver subclass to pro...
static Context & getInstance()
It returns a reference to the singleton instance.
virtual void configureOrientationPage()
Configures the orientation page getting from layout.
virtual void updateObserver(ContextItem context)
Reimplemented from Observer.
virtual void getPaperSize(double &w, double &h)
Returns paper size. Height and Width.
virtual void on_cmbPageSize_currentIndexChanged(const QString &text)
std::auto_ptr< Ui::PageSetup > m_ui
PaperConfig * getPaperConfig() const
Returns paper setting.
Abstract class to represent a controller. "Controller" part of MVC widget. All classes representing t...
virtual LayoutAbstractPaperType getPaperType()
Returns paper type.
virtual void setPaperOrientation(LayoutOrientationType orientation)
Sets paper orientation type enum. Ex.: Portrait.
virtual void setPaperType(LayoutAbstractPaperType paperType)
Sets paper type enum. Ex.: A4.
virtual void on_pbApply_clicked()
virtual void setPosition(const double &x, const double &y)
Change coordinate llx,lly of the MVC widget. Reimplement this function in a ItemController subclass t...
PageSetupOutside(OutsideController *controller, Observable *o)