Subversion Repositories Scribus

Rev

Rev 16306 | Rev 20185 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4430 cbradney 1
/*
2
For general Scribus (>=1.3.2) copyright and licensing information please refer
3
to the COPYING file provided with the program. Following this notice may exist
4
a copyright and/or license notice that predates the release of Scribus 1.3.2
5
for which a new license (GPL+exception) is in place.
6
*/
3 paul 7
#include "polyprops.h"
9837 fschmid 8
#include <QVBoxLayout>
9
#include <QHBoxLayout>
10
#include <QSpacerItem>
11
#include <QPixmap>
12
#include <QPushButton>
13544 cbradney 13
#include "ui/polygonwidget.h"
2952 cbradney 14
#include "commonstrings.h"
10200 cbradney 15
#include "util_icon.h"
3 paul 16
 
16306 fschmid 17
PolyVectorDialog::PolyVectorDialog(QWidget* parent, int polyC, double polyF, bool polyS, double polyR, double polyCurvature, double polyInnerRot, double polyOuterCurvature) : ScrPaletteBase( parent, "PolyVectorDialog", false, 0 )
3 paul 18
{
9837 fschmid 19
        setWindowTitle( tr( "Polygon Properties" ) );
20
        setWindowIcon(QIcon(loadIcon ( "AppIcon.png" )));
21
        PolygonPropsLayout = new QVBoxLayout( this );
22
        PolygonPropsLayout->setMargin(10);
23
        PolygonPropsLayout->setSpacing(5);
16306 fschmid 24
        polyWidget = new PolygonWidget(this, polyC, polyF, polyS, polyR, polyCurvature, polyInnerRot, polyOuterCurvature, true);
731 fschmid 25
        PolygonPropsLayout->addWidget( polyWidget );
16306 fschmid 26
        // signals and slots connections
27
        connect(polyWidget, SIGNAL(NewVectors(int, double, bool, double, double, double, double)), this, SIGNAL(NewVectors(int, double, bool, double, double, double, double)));
19363 craig 28
        connect (this, SIGNAL(accepted()), this, SIGNAL(endEdit()));
16306 fschmid 29
}
30
 
31
void PolyVectorDialog::setValues(int polyCorners, double polyF, bool polyUseConvexFactor, double polyRotation, double polyCurvature, double polyInnerRot, double polyOuterCurvature)
32
{
33
        polyWidget->setValues(polyCorners, polyF, polyUseConvexFactor, polyRotation, polyCurvature, polyInnerRot, polyOuterCurvature);
34
}
35
 
36
PolygonProps::PolygonProps(QWidget* parent, int polyC, double polyF, bool polyS, double polyR, double polyCurvature, double polyInnerRot, double polyOuterCurvature) : QDialog( parent )
37
{
38
        setModal(true);
39
        setWindowTitle( tr( "Polygon Properties" ) );
40
        setWindowIcon(QIcon(loadIcon ( "AppIcon.png" )));
41
        PolygonPropsLayout = new QVBoxLayout( this );
42
        PolygonPropsLayout->setMargin(10);
43
        PolygonPropsLayout->setSpacing(5);
44
        polyWidget = new PolygonWidget(this, polyC, polyF, polyS, polyR, polyCurvature, polyInnerRot, polyOuterCurvature);
45
        PolygonPropsLayout->addWidget( polyWidget );
46
        Layout1 = new QHBoxLayout;
47
        Layout1->setMargin(0);
48
        Layout1->setSpacing(5);
49
        QSpacerItem* spacer_2 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
50
        Layout1->addItem( spacer_2 );
51
        okButton = new QPushButton(this);
2952 cbradney 52
        okButton->setText( CommonStrings::tr_OK );
731 fschmid 53
        okButton->setDefault( true );
54
        Layout1->addWidget( okButton );
10427 cbradney 55
        cancelButton = new QPushButton(this);
2952 cbradney 56
        cancelButton->setText( CommonStrings::tr_Cancel );
731 fschmid 57
        Layout1->addWidget( cancelButton );
58
        PolygonPropsLayout->addLayout( Layout1 );
360 Franz 59
        // signals and slots connections
731 fschmid 60
        connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
61
        connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
3 paul 62
}
63
 
16246 fschmid 64
void PolygonProps::getValues(int* polyC, double* polyF, bool* polyS, double* polyR, double* polyCurvature, double* polyInnerRot, double* polyOuterCurvature)
3 paul 65
{
16246 fschmid 66
        polyWidget->getValues(polyC, polyF, polyS, polyR, polyCurvature, polyInnerRot, polyOuterCurvature);
3 paul 67
}
16290 fschmid 68
 
69
void PolygonProps::setValues(int polyCorners, double polyF, bool polyUseConvexFactor, double polyRotation, double polyCurvature, double polyInnerRot, double polyOuterCurvature)
70
{
71
        polyWidget->setValues(polyCorners, polyF, polyUseConvexFactor, polyRotation, polyCurvature, polyInnerRot, polyOuterCurvature);
72
}