r15529 by jghali - move PP shape tab code into its own class

scribus-commit scribus-commit at lists.scribus.net
Wed Oct 13 11:40:43 CEST 2010


Author: jghali
Date: Wed Oct 13 09:40:43 2010
New Revision: 15529

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=15529
Log:
move PP shape tab code into its own class

Added:
    branches/ScribusOIF/scribus/ui/propertiespalette_shape.cpp
    branches/ScribusOIF/scribus/ui/propertiespalette_shape.h
Modified:
    branches/ScribusOIF/scribus/scribus.cpp
    branches/ScribusOIF/scribus/ui/propertiespalette.cpp
    branches/ScribusOIF/scribus/ui/propertiespalette.h
    branches/ScribusOIF/scribus/ui/propertiespalette_xyz.cpp
    branches/ScribusOIF/win32/vc8/Scribus.vcproj

Modified: branches/ScribusOIF/scribus/scribus.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15529&path=/branches/ScribusOIF/scribus/scribus.cpp
==============================================================================
--- branches/ScribusOIF/scribus/scribus.cpp (original)
+++ branches/ScribusOIF/scribus/scribus.cpp Wed Oct 13 09:40:43 2010
@@ -189,6 +189,7 @@
 #include "ui/printdialog.h"
 #include "ui/propertiespalette.h"
 #include "ui/propertiespalette_xyz.h"
+#include "ui/propertiespalette_shape.h"
 #include "ui/query.h"
 #include "ui/reformdoc.h"
 #include "ui/replacecolors.h"
@@ -6444,7 +6445,7 @@
 			doc->SubMode = modeToolBar->SubMode;
 			doc->ShapeValues = modeToolBar->ShapeVals;
 			doc->ValCount = modeToolBar->ValCount;
-			propertiesPalette->SCustom->setIcon(propertiesPalette->SCustom->getIconPixmap(doc->SubMode));
+			propertiesPalette->shapePal->SCustom->setIcon(propertiesPalette->shapePal->SCustom->getIconPixmap(doc->SubMode));
 		}
 		else
 			doc->SubMode = -1;

Modified: branches/ScribusOIF/scribus/ui/propertiespalette.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15529&path=/branches/ScribusOIF/scribus/ui/propertiespalette.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertiespalette.cpp (original)
+++ branches/ScribusOIF/scribus/ui/propertiespalette.cpp Wed Oct 13 09:40:43 2010
@@ -53,6 +53,7 @@
 #include "sccolorengine.h"
 #include "cpalette.h"
 #include "pageitem_textframe.h"
+#include "propertiespalette_shape.h"
 #include "propertiespalette_utils.h"
 #include "propertiespalette_xyz.h"
 #include "sccombobox.h"
@@ -122,108 +123,8 @@
 	pageLayout_2->setSpacing( 5 );
 	pageLayout_2->setMargin( 0 );
 
-	ShapeGroup = new QGroupBox( page_2 );
-	ShapeGroupLayout = new QHBoxLayout( ShapeGroup );
-	ShapeGroupLayout->setSpacing( 2 );
-	ShapeGroupLayout->setMargin( 0 );
-	ShapeGroupLayout->setAlignment( Qt::AlignTop );
-	SRect = new QLabel( "Shape:", ShapeGroup );
-	ShapeGroupLayout->addWidget( SRect );
-	SCustom = new Autoforms( ShapeGroup );
-	ShapeGroupLayout->addWidget( SCustom );
-
-	EditShape = new QToolButton( ShapeGroup );
-	ShapeGroupLayout->addWidget( EditShape );
-	pageLayout_2->addWidget( ShapeGroup );
-
-	Layout13 = new QHBoxLayout;
-	Layout13->setSpacing( 2 );
-	Layout13->setMargin( 0 );
-
-	RoundRect = new ScrSpinBox( page_2, 0 );
-	rndcornersLabel = new QLabel( "R&ound\nCorners:", page_2 );
-	rndcornersLabel->setBuddy(RoundRect);
-	Layout13->addWidget( rndcornersLabel );
-	Layout13->addWidget( RoundRect );
-	pageLayout_2->addLayout( Layout13 );
-
-	textFlowOptions = new QGroupBox( page_2 );
-	textFlowOptionsLayout = new QVBoxLayout( textFlowOptions );
-	textFlowOptionsLayout->setSpacing( 5 );
-	textFlowOptionsLayout->setMargin( 5 );
-	textFlowOptionsLayout->setAlignment( Qt::AlignTop );
-	textFlowDisabled = new QToolButton( textFlowOptions );
-	textFlowDisabled->setCheckable( true );
-	textFlowDisabled->setAutoExclusive(true);
-	textFlowDisabled->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
-	textFlowDisabled->setText( "Disabled" );
-	textFlowDisabled->setIcon(QIcon(loadIcon("flow-none.png")));
-	textFlowOptionsLayout->addWidget( textFlowDisabled );
-	textFlowUsesFrameShape  = new QToolButton( textFlowOptions );
-	textFlowUsesFrameShape->setCheckable( true );
-	textFlowUsesFrameShape->setAutoExclusive(true);
-	textFlowUsesFrameShape->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
-	textFlowUsesFrameShape->setText( "Use &Frame Shape" );
-	textFlowUsesFrameShape->setIcon(QIcon(loadIcon("flow-frame.png")));
-	textFlowOptionsLayout->addWidget( textFlowUsesFrameShape );
-	textFlowUsesBoundingBox = new QToolButton( textFlowOptions );
-	textFlowUsesBoundingBox->setCheckable( true );
-	textFlowUsesBoundingBox->setAutoExclusive(true);
-	textFlowUsesBoundingBox->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
-	textFlowUsesBoundingBox->setText( "Use &Bounding Box" );
-	textFlowUsesBoundingBox->setIcon(QIcon(loadIcon("flow-bounding.png")));
-	textFlowOptionsLayout->addWidget( textFlowUsesBoundingBox );
-	textFlowUsesContourLine = new QToolButton( textFlowOptions );
-	textFlowUsesContourLine->setCheckable( true );
-	textFlowUsesContourLine->setAutoExclusive(true);
-	textFlowUsesContourLine->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
-	textFlowUsesContourLine->setText( "&Use Contour Line" );
-	textFlowUsesContourLine->setIcon(QIcon(loadIcon("flow-contour.png")));
-	textFlowOptionsLayout->addWidget( textFlowUsesContourLine );
-	textFlowUsesImageClipping = new QToolButton( textFlowOptions );
-	textFlowUsesImageClipping->setCheckable( true );
-	textFlowUsesImageClipping->setAutoExclusive(true);
-	textFlowUsesImageClipping->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
-	textFlowUsesImageClipping->setText( "Use Image Clip Path" );
-	textFlowUsesImageClipping->setIcon(QIcon(loadIcon("flow-contour.png")));
-	textFlowOptionsLayout->addWidget( textFlowUsesImageClipping );
-	pageLayout_2->addWidget( textFlowOptions  );
-	textFlowDisabled->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
-	textFlowUsesFrameShape->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
-	textFlowUsesBoundingBox->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
-	textFlowUsesContourLine->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
-	textFlowUsesImageClipping->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
-	textFlowOptionsB = new QButtonGroup( page_2 );
-	textFlowOptionsB->addButton(textFlowDisabled, 0);
-	textFlowOptionsB->addButton(textFlowUsesFrameShape, 1);
-	textFlowOptionsB->addButton(textFlowUsesBoundingBox, 2);
-	textFlowOptionsB->addButton(textFlowUsesContourLine, 3);
-	textFlowOptionsB->addButton(textFlowUsesImageClipping, 4);
-
-	TabStack2 = new QStackedWidget( page_2 );
-
-	page_2a = new QWidget( TabStack2 );
-	TabStack2->addWidget( page_2a );
-
-	page_2c = new QWidget( TabStack2 );
-	pageLayout_2c = new QVBoxLayout( page_2c );
-	pageLayout_2c->setSpacing( 5 );
-	pageLayout_2c->setMargin( 0 );
-	Distance3 = new QGroupBox( page_2c );
-	DistanceLayout3 = new QVBoxLayout( Distance3 );
-	DistanceLayout3->setSpacing( 2 );
-	DistanceLayout3->setMargin( 5 );
-	DistanceLayout3->setAlignment( Qt::AlignTop );
-	EvenOdd = new QRadioButton( "Even-Odd", Distance3 );
-	DistanceLayout3->addWidget( EvenOdd );
-	NonZero = new QRadioButton( "Non Zero", Distance3 );
-	DistanceLayout3->addWidget( NonZero );
-	EvenOdd->setChecked( true );
-	Distance3->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum);
-	pageLayout_2c->addWidget(Distance3);
-	TabStack2->addWidget( page_2c );
-
-	pageLayout_2->addWidget( TabStack2 );
+	shapePal = new PropertiesPalette_Shape( page_2 );
+	pageLayout_2->addWidget( shapePal );
 
 	QSpacerItem* spacer6 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
 	pageLayout_2->addItem( spacer6 );
@@ -941,7 +842,6 @@
 
 	languageChange();
 
-	connect(RoundRect, SIGNAL(valueChanged(double)), this, SLOT(NewCornerRadius()));
 	connect(LineSp, SIGNAL(valueChanged(double)), this, SLOT(NewLineSpacing()));
 	connect(Size, SIGNAL(valueChanged(double)), this, SLOT(NewSize()));
 	connect(Extra, SIGNAL(valueChanged(double)), this, SLOT(NewTracking()));
@@ -978,11 +878,8 @@
 	connect(Aspect, SIGNAL(clicked()), this, SLOT(ChangeScaling()));
 	connect(EditEffects, SIGNAL(clicked()), this, SLOT(handleImageEffects()));
 	connect(EditPSDProps, SIGNAL(clicked()), this, SLOT(handleExtImgProperties()));
-	connect(textFlowOptionsB , SIGNAL(buttonClicked(int)), this, SLOT(DoFlow()));
 	connect(textFlowOptionsB2, SIGNAL(buttonClicked(int)), this, SLOT(DoFlow()));
 
-	connect(SCustom, SIGNAL(FormSel(int, int, qreal *)), this, SLOT(MakeIrre(int, int, qreal *)));
-	connect(EditShape, SIGNAL(clicked()), this, SLOT(handleShapeEdit()));
 	connect(SCustom2, SIGNAL(FormSel(int, int, qreal *)), this, SLOT(MakeIrre(int, int, qreal *)));
 	connect(EditShape2, SIGNAL(clicked()), this, SLOT(handleShapeEdit2()));
 	connect(dGap, SIGNAL(valueChanged(double)), this, SLOT(NewGap()));
@@ -1028,8 +925,6 @@
 	connect(startArrowScaleSpin, SIGNAL(valueChanged(int)), this, SLOT(setStartArrowScale(int )));
 	connect(endArrowScaleSpin, SIGNAL(valueChanged(int)), this, SLOT(setEndArrowScale(int )));
 	connect(lineSpacingModeCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(setLineSpacingMode(int)));
-	connect( EvenOdd, SIGNAL( clicked() ), this, SLOT(handleFillRule() ) );
-	connect( NonZero, SIGNAL( clicked() ), this, SLOT( handleFillRule() ) );
 	connect(optMarginRadioNone, SIGNAL(clicked()), this, SLOT(setOpticalMargins()) );
 	connect(optMarginRadioBoth, SIGNAL(clicked()), this, SLOT(setOpticalMargins()) );
 	connect(optMarginRadioLeft, SIGNAL(clicked()), this, SLOT(setOpticalMargins()) );
@@ -1043,9 +938,7 @@
 	connect(maxGlyphExtSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setMaxGlyphExtension()) );
 
 	HaveItem = false;
-	RoundRect->setValue(0);
 	TabStack3->setCurrentIndex(0);
-	TabStack2->setCurrentIndex(0);
 	for (int ws = 1; ws < 8; ++ws)
 		TabStack->setItemEnabled(ws, false);
 	TabStack->setCurrentIndex(0);
@@ -1083,6 +976,7 @@
 	move(p2);
 
 	this->xyzPal->setMainWindow(mw);
+	this->shapePal->setMainWindow(mw);
 
 	connect(this, SIGNAL(DocChanged()), m_ScMW, SLOT(slotDocCh()));
 	connect(this, SIGNAL(NewAlignment(int)), m_ScMW, SLOT(setNewAlignment(int)));
@@ -1170,12 +1064,12 @@
 
 	xyzPal->setDoc(doc);
 	/*xyzPal->setCurrentItem(NULL);*/
+	shapePal->setDoc(doc);
 
 	imageXOffsetSpinBox->setValues( -16777215, maxXYWHVal, precision, 0);
 	imageYOffsetSpinBox->setValues( -16777215, maxXYWHVal, precision, 0);
 
 	imageRotation->setValues( 0, 359.99, 1, 0);
-	RoundRect->setValues( -300, 300, 2, 0);
 	Extra->setValues( -300, 300, 2, 0);
 	Size->setValues( 0.5, 2048, 2, 1);
 	LineSp->setValues( 1, 2048, 2, 1);
@@ -1247,6 +1141,8 @@
 	CurItem = NULL;
 	xyzPal->unsetItem();
 	xyzPal->unsetDoc();
+	shapePal->unsetItem();
+	shapePal->unsetDoc();
 	Cpal->setCurrentItem(NULL);
 	Cpal->setDocument(NULL);
 	Tpal->setCurrentItem(NULL);
@@ -1256,11 +1152,8 @@
 	paraStyleCombo->setDoc(0);
 	charStyleCombo->setDoc(0);
 	SetLineFormats(0);
-	EditShape->setEnabled(false);
-	RoundRect->setEnabled(false);
 	HaveItem = false;
 	imageRotation->setValue(0);
-	RoundRect->setValue(0);
 	for (int ws = 1; ws < 8; ++ws)
 		TabStack->setItemEnabled(ws, false);
 	TabStack->widget(0)->setEnabled(false);
@@ -1300,23 +1193,6 @@
 		else
 			textFlowUsesImageClipping2->setEnabled(false);
 	}
-	else
-	{
-		if (mode == PageItem::TextFlowDisabled)
-			textFlowDisabled->setChecked(true);
-		else if (mode == PageItem::TextFlowUsesFrameShape)
-			textFlowUsesFrameShape->setChecked(true);
-		else if (mode == PageItem::TextFlowUsesBoundingBox)
-			textFlowUsesBoundingBox->setChecked(true);
-		else if (mode == PageItem::TextFlowUsesContourLine)
-			textFlowUsesContourLine->setChecked(true);
-		else if (mode == PageItem::TextFlowUsesImageClipping)
-			textFlowUsesImageClipping->setChecked(true);
-		if ((CurItem->asImageFrame()) && (CurItem->imageClip.size() != 0))
-			textFlowUsesImageClipping->setEnabled(true);
-		else
-			textFlowUsesImageClipping->setEnabled(false);
-	}
 }
 
 void PropertiesPalette::SetCurItem(PageItem *i)
@@ -1346,18 +1222,13 @@
 	CurItem = i;
 
 	xyzPal->handleSelectionChanged();
+	shapePal->handleSelectionChanged();
 
 	Cpal->setCurrentItem(CurItem);
 	Cpal->updateFromItem();
 	Tpal->setCurrentItem(CurItem);
 	Tpal->updateFromItem();
 	TpalGroup->setCurrentItem(CurItem);
-	if (CurItem->FrameType == 0)
-		SCustom->setIcon(SCustom->getIconPixmap(0));
-	if (CurItem->FrameType == 1)
-		SCustom->setIcon(SCustom->getIconPixmap(1));
-	if (CurItem->FrameType > 3)
-		SCustom->setIcon(SCustom->getIconPixmap(CurItem->FrameType-2));
 	if ((CurItem->asLine()) || (CurItem->asPolyLine()))
 	{
 		startArrow->setEnabled(true);
@@ -1376,7 +1247,6 @@
 		startArrowScaleSpin->setEnabled(false);
 		endArrowScaleSpin->setEnabled(false);
 	}
-	RoundRect->setValue(CurItem->cornerRadius()*m_unitRatio);
 	QString tm;
 	PageItem_TextFrame *i2=CurItem->asTextFrame();
 	if (i2!=0)
@@ -1559,7 +1429,6 @@
 		TabStack->setItemEnabled(idGroupItem, false);
 	if (CurItem->asPathText())
 	{
-		TabStack2->setCurrentIndex(0);
 		pathTextType->setCurrentIndex(CurItem->textPathType);
 		flippedPathText->setChecked(CurItem->textPathFlipped);
 		showcurveCheckBox->setChecked(CurItem->PoShow);
@@ -1571,29 +1440,17 @@
 	}
 	else if (CurItem->asTextFrame())
 	{
-		TabStack2->setCurrentIndex(0);
 		flopItem->setHidden(false);
 		DistanceItem->setHidden(false);
 		Distance2Item->setHidden(true);
 	}
 	else
 	{
-		TabStack2->setCurrentIndex(1);
-		Distance3->setVisible(i->itemType() != PageItem::ImageFrame);
 		flopItem->setHidden(false);
 		DistanceItem->setHidden(false);
 		Distance2Item->setHidden(true);
 	}
-	NonZero->setChecked(!CurItem->fillRule);
-	EvenOdd->setChecked(CurItem->fillRule);
-	// Frame type 3 is obsolete: CR 2005-02-06
-	//if (((i->itemType() == PageItem::TextFrame) || (i->itemType() == PageItem::ImageFrame) || (i->itemType() == 3)) &&  (!i->ClipEdited))
-	if (((CurItem->asTextFrame()) || (CurItem->asImageFrame())) &&  (!CurItem->ClipEdited) && ((CurItem->FrameType == 0) || (CurItem->FrameType == 2)))
-		RoundRect->setEnabled(true);
-	else
-	{
-		RoundRect->setEnabled ((CurItem->asPolygon()) &&  (!CurItem->ClipEdited)  && ((CurItem->FrameType == 0) || (CurItem->FrameType == 2)));
-	}
+
 	if (CurItem->doOverprint)
 		Cpal->setActOverprint(1);
 	else
@@ -1660,6 +1517,7 @@
 	connect(imageRotation, SIGNAL(valueChanged(double)), this, SLOT(NewLocalRot()));
 
 	xyzPal->handleSelectionChanged();
+	shapePal->handleSelectionChanged();
 
 #ifdef HAVE_OSG
 	if (CurItem->asOSGFrame())
@@ -1718,10 +1576,10 @@
 	disconnect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
 
 	xyzPal->newSelection(nr);
+	shapePal->newSelection(nr);
 
 	if (doc->m_Selection->count()>1)
 	{
-		RoundRect->showValue(0);
 		for (int ws = 1; ws < 8; ++ws)
 			TabStack->setItemEnabled(ws, false);
 		TabStack->widget(0)->setEnabled(true);
@@ -1738,17 +1596,10 @@
 	}
 	else
 	{
-		if (nr!=-1)
+		if (nr != -1)
 		{
 			i=doc->m_Selection->itemAt(0);
 			HaveItem=true;
-			EditShape->setEnabled(!i->locked());
-			SCustom->setEnabled(nr!=5 && nr!=7 && nr!=8 && !i->locked());
-		}
-		else
-		{
-			EditShape->setEnabled(false);
-			SCustom->setEnabled(false);
 		}
 		LineMode->setEnabled(false);
 		visID = TabStack->currentIndex();
@@ -1759,9 +1610,7 @@
 		switch (nr)
 		{
 		case -1:
-			RoundRect->setEnabled(false);
 			HaveItem = false;
-			RoundRect->setValue(0);
 			for (int ws = 1; ws < 8; ++ws)
 				TabStack->setItemEnabled(ws, false);
 			TabStack->widget(0)->setEnabled(false);
@@ -1783,9 +1632,6 @@
 				TabStack->setItemEnabled(idTextItem, false);
 				TabStack->setItemEnabled(idImageItem, false);
 				Rotation->setEnabled(false);
-				RoundRect->setEnabled(false);
-				EditShape->setEnabled(false);
-				SCustom->setEnabled(false);
 			}
 			else
 			{
@@ -1794,12 +1640,6 @@
 				TabStack->setItemEnabled(idTextItem, false);
 				TabStack->setItemEnabled(idImageItem, true);
 				TabStack->setItemEnabled(idLineItem, true);
-				if ((!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
-					RoundRect->setEnabled(!i->locked());
-				else
-					RoundRect->setEnabled(false);
-				if ((doc->m_Selection->itemAt(0)->FrameType == 0) || (doc->m_Selection->itemAt(0)->FrameType == 2))
-					RoundRect->setEnabled(!i->locked());
 #ifdef HAVE_OSG
 			}
 #endif
@@ -1809,17 +1649,12 @@
 			TabStack->setItemEnabled(idTextItem, true);
 			TabStack->setItemEnabled(idImageItem, false);
 			TabStack->setItemEnabled(idLineItem, true);
-			if ((!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
-				RoundRect->setEnabled(!i->locked());
-			else
-				RoundRect->setEnabled(false);
 			break;
 		case PageItem::Line:
 			TabStack->setItemEnabled(idShapeItem, false);
 			TabStack->setItemEnabled(idTextItem, false);
 			TabStack->setItemEnabled(idImageItem, false);
 			TabStack->setItemEnabled(idLineItem, true);
-			RoundRect->setEnabled(false);
 			LineMode->setEnabled(true);
 			break;
 		case PageItem::ItemType1:
@@ -1829,24 +1664,18 @@
 			TabStack->setItemEnabled(idTextItem, false);
 			TabStack->setItemEnabled(idImageItem, false);
 			TabStack->setItemEnabled(idLineItem, true);
-			if ((!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
-				RoundRect->setEnabled(!i->locked());
-			else
-				RoundRect->setEnabled(false);
 			break;
 		case PageItem::PolyLine:
 			TabStack->setItemEnabled(idShapeItem, true);
 			TabStack->setItemEnabled(idTextItem, false);
 			TabStack->setItemEnabled(idImageItem, false);
 			TabStack->setItemEnabled(idLineItem, true);
-			RoundRect->setEnabled(false);
 			break;
 		case PageItem::PathText:
 			TabStack->setItemEnabled(idShapeItem, true);
 			TabStack->setItemEnabled(idTextItem, true);
 			TabStack->setItemEnabled(idImageItem, false);
 			TabStack->setItemEnabled(idLineItem, true);
-			RoundRect->setEnabled(false);
 			break;
 		case PageItem::Symbol:
 			TabStack->setItemEnabled(idShapeItem, false);
@@ -1856,10 +1685,6 @@
 			TabStack->setItemEnabled(idGroupItem, true);
 			TabStack->setItemEnabled(idColorsItem, false);
 			TabStack->setItemEnabled(idTransparencyItem, false);
-			if ((!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
-				RoundRect->setEnabled(!i->locked());
-			else
-				RoundRect->setEnabled(false);
 			break;
 		}
 	}
@@ -1877,6 +1702,7 @@
 	//CB Having added the selection and undo transaction to mirrorpolyh/v in doc,
 	//these can be enabled all the time
 	xyzPal->setMultipleSelection(true);
+	shapePal->setMultipleSelection(true);
 	if (doc->m_Selection->count() > 1)
 	{
 		PageItem *i;
@@ -1902,6 +1728,7 @@
 	m_unitIndex = doc->unitIndex();
 
 	xyzPal->unitChange();
+	shapePal->unitChange();
 
 	imageXOffsetSpinBox->setNewUnit( m_unitIndex );
 	imageYOffsetSpinBox->setNewUnit( m_unitIndex );
@@ -1910,21 +1737,10 @@
 	DTop->setNewUnit( m_unitIndex );
 	DBottom->setNewUnit( m_unitIndex );
 	DRight->setNewUnit( m_unitIndex );
-	RoundRect->setNewUnit( m_unitIndex );
 	LSize->setNewUnit( m_unitIndex );
 	Cpal->unitChange(oldRatio, m_unitRatio, doc->unitIndex());
 	Tpal->unitChange(oldRatio, m_unitRatio, doc->unitIndex());
 	TpalGroup->unitChange(oldRatio, m_unitRatio, doc->unitIndex());
-	HaveItem = tmp;
-}
-
-void PropertiesPalette::setRR(double r)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	bool tmp = HaveItem;
-	HaveItem = false;
-	RoundRect->setValue(r*m_unitRatio);
 	HaveItem = tmp;
 }
 
@@ -2432,16 +2248,6 @@
 	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 		return;
 	doc->itemSelection_SetScaleH(qRound(ChScale->value() * 10));
-}
-
-void PropertiesPalette::NewCornerRadius()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	CurItem->setCornerRadius(RoundRect->value() / m_unitRatio);
-	m_ScMW->view->SetFrameRounded();
-	emit DocChanged();
-	doc->regionsChanged()->update(QRect());
 }
 
 void PropertiesPalette::NewLineSpacing()
@@ -2953,19 +2759,6 @@
 			if (textFlowUsesImageClipping2->isChecked())
 				mode = PageItem::TextFlowUsesImageClipping;
 		}
-		else
-		{
-			if (textFlowDisabled->isChecked())
-				mode = PageItem::TextFlowDisabled;
-			if (textFlowUsesFrameShape->isChecked())
-				mode = PageItem::TextFlowUsesFrameShape;
-			if (textFlowUsesBoundingBox->isChecked())
-				mode = PageItem::TextFlowUsesBoundingBox;
-			if (textFlowUsesContourLine->isChecked())
-				mode = PageItem::TextFlowUsesContourLine;
-			if (textFlowUsesImageClipping->isChecked())
-				mode = PageItem::TextFlowUsesImageClipping;
-		}
 		CurItem->setTextFlowMode(mode);
 		m_ScMW->view->DrawNew();
 		emit DocChanged();
@@ -3027,24 +2820,12 @@
 		emit DocChanged();
 		if ((CurItem->itemType() == PageItem::ImageFrame) || (CurItem->itemType() == PageItem::TextFrame))
 		{
-			RoundRect->setEnabled(f == 0);
+			shapePal->RoundRect->setEnabled(f == 0);
 			return;
 		}
 //		CurItem->convertTo(PageItem::Polygon);
 //		NewSel(6);
-		RoundRect->setEnabled(f == 0);
-	}
-}
-
-void PropertiesPalette::handleShapeEdit()
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	if ((HaveDoc) && (HaveItem))
-	{
-		tmpSelection->clear();
-		m_ScMW->view->requestMode(modeEditClip);
-		RoundRect->setEnabled(false);
+		shapePal->RoundRect->setEnabled(f == 0);
 	}
 }
 
@@ -3568,15 +3349,6 @@
 	emit DocChanged();
 }
 
-void PropertiesPalette::handleFillRule()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	CurItem->fillRule = EvenOdd->isChecked();
-	CurItem->update();
-	emit DocChanged();
-}
-
 void PropertiesPalette::handleOverprint(int val)
 {
 	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
@@ -3697,9 +3469,9 @@
 	if (e->type() == QEvent::LanguageChange)
 	{
 		languageChange();
-	}
-	else
-		QWidget::changeEvent(e);
+		return;
+	}
+	QWidget::changeEvent(e);
 }
 
 void PropertiesPalette::languageChange()
@@ -3716,12 +3488,10 @@
 	TabStack->setItemText(idTransparencyItem, tr("&Transparency"));
 
 	xyzPal->languageChange();
-
-	SRect->setText( tr("Shape:"));
-	EditShape->setText( tr("&Edit..."));
+	shapePal->languageChange();
+
 	EditShape2->setText( tr("&Edit..."));
 	SRect2->setText( tr("Shape:"));
-	rndcornersLabel->setText( tr("R&ound\nCorners:"));
 	columnsLabel->setText( tr("Colu&mns:"));
 	int oldcolgapLabel = colgapLabel->currentIndex();
 	colgapLabel->clear();
@@ -3744,15 +3514,6 @@
 	pathTextTypeLabel->setText( tr("Type:"));
 	startoffsetLabel->setText( tr("Start Offset:"));
 	distfromcurveLabel->setText( tr("Distance from Curve:"));
-	Distance3->setTitle( tr("Fill Rule"));
-	EvenOdd->setText( tr("Even-Odd"));
-	NonZero->setText( tr("Non Zero"));
-	textFlowOptions->setTitle( tr("Text &Flow Around Frame"));
-	textFlowDisabled->setText( tr("Disabled"));
-	textFlowUsesFrameShape->setText( tr("Use Frame &Shape"));
-	textFlowUsesBoundingBox->setText( tr("Use &Bounding Box"));
-	textFlowUsesContourLine->setText( tr("&Use Contour Line"));
-	textFlowUsesImageClipping->setText( tr("Use Image Clip Path"));
 	textFlowOptions2->setTitle( tr("Text &Flow Around Frame"));
 	textFlowDisabled2->setText( tr("Disabled"));
 	textFlowUsesFrameShape2->setText( tr("Use Frame &Shape"));
@@ -3906,7 +3667,6 @@
 	DTop->setSuffix(ein);
 	DBottom->setSuffix(ein);
 	DRight->setSuffix(ein);
-	RoundRect->setSuffix(ein);
 
 	SeStyle->languageChange();
 	GroupAlign->languageChange();
@@ -3914,11 +3674,6 @@
 	if(StyledLine->count() > 0)
 		StyledLine->item(0)->setText( tr("No Style") );
 
-	textFlowDisabled->setToolTip( tr("Disable text flow from lower frames around object"));
-	textFlowUsesFrameShape->setToolTip( tr("Use the frame shape for text flow of text frames below the object."));
-	textFlowUsesBoundingBox->setToolTip(  "<qt>" + tr("Use the bounding box, which is always rectangular, instead of the frame's shape for text flow of text frames below the object. ") + "</qt>" );
-	textFlowUsesContourLine->setToolTip(  "<qt>" + tr("When chosen, the contour line can be edited with the Edit Shape Tool on the palette further above. When edited via the shape palette, this becomes a second separate line originally based on the frame's shape for text flow of text frames below the object.") + "</qt>" );
-	textFlowUsesImageClipping->setToolTip(  "<qt>" + tr("Use the clipping path of the image") + "</qt>" );
 	textFlowDisabled2->setToolTip( tr("Disable text flow from lower frames around object"));
 	textFlowUsesFrameShape2->setToolTip( tr("Use the frame shape for text flow of text frames below the object."));
 	textFlowUsesBoundingBox2->setToolTip(  "<qt>" + tr("Use the bounding box, which is always rectangular, instead of the frame's shape for text flow of text frames below the object. ") + "</qt>" );
@@ -3962,9 +3717,6 @@
 	startArrowScaleSpin->setToolTip( tr("Arrow head scale for start of line"));
 	endArrowScaleSpin->setToolTip( tr("Arrow head scale for end of line"));
 
-	SCustom->setToolTip( tr("Choose the shape of frame..."));
-	EditShape->setToolTip( tr("Edit shape of the frame..."));
-	RoundRect->setToolTip( tr("Set radius of corner rounding"));
 	DCol->setToolTip( tr("Number of columns in text frame"));
 	colgapLabel->setToolTip( tr("Switches between Gap or Column width"));
 	dGap->setToolTip( tr("Distance between columns"));
@@ -4050,19 +3802,7 @@
 
 void PropertiesPalette::setLocked(bool isLocked)
 {
-	QPalette pal(qApp->palette());
-	if (isLocked)
-		pal.setCurrentColorGroup(QPalette::Disabled);
-
-	EditShape->setEnabled(!isLocked);
-	if ((HaveDoc) && (HaveItem))
-	{
-		SCustom->setEnabled(!CurItem->asLine() && !CurItem->asPolyLine() && !CurItem->asPathText() && !isLocked);
-		if (((CurItem->asTextFrame()) || (CurItem->asImageFrame()) || (CurItem->asPolygon())) &&  (!CurItem->ClipEdited) && ((CurItem->FrameType == 0) || (CurItem->FrameType == 2)))
-			RoundRect->setEnabled(!isLocked);
-		else
-			RoundRect->setEnabled(false);
-	}
+	shapePal->setLocked(isLocked);
 }
 
 void PropertiesPalette::setGroupTransparency(double trans)
@@ -4131,7 +3871,7 @@
 		CurItem->isSingleSel = true;
 		CurItem->update();
 		m_ScMW->view->requestMode(modeEditClip);
-		RoundRect->setEnabled(false);
+		shapePal->RoundRect->setEnabled(false);
 	}
 }
 

Modified: branches/ScribusOIF/scribus/ui/propertiespalette.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15529&path=/branches/ScribusOIF/scribus/ui/propertiespalette.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertiespalette.h (original)
+++ branches/ScribusOIF/scribus/ui/propertiespalette.h Wed Oct 13 09:40:43 2010
@@ -55,6 +55,7 @@
 class DashEditor;
 class FontComboH;
 class NameWidget;
+class PropertiesPalette_Shape;
 class PropertiesPalette_XYZ;
 class ScComboBox;
 class ScribusDoc;
@@ -97,20 +98,18 @@
                          // commmited
 
 
-	PropertiesPalette_XYZ* xyzPal;
+	PropertiesPalette_Shape* shapePal;
+	PropertiesPalette_XYZ*   xyzPal;
 	Cpalette *Cpal;
 	Tpalette *Tpal;
 	Tpalette *TpalGroup;
-	Autoforms* SCustom;
 	Autoforms* SCustom2;
 	ParaStyleComboBox *paraStyleCombo;
 	CharStyleComboBox *charStyleCombo;
 	FontComboH* Fonts;
 	ArrowChooser* startArrow;
 	ArrowChooser* endArrow;
-	QGroupBox* textFlowOptions;
 	QGroupBox* textFlowOptions2;
-	QButtonGroup* textFlowOptionsB;
 	QButtonGroup* textFlowOptionsB2;
 	DashEditor* dashEditor;
 	
@@ -125,7 +124,6 @@
 	void NewSel(int nr);
 	void SetCurItem(PageItem *i);
 	void unitChange();
-	void setRR(double r);
 	void setCols(int r, double g);
 // 	void setLspMode(QAction *);
 	void setLineSpacingMode(int id);
@@ -180,7 +178,6 @@
 
 private slots:
 	void SelTab(int t);
-	void NewCornerRadius();
 	void NewLineSpacing();
 	void HandleGapSwitch();
 	void NewCols();
@@ -217,7 +214,6 @@
 	void DoRevert();
 	void doClearCStyle();
 	void doClearPStyle();
-	void handleShapeEdit();
 	void handleShapeEdit2();
 	void handleImageEffects();
 	void handleExtImgProperties();
@@ -226,7 +222,6 @@
 	void handlePathLine();
 	void handlePathDist();
 	void handlePathOffs();
-	void handleFillRule();
 	void handleOverprint(int);
 	void ChangeProfile(const QString& prn);
 	void ChangeIntent();
@@ -266,7 +261,6 @@
 	QVBoxLayout* MpalLayout;
 	QVBoxLayout* pageLayout;
 	QVBoxLayout* pageLayout_2;
-	QVBoxLayout* pageLayout_2c;
 	QVBoxLayout* pageLayout_3;
 	QVBoxLayout* pageLayout_4;
 	QVBoxLayout* pageLayout_5;
@@ -275,7 +269,6 @@
 	QVBoxLayout* pageLayout_6;
 	QVBoxLayout* pageLayout_7;
 	QVBoxLayout* TLineLayout;
-	QHBoxLayout* Layout13;
 	QGridLayout* layout41;
 	QGridLayout* layout41a;
 	QGridLayout* layout41c;
@@ -286,14 +279,11 @@
 	QHBoxLayout* Layout18;
 	QGridLayout* Layout12_2;
 	QGridLayout* imagePageNumberSelector;
-	QHBoxLayout* ShapeGroupLayout;
 	QGridLayout* DistanceLayout;
 	QGridLayout* DistanceLayout2;
-	QVBoxLayout* DistanceLayout3;
 	QGridLayout* GroupBox3aLayout;
 	QVBoxLayout* GroupBoxCMLayout;
 	QVBoxLayout* GroupBoxCompressionLayout;
-	QVBoxLayout* textFlowOptionsLayout;
 	QVBoxLayout* textFlowOptionsLayout2;
 	QHBoxLayout* layout23;
 	QHBoxLayout* layout24;
@@ -309,8 +299,6 @@
 	
 	QWidget* page;
 	QWidget* page_2;
-	QWidget* page_2a;
-	QWidget* page_2c;
 	QWidget* page_3;
 	QWidget* page_4;
 	QWidget* page_5;
@@ -320,9 +308,7 @@
 	QWidget* page_7;
 	QWidget* page_group;
 	
-	QLabel* SRect;
 	QLabel* SRect2;
-	QLabel* rndcornersLabel;
 	QLabel* startoffsetLabel;
 	QLabel* distfromcurveLabel;
 	QLabel* pathTextTypeLabel;
@@ -392,14 +378,11 @@
 	int m_unitIndex;
 	bool LMode;
 
-	QGroupBox* ShapeGroup;
 	QGroupBox* ShapeGroup2;
-	QGroupBox* Distance3;
 
 	QToolButton* TabsButton;
 
 	QToolBox* TabStack;
-	QStackedWidget* TabStack2;
 	QStackedWidget* TabStack3;
 
 	QFrame* GroupBoxCM;
@@ -408,11 +391,6 @@
 	QGroupBox* GroupBox3a;
 	QGroupBox* TransGroup;
 
-	QToolButton* textFlowDisabled;
-	QToolButton* textFlowUsesFrameShape;
-	QToolButton* textFlowUsesBoundingBox;
-	QToolButton* textFlowUsesContourLine;
-	QToolButton* textFlowUsesImageClipping;
 	QToolButton* textFlowDisabled2;
 	QToolButton* textFlowUsesFrameShape2;
 	QToolButton* textFlowUsesBoundingBox2;
@@ -447,7 +425,6 @@
 
 	QListWidget* StyledLine;
 
-	ScrSpinBox* RoundRect;
 	ScrSpinBox* dGap;
 	ScrSpinBox* DTop;
 	ScrSpinBox* DBottom;
@@ -481,8 +458,6 @@
 
 	QRadioButton* FreeScale;
 	QRadioButton* FrameScale;
-	QRadioButton* EvenOdd;
-	QRadioButton* NonZero;
 	QRadioButton* flopRealHeight;
 	QRadioButton* flopFontAscent;
 	QRadioButton* flopLineSpacing;
@@ -496,7 +471,6 @@
 	QToolButton* Revert;
 	QToolButton* charStyleClear;
 	QToolButton* paraStyleClear;
-	QToolButton* EditShape;
 	QToolButton* EditShape2;
 	QToolButton* EditEffects;
 	QToolButton* EditPSDProps;

Modified: branches/ScribusOIF/scribus/ui/propertiespalette_xyz.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15529&path=/branches/ScribusOIF/scribus/ui/propertiespalette_xyz.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertiespalette_xyz.cpp (original)
+++ branches/ScribusOIF/scribus/ui/propertiespalette_xyz.cpp Wed Oct 13 09:40:43 2010
@@ -284,14 +284,15 @@
 		disconnect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
 	}
 
-	m_doc = d;
+	m_doc  = d;
 	m_item = NULL;
-	m_unitRatio=m_doc->unitRatio();
-	m_unitIndex=m_doc->unitIndex();
+	m_unitRatio   = m_doc->unitRatio();
+	m_unitIndex   = m_doc->unitIndex();
 	int precision = unitGetPrecisionFromIndex(m_unitIndex);
 //qt4 FIXME here
-	double maxXYWHVal= 16777215 * m_unitRatio;
-	double minXYVal= -16777215 * m_unitRatio;
+	double maxXYWHVal =  16777215 * m_unitRatio;
+	double minXYVal   = -16777215 * m_unitRatio;
+
 	m_haveDoc = true;
 	m_haveItem = false;
 
@@ -331,7 +332,6 @@
 	widthLabel->setText( tr( "&Width:" ) );
 	yposLabel->setText( tr( "&Y-Pos:" ) );
 	heightLabel->setText( tr( "&Height:" ) );
-	m_haveItem = false;
 	Xpos->showValue(0);
 	Ypos->showValue(0);
 	Width->showValue(0);
@@ -342,8 +342,8 @@
 
 void PropertiesPalette_XYZ::unsetItem()
 {
-	m_haveItem=false;
-	m_item = NULL;
+	m_haveItem = false;
+	m_item     = NULL;
 	newSelection(-1);
 }
 

Modified: branches/ScribusOIF/win32/vc8/Scribus.vcproj
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15529&path=/branches/ScribusOIF/win32/vc8/Scribus.vcproj
==============================================================================
--- branches/ScribusOIF/win32/vc8/Scribus.vcproj (original)
+++ branches/ScribusOIF/win32/vc8/Scribus.vcproj Wed Oct 13 09:40:43 2010
@@ -1491,6 +1491,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\scribus\ui\propertiespalette_shape.cpp"
+				>
+			</File>
+			<File
 				RelativePath="..\..\scribus\ui\propertiespalette_utils.cpp"
 				>
 			</File>
@@ -8340,6 +8344,38 @@
 				</FileConfiguration>
 			</File>
 			<File
+				RelativePath="..\..\scribus\ui\propertiespalette_shape.h"
+				>
+				<FileConfiguration
+					Name="Debug-cairo|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release-cairo|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug-arthur|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release-arthur|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
 				RelativePath="..\..\scribus\ui\propertiespalette_utils.h"
 				>
 				<FileConfiguration
@@ -12990,6 +13026,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\scribus\ui\moc_propertiespalette_shape.cpp"
+				>
+			</File>
+			<File
 				RelativePath="..\..\scribus\ui\moc_propertiespalette_utils.cpp"
 				>
 			</File>




More information about the scribus-commit mailing list