--- /dev/null
+//
+// C++ Implementation: labeldlg
+//
+// Description:
+//
+//
+// Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2008
+//
+// Copyright: See README/COPYING files that come with this distribution
+//
+//
+
+#include "labeldlg.h"
+
+#include <QComboBox>
+#include <QCheckBox>
+#include <QLineEdit>
+#include <QGridLayout>
+#include <QBoxLayout>
+#include <QPushButton>
+#include <QLabel>
+#include <QToolButton>
+#include <QScrollArea>
+
+#define ROWS 20
+#define COLS 20
+
+MLabelDialog::MLabelDialog(QWidget*par,QString pn,int nl)
+ :QDialog(par)
+{
+ printername=pn;
+ numlabels=nl;
+
+ setWindowTitle(tr("Label Printing Setup"));
+
+ QVBoxLayout*vl;
+ QGridLayout*gl;
+ setLayout(vl=new QVBoxLayout);
+ vl->addLayout(gl=new QGridLayout,0);
+
+ gl->addWidget(new QLabel(tr("Label offset:")),0,0);
+ gl->addWidget(offx=new QLineEdit,0,1);
+ gl->addWidget(new QLabel("x"),0,2);
+ gl->addWidget(offy=new QLineEdit,0,3);
+ gl->addWidget(new QLabel(tr("Label size:")),1,0);
+ gl->addWidget(sizex=new QLineEdit,1,1);
+ gl->addWidget(new QLabel("x"),1,2);
+ gl->addWidget(sizey=new QLineEdit,1,3);
+ gl->addWidget(new QLabel(tr("Unit:")),2,0);
+ gl->addWidget(metric=new QComboBox,2,1,1,3);
+ gl->setColumnStretch(4,10);
+
+ vl->addSpacing(10);
+ vl->addWidget(new QLabel(tr("Page usage:")),0);
+ vl->addWidget(page=new QComboBox,0);
+
+ QScrollArea *sa;
+ QWidget*w=new QWidget;
+ vl->addWidget(sa=new QScrollArea,10);
+ w->setLayout(gl=new QGridLayout);
+ QToolButton*t;
+ gl->addWidget(t=new QToolButton,0,0);
+ t->setIcon(QIcon(":/arrowdiag.png"));
+ for(int i=1;i<=COLS;i++){
+ gl->addWidget(t=new QToolButton,0,i);
+ t->setIcon(QIcon(":/arrowdown.png"));
+ }
+ for(int i=1;i<=ROWS;i++){
+ gl->addWidget(t=new QToolButton,i,0);
+ t->setIcon(QIcon(":/arrowright.png"));
+ for(int j=1;j<=COLS;j++){
+ QCheckBox*b;
+ gl->addWidget(b=new QCheckBox,i,j);
+ checks.append(b);
+ }
+ }
+ sa->setWidget(w);
+
+ vl->addSpacing(15);
+ QHBoxLayout*hl;
+ vl->addLayout(hl=new QHBoxLayout);
+ hl->addStretch(10);
+ QPushButton*p;
+ hl->addWidget(p=new QPushButton(tr("Ok")),0);
+ connect(p,SIGNAL(clicked()),this,SLOT(accept()));
+ hl->addWidget(p=new QPushButton(tr("Cancel")),0);
+ connect(p,SIGNAL(clicked()),this,SLOT(reject()));
+}
+
+MLabelDialog::~MLabelDialog(){}
+QPointF MLabelDialog::labelOffset(int n,QPaintDevice*){}
--- /dev/null
+//
+// C++ Interface: labeldlg
+//
+// Description:
+//
+//
+// Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2008
+//
+// Copyright: See README/COPYING files that come with this distribution
+//
+//
+
+#ifndef MAGICSMOKE_LABELDLG_H
+#define MAGICSMOKE_LABELDLG_H
+
+#include <QDialog>
+#include <QPointF>
+#include <QList>
+
+class QPaintDevice;
+class QCheckBox;
+class QComboBox;
+class QLineEdit;
+
+class MLabelDialog:public QDialog
+{
+ Q_OBJECT
+ public:
+ /**creates a label dialog*/
+ MLabelDialog(QWidget*parent,QString printername,int numlabels);
+ /**deletes the label dialog and stores its current settings*/
+ ~MLabelDialog();
+
+ /**returns the offset of label number n; relative to the coordinate system of the given paint device*/
+ QPointF labelOffset(int n,QPaintDevice*);
+ private:
+ QLineEdit *offx,*offy,*sizex,*sizey;
+ QComboBox *metric,*page;
+ QList<QCheckBox*>checks;
+ QList<QList<bool> >checked;
+ QString printername;
+ int numlabels;
+};
+
+#endif