~ubuntu-branches/debian/sid/librecad/sid

« back to all changes in this revision

Viewing changes to src/ui/forms/qg_dlgimageoptions.h

  • Committer: Bazaar Package Importer
  • Author(s): Scott Howard
  • Date: 2011-02-03 19:04:09 UTC
  • Revision ID: james.westby@ubuntu.com-20110203190409-202riehiqzmkydth
Tags: upstream-1.0.0~beta5
ImportĀ upstreamĀ versionĀ 1.0.0~beta5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
**
 
3
** This file is part of the LibreCAD project, a 2D CAD program
 
4
**
 
5
** Copyright (C) 2010 R. van Twisk (librecad@rvt.dds.nl)
 
6
** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
 
7
**
 
8
**
 
9
** This program is free software; you can redistribute it and/or modify
 
10
** it under the terms of the GNU General Public License as published by 
 
11
** the Free Software Foundation; either version 2 of the License, or
 
12
** (at your option) any later version.
 
13
**
 
14
** This program is distributed in the hope that it will be useful,
 
15
** but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
** GNU General Public License for more details.
 
18
** 
 
19
** You should have received a copy of the GNU General Public License
 
20
** along with this program; if not, write to the Free Software
 
21
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
22
**
 
23
** This copyright notice MUST APPEAR in all copies of the script!  
 
24
**
 
25
**********************************************************************/
 
26
#ifndef QG_IMAGEOPTIONSDIALOG_H
 
27
#define QG_IMAGEOPTIONSDIALOG_H
 
28
 
 
29
#include <qvariant.h>
 
30
 
 
31
 
 
32
#include <Qt3Support/Q3ButtonGroup>
 
33
#include <Qt3Support/Q3MimeSourceFactory>
 
34
#include <QtCore/QVariant>
 
35
#include <QtGui/QAction>
 
36
#include <QtGui/QApplication>
 
37
#include <QtGui/QButtonGroup>
 
38
#include <QtGui/QComboBox>
 
39
#include <QtGui/QDialog>
 
40
#include <QtGui/QGridLayout>
 
41
#include <QtGui/QHBoxLayout>
 
42
#include <QtGui/QHeaderView>
 
43
#include <QtGui/QLabel>
 
44
#include <QtGui/QLineEdit>
 
45
#include <QtGui/QPushButton>
 
46
#include <QtGui/QRadioButton>
 
47
#include <QtGui/QSpacerItem>
 
48
#include <QtGui/QVBoxLayout>
 
49
#include "rs_vector.h"
 
50
 
 
51
QT_BEGIN_NAMESPACE
 
52
 
 
53
class Ui_QG_ImageOptionsDialog
 
54
{
 
55
public:
 
56
    QVBoxLayout *vboxLayout;
 
57
    Q3ButtonGroup *bgSize;
 
58
    QGridLayout *gridLayout;
 
59
    QLabel *lWidth;
 
60
    QLabel *lHeight;
 
61
    QSpacerItem *spacer3;
 
62
    QSpacerItem *spacer4;
 
63
    QLineEdit *leHeight;
 
64
    QLineEdit *leWidth;
 
65
    QLabel *lResolution;
 
66
    QComboBox *cbResolution;
 
67
    Q3ButtonGroup *bgBackground;
 
68
    QVBoxLayout *vboxLayout1;
 
69
    QRadioButton *rbWhite;
 
70
    QRadioButton *rbBlack;
 
71
    QSpacerItem *spacer2;
 
72
    QHBoxLayout *hboxLayout;
 
73
    QSpacerItem *Horizontal_Spacing2;
 
74
    QPushButton *bOK;
 
75
    QPushButton *bCancel;
 
76
 
 
77
    void setupUi(QDialog *QG_ImageOptionsDialog)
 
78
    {
 
79
        if (QG_ImageOptionsDialog->objectName().isEmpty())
 
80
            QG_ImageOptionsDialog->setObjectName(QString::fromUtf8("QG_ImageOptionsDialog"));
 
81
        QG_ImageOptionsDialog->resize(365, 358);
 
82
        QG_ImageOptionsDialog->setSizeGripEnabled(true);
 
83
        vboxLayout = new QVBoxLayout(QG_ImageOptionsDialog);
 
84
        vboxLayout->setSpacing(6);
 
85
        vboxLayout->setContentsMargins(11, 11, 11, 11);
 
86
        vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
 
87
        bgSize = new Q3ButtonGroup(QG_ImageOptionsDialog);
 
88
        bgSize->setObjectName(QString::fromUtf8("bgSize"));
 
89
        bgSize->setColumnLayout(0, Qt::Vertical);
 
90
        bgSize->layout()->setSpacing(6);
 
91
        bgSize->layout()->setContentsMargins(11, 11, 11, 11);
 
92
        gridLayout = new QGridLayout();
 
93
        QBoxLayout *boxlayout = qobject_cast<QBoxLayout *>(bgSize->layout());
 
94
        if (boxlayout)
 
95
            boxlayout->addLayout(gridLayout);
 
96
        gridLayout->setAlignment(Qt::AlignTop);
 
97
        gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
 
98
        lWidth = new QLabel(bgSize);
 
99
        lWidth->setObjectName(QString::fromUtf8("lWidth"));
 
100
        lWidth->setWordWrap(false);
 
101
 
 
102
        gridLayout->addWidget(lWidth, 0, 0, 1, 1);
 
103
 
 
104
        lHeight = new QLabel(bgSize);
 
105
        lHeight->setObjectName(QString::fromUtf8("lHeight"));
 
106
        lHeight->setWordWrap(false);
 
107
 
 
108
        gridLayout->addWidget(lHeight, 1, 0, 1, 1);
 
109
 
 
110
        spacer3 = new QSpacerItem(20, 31, QSizePolicy::Minimum, QSizePolicy::Expanding);
 
111
 
 
112
        gridLayout->addItem(spacer3, 3, 1, 1, 1);
 
113
 
 
114
        spacer4 = new QSpacerItem(20, 31, QSizePolicy::Minimum, QSizePolicy::Expanding);
 
115
 
 
116
        gridLayout->addItem(spacer4, 3, 0, 1, 1);
 
117
 
 
118
        leHeight = new QLineEdit(bgSize);
 
119
        leHeight->setObjectName(QString::fromUtf8("leHeight"));
 
120
 
 
121
        gridLayout->addWidget(leHeight, 1, 1, 1, 1);
 
122
 
 
123
        leWidth = new QLineEdit(bgSize);
 
124
        leWidth->setObjectName(QString::fromUtf8("leWidth"));
 
125
 
 
126
        gridLayout->addWidget(leWidth, 0, 1, 1, 1);
 
127
 
 
128
        lResolution = new QLabel(bgSize);
 
129
        lResolution->setObjectName(QString::fromUtf8("lResolution"));
 
130
        lResolution->setWordWrap(false);
 
131
 
 
132
        gridLayout->addWidget(lResolution, 2, 0, 1, 1);
 
133
 
 
134
        cbResolution = new QComboBox(bgSize);
 
135
        cbResolution->setObjectName(QString::fromUtf8("cbResolution"));
 
136
        cbResolution->setEditable(true);
 
137
 
 
138
        gridLayout->addWidget(cbResolution, 2, 1, 1, 1);
 
139
 
 
140
 
 
141
        vboxLayout->addWidget(bgSize);
 
142
 
 
143
        bgBackground = new Q3ButtonGroup(QG_ImageOptionsDialog);
 
144
        bgBackground->setObjectName(QString::fromUtf8("bgBackground"));
 
145
        bgBackground->setColumnLayout(0, Qt::Vertical);
 
146
        bgBackground->layout()->setSpacing(6);
 
147
        bgBackground->layout()->setContentsMargins(11, 11, 11, 11);
 
148
        vboxLayout1 = new QVBoxLayout();
 
149
        QBoxLayout *boxlayout1 = qobject_cast<QBoxLayout *>(bgBackground->layout());
 
150
        if (boxlayout1)
 
151
            boxlayout1->addLayout(vboxLayout1);
 
152
        vboxLayout1->setAlignment(Qt::AlignTop);
 
153
        vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1"));
 
154
        rbWhite = new QRadioButton(bgBackground);
 
155
        rbWhite->setObjectName(QString::fromUtf8("rbWhite"));
 
156
        rbWhite->setChecked(true);
 
157
 
 
158
        vboxLayout1->addWidget(rbWhite);
 
159
 
 
160
        rbBlack = new QRadioButton(bgBackground);
 
161
        rbBlack->setObjectName(QString::fromUtf8("rbBlack"));
 
162
 
 
163
        vboxLayout1->addWidget(rbBlack);
 
164
 
 
165
        spacer2 = new QSpacerItem(20, 51, QSizePolicy::Minimum, QSizePolicy::Expanding);
 
166
 
 
167
        vboxLayout1->addItem(spacer2);
 
168
 
 
169
 
 
170
        vboxLayout->addWidget(bgBackground);
 
171
 
 
172
        hboxLayout = new QHBoxLayout();
 
173
        hboxLayout->setSpacing(6);
 
174
        hboxLayout->setContentsMargins(0, 0, 0, 0);
 
175
        hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
 
176
        Horizontal_Spacing2 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
 
177
 
 
178
        hboxLayout->addItem(Horizontal_Spacing2);
 
179
 
 
180
        bOK = new QPushButton(QG_ImageOptionsDialog);
 
181
        bOK->setObjectName(QString::fromUtf8("bOK"));
 
182
        bOK->setAutoDefault(true);
 
183
        bOK->setDefault(true);
 
184
 
 
185
        hboxLayout->addWidget(bOK);
 
186
 
 
187
        bCancel = new QPushButton(QG_ImageOptionsDialog);
 
188
        bCancel->setObjectName(QString::fromUtf8("bCancel"));
 
189
        bCancel->setAutoDefault(true);
 
190
 
 
191
        hboxLayout->addWidget(bCancel);
 
192
 
 
193
 
 
194
        vboxLayout->addLayout(hboxLayout);
 
195
 
 
196
        QWidget::setTabOrder(leWidth, leHeight);
 
197
        QWidget::setTabOrder(leHeight, cbResolution);
 
198
        QWidget::setTabOrder(cbResolution, rbWhite);
 
199
        QWidget::setTabOrder(rbWhite, bOK);
 
200
        QWidget::setTabOrder(bOK, bCancel);
 
201
 
 
202
        retranslateUi(QG_ImageOptionsDialog);
 
203
        QObject::connect(bOK, SIGNAL(clicked()), QG_ImageOptionsDialog, SLOT(ok()));
 
204
        QObject::connect(bCancel, SIGNAL(clicked()), QG_ImageOptionsDialog, SLOT(reject()));
 
205
        QObject::connect(leWidth, SIGNAL(textChanged(QString)), QG_ImageOptionsDialog, SLOT(sizeChanged()));
 
206
        QObject::connect(leHeight, SIGNAL(textChanged(QString)), QG_ImageOptionsDialog, SLOT(sizeChanged()));
 
207
        QObject::connect(cbResolution, SIGNAL(textChanged(QString)), QG_ImageOptionsDialog, SLOT(resolutionChanged()));
 
208
 
 
209
        QMetaObject::connectSlotsByName(QG_ImageOptionsDialog);
 
210
    } // setupUi
 
211
 
 
212
    void retranslateUi(QDialog *QG_ImageOptionsDialog)
 
213
    {
 
214
        QG_ImageOptionsDialog->setWindowTitle(QApplication::translate("QG_ImageOptionsDialog", "Image Export Options", 0, QApplication::UnicodeUTF8));
 
215
        bgSize->setTitle(QApplication::translate("QG_ImageOptionsDialog", "Bitmap Size", 0, QApplication::UnicodeUTF8));
 
216
        lWidth->setText(QApplication::translate("QG_ImageOptionsDialog", "Width:", 0, QApplication::UnicodeUTF8));
 
217
        lHeight->setText(QApplication::translate("QG_ImageOptionsDialog", "Height:", 0, QApplication::UnicodeUTF8));
 
218
        leHeight->setText(QApplication::translate("QG_ImageOptionsDialog", "480", 0, QApplication::UnicodeUTF8));
 
219
        leWidth->setText(QApplication::translate("QG_ImageOptionsDialog", "640", 0, QApplication::UnicodeUTF8));
 
220
        lResolution->setText(QApplication::translate("QG_ImageOptionsDialog", "Resolution:", 0, QApplication::UnicodeUTF8));
 
221
        cbResolution->clear();
 
222
        cbResolution->insertItems(0, QStringList()
 
223
         << QApplication::translate("QG_ImageOptionsDialog", "auto", 0, QApplication::UnicodeUTF8)
 
224
         << QApplication::translate("QG_ImageOptionsDialog", "1", 0, QApplication::UnicodeUTF8)
 
225
         << QApplication::translate("QG_ImageOptionsDialog", "2", 0, QApplication::UnicodeUTF8)
 
226
         << QApplication::translate("QG_ImageOptionsDialog", "3", 0, QApplication::UnicodeUTF8)
 
227
         << QApplication::translate("QG_ImageOptionsDialog", "4", 0, QApplication::UnicodeUTF8)
 
228
         << QApplication::translate("QG_ImageOptionsDialog", "5", 0, QApplication::UnicodeUTF8)
 
229
         << QApplication::translate("QG_ImageOptionsDialog", "10", 0, QApplication::UnicodeUTF8)
 
230
         << QApplication::translate("QG_ImageOptionsDialog", "15", 0, QApplication::UnicodeUTF8)
 
231
         << QApplication::translate("QG_ImageOptionsDialog", "20", 0, QApplication::UnicodeUTF8)
 
232
         << QApplication::translate("QG_ImageOptionsDialog", "25", 0, QApplication::UnicodeUTF8)
 
233
         << QApplication::translate("QG_ImageOptionsDialog", "50", 0, QApplication::UnicodeUTF8)
 
234
         << QApplication::translate("QG_ImageOptionsDialog", "75", 0, QApplication::UnicodeUTF8)
 
235
         << QApplication::translate("QG_ImageOptionsDialog", "100", 0, QApplication::UnicodeUTF8)
 
236
         << QApplication::translate("QG_ImageOptionsDialog", "150", 0, QApplication::UnicodeUTF8)
 
237
         << QApplication::translate("QG_ImageOptionsDialog", "300", 0, QApplication::UnicodeUTF8)
 
238
         << QApplication::translate("QG_ImageOptionsDialog", "600", 0, QApplication::UnicodeUTF8)
 
239
         << QApplication::translate("QG_ImageOptionsDialog", "1200", 0, QApplication::UnicodeUTF8)
 
240
        );
 
241
        bgBackground->setTitle(QApplication::translate("QG_ImageOptionsDialog", "Background", 0, QApplication::UnicodeUTF8));
 
242
        rbWhite->setText(QApplication::translate("QG_ImageOptionsDialog", "White", 0, QApplication::UnicodeUTF8));
 
243
        rbBlack->setText(QApplication::translate("QG_ImageOptionsDialog", "Black", 0, QApplication::UnicodeUTF8));
 
244
        bOK->setText(QApplication::translate("QG_ImageOptionsDialog", "&OK", 0, QApplication::UnicodeUTF8));
 
245
        bOK->setShortcut(QApplication::translate("QG_ImageOptionsDialog", "Alt+O", 0, QApplication::UnicodeUTF8));
 
246
        bCancel->setText(QApplication::translate("QG_ImageOptionsDialog", "Cancel", 0, QApplication::UnicodeUTF8));
 
247
        bCancel->setShortcut(QApplication::translate("QG_ImageOptionsDialog", "Esc", 0, QApplication::UnicodeUTF8));
 
248
    } // retranslateUi
 
249
 
 
250
};
 
251
 
 
252
namespace Ui {
 
253
    class QG_ImageOptionsDialog: public Ui_QG_ImageOptionsDialog {};
 
254
} // namespace Ui
 
255
 
 
256
QT_END_NAMESPACE
 
257
 
 
258
class QG_ImageOptionsDialog : public QDialog, public Ui::QG_ImageOptionsDialog
 
259
{
 
260
    Q_OBJECT
 
261
 
 
262
public:
 
263
    QG_ImageOptionsDialog(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WindowFlags fl = 0);
 
264
    ~QG_ImageOptionsDialog();
 
265
 
 
266
    virtual QSize getSize();
 
267
    virtual bool isBackgroundBlack();
 
268
 
 
269
public slots:
 
270
    virtual void setGraphicSize( const RS_Vector & s );
 
271
    virtual void ok();
 
272
    virtual void sizeChanged();
 
273
    virtual void resolutionChanged();
 
274
 
 
275
protected slots:
 
276
    virtual void languageChange();
 
277
 
 
278
private:
 
279
    RS_Vector graphicSize;
 
280
    bool updateEnabled;
 
281
 
 
282
    void init();
 
283
 
 
284
};
 
285
 
 
286
#endif // QG_IMAGEOPTIONSDIALOG_H