24,110 → 24,114 |
|
PolygonProps::PolygonProps(QWidget* parent) : QDialog( parent, "poly", true, 0 ) |
{ |
setCaption( tr( "Polygon Properties" ) ); |
setIcon(loadIcon("AppIcon.png")); |
setCaption( tr( "Polygon Properties" ) ); |
setIcon(loadIcon("AppIcon.png")); |
Pre = new QPixmap(101, 101); |
Pre->fill(white); |
PolygonPropsLayout = new QVBoxLayout( this, 10, 5, "PolygonPropsLayout"); |
Layout11 = new QHBoxLayout( 0, 0, 5, "Layout11"); |
Layout10 = new QVBoxLayout( 0, 0, 5, "Layout10"); |
Layout2 = new QHBoxLayout( 0, 0, 5, "Layout2"); |
Text1 = new QLabel( this, "Text1" ); |
Text1->setText( tr( "Corners:" ) ); |
Layout2->addWidget( Text1 ); |
Ecken = new QSpinBox( this, "Ecken" ); |
Ecken->setMaxValue( 999 ); |
Ecken->setMinValue( 3 ); |
PolygonPropsLayout = new QVBoxLayout( this, 10, 5, "PolygonPropsLayout"); |
Layout11 = new QHBoxLayout( 0, 0, 5, "Layout11"); |
Layout10 = new QVBoxLayout( 0, 0, 5, "Layout10"); |
Layout2 = new QHBoxLayout( 0, 0, 5, "Layout2"); |
Ecken = new QSpinBox( this, "Ecken" ); |
Ecken->setMaxValue( 999 ); |
Ecken->setMinValue( 3 ); |
Ecken->setValue(PolyC); |
Layout2->addWidget( Ecken ); |
Layout10->addLayout( Layout2 ); |
Layout2->addWidget( Ecken ); |
Text1 = new QLabel( Ecken, tr("Corn&ers:"), this, "Text1" ); |
Layout2->addWidget( Text1 ); |
Layout10->addLayout( Layout2 ); |
|
Layout9_2 = new QHBoxLayout( 0, 0, 5, "Layout9_2"); |
Layout8_2 = new QVBoxLayout( 0, 0, 5, "Layout8_2"); |
Layout7_2 = new QHBoxLayout( 0, 0, 5, "Layout7_2"); |
Text2_2 = new QLabel( this, "Text2_2" ); |
Text2_2->setText( tr( "Rotation:" ) ); |
Layout7_2->addWidget( Text2_2 ); |
Faktor2 = new QSpinBox( this, "Faktor_2" ); |
Faktor2->setSuffix(" "); |
Faktor2->setMaxValue( 180 ); |
Faktor2->setMinValue( -180 ); |
Layout9_2 = new QHBoxLayout( 0, 0, 5, "Layout9_2"); |
Layout8_2 = new QVBoxLayout( 0, 0, 5, "Layout8_2"); |
Layout7_2 = new QHBoxLayout( 0, 0, 5, "Layout7_2"); |
Faktor2 = new QSpinBox( this, "Faktor_2" ); |
Faktor2->setSuffix(" "); |
Faktor2->setMaxValue( 180 ); |
Faktor2->setMinValue( -180 ); |
Faktor2->setValue(static_cast<int>(PolyR)); |
Layout7_2->addWidget( Faktor2 ); |
Layout8_2->addLayout( Layout7_2 ); |
Slider2 = new QSlider( this, "Slider1_2" ); |
Slider2->setMinValue( -180 ); |
Slider2->setMaxValue( 180 ); |
Layout7_2->addWidget( Faktor2 ); |
Text2_2 = new QLabel( Faktor2, tr("&Rotation:"), this, "Text2_2" ); |
Layout7_2->addWidget( Text2_2 ); |
Layout8_2->addLayout( Layout7_2 ); |
Slider2 = new QSlider( this, "Slider1_2" ); |
Slider2->setMinValue( -180 ); |
Slider2->setMaxValue( 180 ); |
Slider2->setValue(static_cast<int>(PolyR)); |
Slider2->setOrientation( QSlider::Horizontal ); |
Slider2->setTickmarks( QSlider::Right ); |
Layout8_2->addWidget( Slider2 ); |
Layout9_2->addLayout( Layout8_2 ); |
Layout10->addLayout( Layout9_2 ); |
Slider2->setOrientation( QSlider::Horizontal ); |
Slider2->setTickmarks( QSlider::Right ); |
Layout8_2->addWidget( Slider2 ); |
Layout9_2->addLayout( Layout8_2 ); |
Layout10->addLayout( Layout9_2 ); |
|
Konvex = new QCheckBox( this, "Konvex" ); |
Konvex->setText( tr( "Convex Polygon" ) ); |
Konvex = new QCheckBox( this, "Konvex" ); |
Konvex->setText( tr( "Conve&x Polygon" ) ); |
Konvex->setChecked(PolyS); |
Layout10->addWidget( Konvex ); |
Layout9 = new QHBoxLayout( 0, 0, 5, "Layout9"); |
QSpacerItem* spacer = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
Layout9->addItem( spacer ); |
Layout8 = new QVBoxLayout( 0, 0, 5, "Layout8"); |
Layout7 = new QHBoxLayout( 0, 0, 5, "Layout7"); |
Text2 = new QLabel( this, "Text2" ); |
Text2->setText( tr( "Factor:" ) ); |
Layout7->addWidget( Text2 ); |
Faktor = new QSpinBox( this, "Faktor" ); |
Faktor->setSuffix( tr( " %" ) ); |
Faktor->setMaxValue( 100 ); |
Faktor->setMinValue( -100 ); |
Layout10->addWidget( Konvex ); |
Layout9 = new QHBoxLayout( 0, 0, 5, "Layout9"); |
QSpacerItem* spacer = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
Layout9->addItem( spacer ); |
Layout8 = new QVBoxLayout( 0, 0, 5, "Layout8"); |
Layout7 = new QHBoxLayout( 0, 0, 5, "Layout7"); |
Faktor = new QSpinBox( this, "Faktor" ); |
Faktor->setSuffix( tr( " %" ) ); |
Faktor->setMaxValue( 100 ); |
Faktor->setMinValue( -100 ); |
Faktor->setValue(PolyFd); |
Layout7->addWidget( Faktor ); |
Layout8->addLayout( Layout7 ); |
Slider1 = new QSlider( this, "Slider1" ); |
Slider1->setMinValue( -100 ); |
Slider1->setMaxValue( 100 ); |
Slider1->setOrientation( QSlider::Horizontal ); |
Slider1->setTickmarks( QSlider::Right ); |
Layout7->addWidget( Faktor ); |
Text2 = new QLabel( Faktor, tr("&Factor:"), this, "Text2" ); |
Layout7->addWidget( Text2 ); |
Layout8->addLayout( Layout7 ); |
Slider1 = new QSlider( this, "Slider1" ); |
Slider1->setMinValue( -100 ); |
Slider1->setMaxValue( 100 ); |
Slider1->setOrientation( QSlider::Horizontal ); |
Slider1->setTickmarks( QSlider::Right ); |
Slider1->setValue(PolyFd); |
Layout8->addWidget( Slider1 ); |
Layout9->addLayout( Layout8 ); |
Layout10->addLayout( Layout9 ); |
Layout11->addLayout( Layout10 ); |
Preview = new QLabel( this, "Preview" ); |
Preview->setMinimumSize( QSize( 106, 106 ) ); |
Preview->setMaximumSize( QSize( 106, 106 ) ); |
Preview->setFrameShape( QLabel::Panel ); |
Preview->setFrameShadow( QLabel::Sunken ); |
Layout8->addWidget( Slider1 ); |
Layout9->addLayout( Layout8 ); |
Layout10->addLayout( Layout9 ); |
Layout11->addLayout( Layout10 ); |
Preview = new QLabel( this, "Preview" ); |
Preview->setMinimumSize( QSize( 106, 106 ) ); |
Preview->setMaximumSize( QSize( 106, 106 ) ); |
Preview->setFrameShape( QLabel::Panel ); |
Preview->setFrameShadow( QLabel::Sunken ); |
Preview->setLineWidth(2); |
Preview->setAlignment(AlignCenter); |
Preview->setPixmap(*Pre); |
Layout11->addWidget( Preview ); |
PolygonPropsLayout->addLayout( Layout11 ); |
Preview->setPixmap(*Pre); |
Layout11->addWidget( Preview ); |
PolygonPropsLayout->addLayout( Layout11 ); |
|
Layout1_2 = new QHBoxLayout( 0, 0, 6, "Layout1_2"); |
PushButton1 = new QPushButton( this, "PushButton1" ); |
PushButton1->setMinimumSize( QSize( 90, 0 ) ); |
PushButton1->setText( tr( "OK" ) ); |
PushButton1->setDefault( true ); |
Layout1_2->addWidget( PushButton1 ); |
QSpacerItem* spacer_2 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
Layout1_2->addItem( spacer_2 ); |
PushButton2 = new QPushButton( this, "PushButton2" ); |
PushButton2->setText( tr( "Cancel" ) ); |
Layout1_2->addWidget( PushButton2 ); |
PolygonPropsLayout->addLayout( Layout1_2 ); |
Layout1_2 = new QHBoxLayout( 0, 0, 6, "Layout1_2"); |
QSpacerItem* spacer_2 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
Layout1_2->addItem( spacer_2 ); |
PushButton1 = new QPushButton( this, "PushButton1" ); |
PushButton1->setText( tr( "&OK" ) ); |
PushButton1->setDefault( true ); |
Layout1_2->addWidget( PushButton1 ); |
PushButton2 = new QPushButton( this, "PushButton2" ); |
PushButton2->setText( tr( "&Cancel" ) ); |
Layout1_2->addWidget( PushButton2 ); |
PolygonPropsLayout->addLayout( Layout1_2 ); |
|
UpdatePreView(); |
// signals and slots connections |
connect(PushButton1, SIGNAL(clicked()), this, SLOT(accept())); |
connect(PushButton2, SIGNAL(clicked()), this, SLOT(reject())); |
connect(Faktor, SIGNAL(valueChanged(int)), this, SLOT(ValFromSpin(int))); |
connect(Faktor2, SIGNAL(valueChanged(int)), this, SLOT(ValFromSpin2(int))); |
connect(Slider1, SIGNAL(valueChanged(int)), Faktor, SLOT(setValue(int))); |
connect(Slider1, SIGNAL(valueChanged(int)), this, SLOT(UpdatePreView())); |
connect(Slider2, SIGNAL(valueChanged(int)), Faktor2, SLOT(setValue(int))); |
connect(Slider2, SIGNAL(valueChanged(int)), this, SLOT(UpdatePreView())); |
UpdatePreView(); |
//tooltips |
QToolTip::add( Ecken, tr( "Number of corners for polygons" ) ); |
QToolTip::add( Faktor2, tr( "Degrees of rotation for polygons" ) ); |
QToolTip::add( Slider2, tr( "Degrees of rotation for polygons" ) ); |
QToolTip::add( Konvex, tr( "Polygons will be convex rather than concave" ) ); |
QToolTip::add( Preview, tr( "Sample Polygon" ) ); |
QToolTip::add( Faktor, tr( "Change the angles at which lines of the polygon join" ) ); |
QToolTip::add( Slider1, tr( "Change the angles at which lines of the polygon join" ) ); |
// signals and slots connections |
connect(PushButton1, SIGNAL(clicked()), this, SLOT(accept())); |
connect(PushButton2, SIGNAL(clicked()), this, SLOT(reject())); |
connect(Faktor, SIGNAL(valueChanged(int)), this, SLOT(ValFromSpin(int))); |
connect(Faktor2, SIGNAL(valueChanged(int)), this, SLOT(ValFromSpin2(int))); |
connect(Slider1, SIGNAL(valueChanged(int)), Faktor, SLOT(setValue(int))); |
connect(Slider1, SIGNAL(valueChanged(int)), this, SLOT(UpdatePreView())); |
connect(Slider2, SIGNAL(valueChanged(int)), Faktor2, SLOT(setValue(int))); |
connect(Slider2, SIGNAL(valueChanged(int)), this, SLOT(UpdatePreView())); |
connect(Ecken, SIGNAL(valueChanged(int)), this, SLOT(UpdatePreView())); |
connect(Konvex, SIGNAL(clicked()), this, SLOT(UpdatePreView())); |
} |