Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 16956 → Rev 16957

/branches/ScribusOIF/scribus/ui/propertywidget_pos.cpp
44,6 → 44,7
m_item = 0;
m_lineMode = false;
m_oldRotation = 0;
m_unitIndex = 0;
m_unitRatio = 1.0;
 
setupUi(this);
/branches/ScribusOIF/scribus/ui/transparencypalette.h
54,6 → 54,7
 
friend class PropertiesPalette;
friend class PropertiesPalette_Group;
friend class PropertyWidget_Group;
 
public:
Tpalette(QWidget* parent);
/branches/ScribusOIF/scribus/ui/propertywidget_imagebase.ui
100,6 → 100,9
<property name="title">
<string>Scaling</string>
</property>
<property name="flat">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="2" column="0">
<widget class="QLabel" name="xscaleLabel">
222,6 → 225,9
<property name="title">
<string>Color Management</string>
</property>
<property name="flat">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<widget class="QLabel" name="inputProfLabel">
258,6 → 264,9
<property name="title">
<string>PDF Compression</string>
</property>
<property name="flat">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="compressionMethodLabel">
/branches/ScribusOIF/scribus/ui/propertywidget_groupshape.h
0,0 → 1,57
/*
For general Scribus (>=1.3.2) copyright and licensing information please refer
to the COPYING file provided with the program. Following this notice may exist
a copyright and/or license notice that predates the release of Scribus 1.3.2
for which a new license (GPL+exception) is in place.
*/
#ifndef PROPERTYWIDGET_GROUPSHAPE_H
#define PROPERTYWIDGET_GROUPSHAPE_H
 
#include "propertywidget_shape.h"
 
#include "scribusapi.h"
#include "pageitem.h"
#include "propertywidgetbase.h"
 
class ScribusDoc;
class ScribusMainWindow;
class Selection;
 
class SCRIBUS_API PropertyWidget_GroupShape : public PropertyWidget_Shape
{
Q_OBJECT
 
public:
PropertyWidget_GroupShape(QWidget* parent);
~PropertyWidget_GroupShape() {};
 
void setCustomShapeIcon(int submode);
void setLocked(bool isLocked);
void setRoundRectEnabled(bool enabled);
void displayTextFlowMode(PageItem::TextFlowMode mode);
 
protected:
void connectSignals();
void disconnectSignals();
 
protected:
 
void enableCustomShape();
void enableFromSelection(void);
void setCurrentItem(PageItem *i);
 
private slots:
 
void handleTextFlow();
void handleShapeEdit();
void handleShapeEditEnded();
void handleCornerRadius();
void handleNewShape(int, int, qreal *);
 
signals:
void DocChanged();
void shapeChanged(int);
void shapeEditStarted();
};
 
#endif
/branches/ScribusOIF/scribus/ui/propertiespalette_content.h
15,6 → 15,7
class QAbstractButton;
 
class PageItem;
class PropertyWidget_Group;
class PropertyWidget_Image;
class PropertyWidget_Text;
class ScribusDoc;
45,6 → 46,7
void setCurrentItem(PageItem *i);
private:
PropertyWidget_Group* groupWidget;
PropertyWidget_Image* imageWidget;
PropertyWidget_Text* textWidget;
/branches/ScribusOIF/scribus/ui/propertiespalette.cpp
246,7 → 246,7
connect(this, SIGNAL(DocChanged()), m_ScMW, SLOT(slotDocCh()));
//connect(this->Cpal, SIGNAL(gradientChanged()), m_ScMW, SLOT(updtGradFill()));
//connect(this->Cpal, SIGNAL(strokeGradientChanged()), m_ScMW, SLOT(updtGradStroke()));
connect(this->Tpal, SIGNAL(gradientChanged()), m_ScMW, SLOT(updtGradMask()));
connect(this->Tpal, SIGNAL(gradientChanged()), this, SLOT(handleGradientChanged()));
}
 
void PropertiesPalette::SelTab(int t)
673,13 → 673,6
repaint();
}
 
void PropertiesPalette::NewAlignement(int a)
{
if (!m_haveDoc || !m_haveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
m_doc->itemSelection_SetAlignment(a);
}
 
void PropertiesPalette::handleNewShape(int frameType)
{
if (!m_ScMW || m_ScMW->scriptIsRunning())
938,16 → 931,6
tablePal->languageChange();
}
 
const VGradient PropertiesPalette::getMaskGradient()
{
return Tpal->gradEdit->gradient();
}
 
const VGradient PropertiesPalette::getMaskGradientGroup()
{
return groupPal->getMaskGradientGroup();
}
 
void PropertiesPalette::setGradientEditMode(bool on)
{
Cpal->gradEditButton->setChecked(on);
1004,3 → 987,14
shapePal->setRoundRectEnabled(false);
}
}
 
void PropertiesPalette::handleGradientChanged()
{
if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
if ((m_haveDoc) && (m_haveItem))
{
VGradient vg(Tpal->gradEdit->gradient());
m_doc->itemSelection_SetMaskGradient(vg);
}
}
/branches/ScribusOIF/scribus/ui/propertywidget_groupshape.cpp
0,0 → 1,318
/*
For general Scribus (>=1.3.2) copyright and licensing information please refer
to the COPYING file provided with the program. Following this notice may exist
a copyright and/or license notice that predates the release of Scribus 1.3.2
for which a new license (GPL+exception) is in place.
*/
 
 
#include "propertywidget_groupshape.h"
 
#if defined(_MSC_VER)
#define _USE_MATH_DEFINES
#endif
#include <cmath>
#include "autoform.h"
#include "commonstrings.h"
#include "sccolorengine.h"
#include "pageitem_textframe.h"
#include "pageitem_regularpolygon.h"
#include "polyprops.h"
#include "sccombobox.h"
#include "scribus.h"
#include "scribuscore.h"
#include "scraction.h"
#include "scribusview.h"
#include "selection.h"
#include "units.h"
#include "undomanager.h"
#include "util.h"
#include "util_icon.h"
#include "util_math.h"
#include "text/nlsconfig.h"
 
#include "ui/nodeeditpalette.h"
#include "ui/propertiespalette_utils.h"
#include "ui/propertiespalette_xyz.h"
 
PropertyWidget_GroupShape::PropertyWidget_GroupShape( QWidget* parent) : PropertyWidget_Shape(parent)
{
setEnabled(false);
}
 
void PropertyWidget_GroupShape::connectSignals()
{
connect(textFlowBtnGroup, SIGNAL(buttonClicked(int)) , this, SLOT(handleTextFlow()) , Qt::UniqueConnection);
connect(editShape , SIGNAL(clicked()) , this, SLOT(handleShapeEdit()) , Qt::UniqueConnection);
connect(roundRect , SIGNAL(valueChanged(double)) , this, SLOT(handleCornerRadius()), Qt::UniqueConnection);
connect(evenOdd , SIGNAL(clicked()) , this, SLOT(handleFillRule()) , Qt::UniqueConnection );
connect(nonZero , SIGNAL(clicked()) , this, SLOT(handleFillRule()) , Qt::UniqueConnection );
connect(customShape, SIGNAL(FormSel(int, int, qreal *)), this, SLOT(handleNewShape(int, int, qreal *)), Qt::UniqueConnection);
}
 
void PropertyWidget_GroupShape::disconnectSignals()
{
disconnect(textFlowBtnGroup, SIGNAL(buttonClicked(int)) , this, SLOT(handleTextFlow()));
disconnect(editShape , SIGNAL(clicked()) , this, SLOT(handleShapeEdit()));
disconnect(roundRect , SIGNAL(valueChanged(double)) , this, SLOT(handleCornerRadius()));
disconnect(evenOdd , SIGNAL(clicked()) , this, SLOT(handleFillRule()));
disconnect(nonZero , SIGNAL(clicked()) , this, SLOT(handleFillRule()));
disconnect(customShape, SIGNAL(FormSel(int, int, qreal *)), this, SLOT(handleNewShape(int, int, qreal *)));
}
 
void PropertyWidget_GroupShape::enableCustomShape()
{
bool enabled = false;
if (m_item)
{
enabled = true;
enabled &= !m_item->isArc();
enabled &= !m_item->isLine();
enabled &= !m_item->isPathText();
enabled &= !m_item->isPolyLine();
enabled &= !m_item->isSpiral();
enabled &= !m_item->isRegularPolygon();
enabled &= !m_item->locked();
}
customShape->setEnabled(enabled);
}
 
void PropertyWidget_GroupShape::enableFromSelection(void)
{
bool enabled = false;
 
if (!m_item || !m_doc)
{
editShape->setEnabled(false);
customShape->setEnabled(false);
roundRect->setEnabled(false);
roundRect->showValue(0);
 
setEnabled(false);
return;
}
 
if (m_doc->m_Selection->count() > 1)
{
bool widgetEnabled = false;
if (m_item)
{
if ((m_item->isGroup()) && (!m_item->isSingleSel))
widgetEnabled = true;
}
setEnabled(widgetEnabled);
}
else
{
int itemType = m_item->itemType();
 
switch (itemType)
{
case PageItem::Symbol:
setEnabled(true);
break;
default:
setEnabled(false);
roundRect->setEnabled(false);
roundRect->showValue(0);
}
}
 
if ((m_item->isGroup()) && (!m_item->isSingleSel))
{
customShape->setEnabled(true);
editShape->setEnabled(true);
textFlowDisabled->setEnabled(true);
textFlowUsesFrameShape->setEnabled(true);
textFlowUsesBoundingBox->setEnabled(true);
textFlowUsesContourLine->setEnabled(true);
textFlowUsesImageClipping->setEnabled(false);
}
if (m_item->asSymbolFrame())
{
customShape->setEnabled(true);
editShape->setEnabled(true);
textFlowDisabled->setEnabled(true);
textFlowUsesFrameShape->setEnabled(true);
textFlowUsesBoundingBox->setEnabled(true);
textFlowUsesContourLine->setEnabled(true);
textFlowUsesImageClipping->setEnabled(false);
}
}
 
void PropertyWidget_GroupShape::setCustomShapeIcon(int submode)
{
customShape->setIcon( customShape->getIconPixmap(submode) );
}
 
void PropertyWidget_GroupShape::setLocked(bool isLocked)
{
QPalette pal(qApp->palette());
if (isLocked)
pal.setCurrentColorGroup(QPalette::Disabled);
 
editShape->setEnabled(!isLocked);
if (m_doc && m_item)
{
enableCustomShape();
if (((m_item->asTextFrame()) || (m_item->asImageFrame()) || (m_item->asPolygon())) && (!m_item->ClipEdited) && ((m_item->FrameType == 0) || (m_item->FrameType == 2)))
roundRect->setEnabled(!isLocked);
else
roundRect->setEnabled(false);
}
}
 
void PropertyWidget_GroupShape::setRoundRectEnabled(bool enabled)
{
roundRect->setEnabled(enabled);
}
 
void PropertyWidget_GroupShape::setCurrentItem(PageItem *item)
{
if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
//CB We shouldnt really need to process this if our item is the same one
//maybe we do if the item has been changed by scripter.. but that should probably
//set some status if so.
//FIXME: This wont work until when a canvas deselect happens, m_item must be NULL.
//if (m_item == i)
// return;
 
if (!m_doc)
setDoc(item->doc());
 
m_item = item;
 
disconnectSignals();
enableFromSelection();
 
if (m_item)
{
if (m_item->FrameType == 0)
customShape->setIcon(customShape->getIconPixmap(0));
if (m_item->FrameType == 1)
customShape->setIcon(customShape->getIconPixmap(1));
if (m_item->FrameType > 3)
customShape->setIcon(customShape->getIconPixmap(m_item->FrameType-2));
 
roundRect->setValue(m_item->cornerRadius()*m_unitRatio);
displayTextFlowMode(m_item->textFlowMode());
 
setLocked(m_item->locked());
nonZero->setChecked(!m_item->fillRule);
evenOdd->setChecked(m_item->fillRule);
 
connectSignals();
}
}
 
void PropertyWidget_GroupShape::handleTextFlow()
{
if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
if (m_doc && m_item)
{
PageItem::TextFlowMode mode = PageItem::TextFlowDisabled;
if (m_item->isGroup())
{
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;
}
m_item->setTextFlowMode(mode);
m_ScMW->view->DrawNew();
emit DocChanged();
}
}
 
void PropertyWidget_GroupShape::handleShapeEdit()
{
if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
if (m_doc && m_item)
{
m_tmpSelection->clear();
m_tmpSelection->copy(*m_doc->m_Selection, true);
m_doc->m_Selection->clear();
m_doc->m_Selection->addItem(m_item);
m_item->isSingleSel = true;
m_item->update();
m_ScMW->view->requestMode(modeEditClip);
connect(m_ScMW->nodePalette, SIGNAL(paletteClosed()), this, SLOT(handleShapeEditEnded()));
emit shapeEditStarted();
}
}
 
void PropertyWidget_GroupShape::handleShapeEditEnded()
{
disconnect(m_ScMW->nodePalette, SIGNAL(paletteClosed()), this, SLOT(handleShapeEditEnded()));
if (m_doc && m_item)
{
if (m_tmpSelection->count() > 0)
{
m_doc->m_Selection->copy(*m_tmpSelection, false);
m_doc->m_Selection->connectItemToGUI();
}
m_tmpSelection->clear();
}
}
 
void PropertyWidget_GroupShape::handleCornerRadius()
{
if (!m_doc || !m_doc || !m_ScMW || m_ScMW->scriptIsRunning())
return;
m_item->setCornerRadius(roundRect->value() / m_unitRatio);
m_ScMW->view->SetFrameRounded();
emit DocChanged();
m_doc->regionsChanged()->update(QRect());
}
 
void PropertyWidget_GroupShape::handleNewShape(int frameType, int count, qreal *points)
{
if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
if (m_doc && m_item)
{
if ((m_item->itemType() == PageItem::PolyLine) || (m_item->itemType() == PageItem::PathText))
return;
 
m_doc->item_setFrameShape(m_item, frameType, count, points);
roundRect->setEnabled(frameType == 0);
 
//ScribusDoc::changed() is called in item_setFrameShape()
//Hope this is enough
//emit DocChanged();
emit shapeChanged(frameType);
}
}
 
void PropertyWidget_GroupShape::displayTextFlowMode(PageItem::TextFlowMode mode)
{
if (!m_ScMW || m_ScMW->scriptIsRunning() || !m_item)
return;
if (m_item->isGroup())
{
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 ((m_item->asImageFrame()) && (m_item->imageClip.size() != 0))
textFlowUsesImageClipping->setEnabled(true);
else
textFlowUsesImageClipping->setEnabled(false);
}
}
 
/branches/ScribusOIF/scribus/ui/propertiespalette_group.h
27,8 → 27,6
 
virtual void changeEvent(QEvent *e);
 
const VGradient getMaskGradientGroup();
 
void displayTextFlowMode(PageItem::TextFlowMode mode);
 
void updateColorList();
67,6 → 65,7
 
private slots:
 
void handleGradientChanged();
void handleGroupTransparency(double trans);
void handleGroupBlending(int blend);
void handleGroupGradMask(int typ);
/branches/ScribusOIF/scribus/ui/propertywidget_shape.h
17,7 → 17,7
class ScribusMainWindow;
class Selection;
 
class SCRIBUS_API PropertyWidget_Shape : public QGroupBox, Ui::PropertyWidget_ShapeBase,
class SCRIBUS_API PropertyWidget_Shape : public QGroupBox, protected Ui::PropertyWidget_ShapeBase,
public PropertyWidgetBase
{
Q_OBJECT
/branches/ScribusOIF/scribus/ui/propertiespalette_content.cpp
16,6 → 16,7
#include "commonstrings.h"
#include "pageitem.h"
#include "propertiespalette_content.h"
#include "propertywidget_group.h"
#include "propertywidget_image.h"
#include "propertywidget_text.h"
#include "scribus.h"
71,6 → 72,13
textButton->setText("");
hboxLayout->addWidget(textButton);
 
QToolButton* groupButton = new QToolButton(widget);
groupButton->setObjectName(QString::fromUtf8("groupButton"));
groupButton->setSizePolicy( QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed));
//groupButton->setIcon( loadIcon("16/insert-table.png") );
groupButton->setText("");
hboxLayout->addWidget(groupButton);
 
QToolButton* tableButton = new QToolButton(widget);
tableButton->setObjectName(QString::fromUtf8("tableButton"));
tableButton->setSizePolicy( QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed));
82,6 → 90,7
 
buttonGroup->addButton(imageButton);
buttonGroup->addButton(textButton);
buttonGroup->addButton(groupButton);
buttonGroup->addButton(tableButton);
imageButton->setChecked(true);
95,6 → 104,10
textWidget = new PropertyWidget_Text(widgetStack);
textWidget->setObjectName(QString::fromUtf8("textPropsWidget"));
widgetStack->addWidget(textWidget);
 
groupWidget = new PropertyWidget_Group(widgetStack);
groupWidget->setObjectName(QString::fromUtf8("groupPropsWidget"));
widgetStack->addWidget(groupWidget);
vboxLayout->addWidget(widgetStack);
114,6 → 127,8
widgetStack->setCurrentIndex(0);
if (button->objectName() == "textButton")
widgetStack->setCurrentIndex(1);
if (button->objectName() == "groupButton")
widgetStack->setCurrentIndex(2);
}
 
void PropertiesPalette_Content::connectSignals()
145,6 → 160,7
setParent(m_ScMW);
move(p2);
 
groupWidget->setMainWindow(mw);
imageWidget->setMainWindow(mw);
textWidget->setMainWindow(mw);
}
163,6 → 179,7
m_doc = d;
m_item = NULL;
 
groupWidget->setDoc(m_doc);
imageWidget->setDoc(m_doc);
textWidget->setDoc(m_doc);
 
230,6 → 247,7
{
setWindowTitle( tr("Content Properties"));
 
groupWidget->languageChange();
imageWidget->languageChange();
textWidget->languageChange();
}
242,6 → 260,7
m_unitRatio = m_doc->unitRatio();
m_unitIndex = m_doc->unitIndex();
 
groupWidget->unitChange();
imageWidget->unitChange();
textWidget->unitChange();
}
/branches/ScribusOIF/scribus/ui/propertywidget_group.h
0,0 → 1,70
/*
For general Scribus (>=1.3.2) copyright and licensing information please refer
to the COPYING file provided with the program. Following this notice may exist
a copyright and/or license notice that predates the release of Scribus 1.3.2
for which a new license (GPL+exception) is in place.
*/
#ifndef PROPERTYWIDGET_GROUP_H
#define PROPERTYWIDGET_GROUP_H
 
#include "scribusapi.h"
#include "propertywidgetbase.h"
 
class QGroupBox;
 
class PropertyWidget_GroupShape;
class ScribusDoc;
class ScribusMainWindow;
class Tpalette;
 
class PropertyWidget_Group : public QFrame, public PropertyWidgetBase
{
Q_OBJECT
public:
PropertyWidget_Group(QWidget* parent);
~PropertyWidget_Group() {};
 
virtual void changeEvent(QEvent *e);
 
protected:
void connectSignals();
void disconnectSignals();
 
PageItem * m_item;
ScribusMainWindow* m_ScMW;
 
double m_unitRatio;
int m_unitIndex;
PropertyWidget_GroupShape* groupShapeWidget;
QGroupBox* transGroupBox;
Tpalette* groupTransWidget;
 
void enableFromSelection(void);
void setCurrentItem(PageItem *item);
 
public slots:
void setMainWindow(ScribusMainWindow *mw);
void setDoc(ScribusDoc *d);
void handleSelectionChanged();
void handleUpdateRequest(int);
 
void languageChange();
void unitChange();
private slots:
 
void handleGradientChanged();
void handleGroupTransparency(double trans);
void handleGroupBlending(int blend);
void handleGroupGradMask(int typ);
void handleGroupPatternMask(QString pattern);
void handleGroupPatternMaskProps(double, double, double, double, double, double, double, bool, bool);
 
void handleSpecialGradient(double, double, double, double, double, double, double, double );
void handleGradientEdit();
};
 
#endif
/branches/ScribusOIF/scribus/ui/propertiespalette_group.cpp
125,7 → 125,7
{
m_ScMW = mw;
 
connect(this->transPalWidget, SIGNAL(gradientChanged()), m_ScMW, SLOT(updtGradMaskGroup()));
connect(this->transPalWidget, SIGNAL(gradientChanged()), this, SLOT(handleGradientChanged()));
connect(this , SIGNAL(DocChanged()) , m_ScMW, SLOT(slotDocCh()));
connect(m_ScMW, SIGNAL(UpdateRequest(int)), this, SLOT(handleUpdateRequest(int)));
}
361,11 → 361,6
}
}
 
const VGradient PropertiesPalette_Group::getMaskGradientGroup()
{
return transPalWidget->gradEdit->gradient();
}
 
void PropertiesPalette_Group::updateColorList()
{
if (!m_haveDoc || !m_ScMW || m_ScMW->scriptIsRunning())
402,6 → 397,15
}
}
 
void PropertiesPalette_Group::handleGradientChanged()
{
if (m_haveDoc)
{
VGradient vg(transPalWidget->gradEdit->gradient());
m_doc->itemSelection_SetMaskGradient(vg);
}
}
 
void PropertiesPalette_Group::handleGroupTransparency(double trans)
{
if ((m_haveDoc) && (m_haveItem))
/branches/ScribusOIF/scribus/ui/propertywidget_group.cpp
0,0 → 1,328
/*
For general Scribus (>=1.3.2) copyright and licensing information please refer
to the COPYING file provided with the program. Following this notice may exist
a copyright and/or license notice that predates the release of Scribus 1.3.2
for which a new license (GPL+exception) is in place.
*/
 
#include "propertywidget_group.h"
#include "propertywidget_groupshape.h"
#include "transparencypalette.h"
#include "scribus.h"
#include "scribusdoc.h"
#include "selection.h"
#include "util_math.h"
 
PropertyWidget_Group::PropertyWidget_Group( QWidget* parent) : QFrame(parent)
{
m_item = 0;
m_ScMW = 0;
m_unitIndex = 0;
m_unitRatio = 1.0;
 
setSizePolicy( QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred));
 
QVBoxLayout* vboxLayout = new QVBoxLayout();
vboxLayout->setMargin(5);
vboxLayout->setSpacing(1);
vboxLayout->setAlignment(Qt::AlignTop);
 
this->setLayout(vboxLayout);
this->setSizePolicy( QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Maximum));
groupShapeWidget = new PropertyWidget_GroupShape(this);
vboxLayout->addWidget(groupShapeWidget);
 
QVBoxLayout* tboxLayout = new QVBoxLayout();
tboxLayout->setMargin(0);
tboxLayout->setSpacing(1);
tboxLayout->setAlignment(Qt::AlignTop);
 
transGroupBox = new QGroupBox(this);
transGroupBox->setLayout(tboxLayout);
transGroupBox->setTitle( tr("Transparency") );
transGroupBox->setFlat(true);
 
groupTransWidget = new Tpalette(transGroupBox);
groupTransWidget->hideSelectionButtons();
tboxLayout->addWidget(groupTransWidget);
 
vboxLayout->addWidget(transGroupBox);
 
languageChange();
}
 
void PropertyWidget_Group::setMainWindow(ScribusMainWindow *mw)
{
m_ScMW = mw;
 
groupShapeWidget->setMainWindow(mw);
 
connect(this , SIGNAL(DocChanged()) , m_ScMW, SLOT(slotDocCh()));
connect(m_ScMW, SIGNAL(UpdateRequest(int)), this , SLOT(handleUpdateRequest(int)));
}
 
void PropertyWidget_Group::setDoc(ScribusDoc *d)
{
if((d == (ScribusDoc*) m_doc) || (m_ScMW && m_ScMW->scriptIsRunning()))
return;
 
if (m_doc)
{
disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
disconnect(m_doc , SIGNAL(docChanged()) , this, SLOT(handleSelectionChanged()));
}
 
m_doc = d;
m_item = NULL;
 
groupShapeWidget->setDoc(m_doc);
 
groupTransWidget->setDocument(m_doc);
groupTransWidget->setCurrentItem(NULL);
 
if (m_doc.isNull())
{
disconnectSignals();
return;
}
 
m_unitRatio = m_doc->unitRatio();
m_unitIndex = m_doc->unitIndex();
 
connect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
connect(m_doc , SIGNAL(docChanged()) , this, SLOT(handleSelectionChanged()));
}
 
void PropertyWidget_Group::setCurrentItem(PageItem *item)
{
if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
//CB We shouldnt really need to process this if our item is the same one
//maybe we do if the item has been changed by scripter.. but that should probably
//set some status if so.
//FIXME: This wont work until when a canvas deselect happens, m_item must be NULL.
//if (m_item == i)
// return;
 
if (item && m_doc.isNull())
setDoc(item->doc());
 
m_item = item;
 
disconnectSignals();
enableFromSelection();
 
if (m_item)
{
connectSignals();
}
}
 
void PropertyWidget_Group::connectSignals()
{
connect(groupTransWidget, SIGNAL(gradientChanged()) , this, SLOT(handleGradientChanged()));
 
connect(groupTransWidget, SIGNAL(NewTrans(double)) , this, SLOT(handleGroupTransparency(double)));
connect(groupTransWidget, SIGNAL(NewBlend(int)) , this, SLOT(handleGroupBlending(int)));
connect(groupTransWidget, SIGNAL(NewGradient(int)) , this, SLOT(handleGroupGradMask(int)));
connect(groupTransWidget, SIGNAL(NewPattern(QString)), this, SLOT(handleGroupPatternMask(QString)));
connect(groupTransWidget, SIGNAL(NewPatternProps(double, double, double, double, double, double, double, bool, bool)), this, SLOT(handleGroupPatternMaskProps(double, double, double, double, double, double, double, bool, bool)));
 
connect(groupTransWidget, SIGNAL(editGradient()) , this, SLOT(handleGradientEdit()));
connect(groupTransWidget, SIGNAL(NewSpecial(double, double, double, double, double, double, double, double, double, double)), this, SLOT(handleSpecialGradient(double, double, double, double, double, double, double, double )));
}
 
void PropertyWidget_Group::disconnectSignals()
{
disconnect(groupTransWidget, SIGNAL(gradientChanged()) , this, SLOT(handleGradientChanged()));
 
disconnect(groupTransWidget, SIGNAL(NewTrans(double)) , this, SLOT(handleGroupTransparency(double)));
disconnect(groupTransWidget, SIGNAL(NewBlend(int)) , this, SLOT(handleGroupBlending(int)));
disconnect(groupTransWidget, SIGNAL(NewGradient(int)) , this, SLOT(handleGroupGradMask(int)));
disconnect(groupTransWidget, SIGNAL(NewPattern(QString)), this, SLOT(handleGroupPatternMask(QString)));
disconnect(groupTransWidget, SIGNAL(NewPatternProps(double, double, double, double, double, double, double, bool, bool)), this, SLOT(handleGroupPatternMaskProps(double, double, double, double, double, double, double, bool, bool)));
 
disconnect(groupTransWidget, SIGNAL(editGradient()) , this, SLOT(handleGradientEdit()));
disconnect(groupTransWidget, SIGNAL(NewSpecial(double, double, double, double, double, double, double, double, double, double)), this, SLOT(handleSpecialGradient(double, double, double, double, double, double, double, double )));
}
 
void PropertyWidget_Group::enableFromSelection(void)
{
bool widgetEnabled = false;
if (m_item && m_doc)
{
if (m_doc->m_Selection->count() > 1)
{
if ((m_item->isGroup()) && (!m_item->isSingleSel))
widgetEnabled = true;
}
else if (m_doc->m_Selection->count() == 1)
{
widgetEnabled = m_item->isSymbol() || m_item->isGroup();
}
}
setEnabled(widgetEnabled);
}
 
void PropertyWidget_Group::handleSelectionChanged()
{
if (!m_doc || !m_ScMW || m_ScMW->scriptIsRunning())
return;
 
PageItem* currItem = currentItemFromSelection();
setCurrentItem(currItem);
updateGeometry();
repaint();
}
 
void PropertyWidget_Group::handleUpdateRequest(int updateFlags)
{
// Nothing to do, all is handled by subwidgets
}
 
void PropertyWidget_Group::handleGradientChanged()
{
if (m_doc)
{
VGradient vg(groupTransWidget->gradEdit->gradient());
m_doc->itemSelection_SetMaskGradient(vg);
}
}
 
void PropertyWidget_Group::handleGroupTransparency(double trans)
{
if (m_item)
{
m_item->setFillTransparency(trans);
m_item->update();
m_ScMW->slotDocCh();
}
}
 
void PropertyWidget_Group::handleGroupBlending(int blend)
{
if (m_item)
{
m_item->setFillBlendmode(blend);
m_item->update();
m_ScMW->slotDocCh();
}
}
 
void PropertyWidget_Group::handleGroupGradMask(int typ)
{
if (m_item)
{
m_item->GrMask = typ;
if ((typ > 0) && (typ < 7))
m_item->updateGradientVectors();
m_item->update();
m_ScMW->slotDocCh();
}
}
 
void PropertyWidget_Group::handleGroupPatternMask(QString pattern)
{
if (m_item)
{
m_item->setPatternMask(pattern);
m_item->update();
m_ScMW->slotDocCh();
}
}
 
void PropertyWidget_Group::handleGroupPatternMaskProps(double imageScaleX, double imageScaleY, double offsetX, double offsetY, double rotation, double skewX, double skewY, bool mirrorX, bool mirrorY)
{
if (m_item)
{
m_item->setMaskTransform(imageScaleX, imageScaleY, offsetX, offsetY, rotation, skewX, skewY);
m_item->setMaskFlip(mirrorX, mirrorY);
m_item->update();
m_ScMW->slotDocCh();
}
}
 
void PropertyWidget_Group::handleGradientEdit()
{
if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
if (m_doc && m_item)
{
m_ScMW->view->editStrokeGradient = 2;
if (groupTransWidget->gradEditButton->isChecked())
m_ScMW->view->requestMode(modeEditGradientVectors);
else
m_ScMW->view->requestMode(modeNormal);
}
}
 
void PropertyWidget_Group::handleSpecialGradient(double x1, double y1, double x2, double y2, double fx, double fy, double sg, double sk)
{
if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
if (m_doc && m_item)
{
QRectF upRect;
m_item->GrMaskStartX = x1 / m_unitRatio;
m_item->GrMaskStartY = y1 / m_unitRatio;
m_item->GrMaskEndX = x2 / m_unitRatio;
m_item->GrMaskEndY = y2 / m_unitRatio;
m_item->GrMaskFocalX = fx / m_unitRatio;
m_item->GrMaskFocalY = fy / m_unitRatio;
m_item->GrMaskScale = sg;
m_item->GrMaskSkew = sk;
if ((m_item->GrMask == 1) || (m_item->GrMask == 4))
{
m_item->GrMaskFocalX = m_item->GrMaskStartX;
m_item->GrMaskFocalY = m_item->GrMaskStartY;
}
m_item->update();
upRect = QRectF(QPointF(m_item->GrMaskStartX, m_item->GrMaskStartY), QPointF(m_item->GrMaskEndX, m_item->GrMaskEndY));
double radEnd = distance(m_item->GrMaskEndX - m_item->GrMaskStartX, m_item->GrMaskEndY - m_item->GrMaskStartY);
double rotEnd = xy2Deg(m_item->GrMaskEndX - m_item->GrMaskStartX, m_item->GrMaskEndY - m_item->GrMaskStartY);
QTransform m;
m.translate(m_item->GrMaskStartX, m_item->GrMaskStartY);
m.rotate(rotEnd);
m.rotate(-90);
m.rotate(m_item->GrMaskSkew);
m.translate(radEnd * m_item->GrMaskScale, 0);
QPointF shP = m.map(QPointF(0,0));
upRect |= QRectF(shP, QPointF(m_item->GrMaskEndX, m_item->GrMaskEndY)).normalized();
upRect |= QRectF(shP, QPointF(m_item->GrMaskStartX, m_item->GrMaskStartY)).normalized();
upRect |= QRectF(shP, QPointF(0, 0)).normalized();
upRect |= QRectF(shP, QPointF(m_item->width(), m_item->height())).normalized();
upRect.translate(m_item->xPos(), m_item->yPos());
m_doc->regionsChanged()->update(upRect.adjusted(-10.0, -10.0, 10.0, 10.0));
m_ScMW->slotDocCh();
}
}
 
void PropertyWidget_Group::changeEvent(QEvent *e)
{
if (e->type() == QEvent::LanguageChange)
{
languageChange();
return;
}
QFrame::changeEvent(e);
}
 
void PropertyWidget_Group::languageChange()
{
transGroupBox->setTitle( tr("Transparency") );
}
 
void PropertyWidget_Group::unitChange()
{
if (!m_doc)
return;
 
double oldRatio = m_unitRatio;
m_unitRatio = m_doc->unitRatio();
m_unitIndex = m_doc->unitIndex();
 
groupTransWidget->blockSignals(true);
groupTransWidget->unitChange(oldRatio, m_unitRatio, m_doc->unitIndex());
groupTransWidget->blockSignals(false);
}
/branches/ScribusOIF/scribus/ui/propertywidget_shape.cpp
57,13 → 57,6
 
languageChange();
 
connect(textFlowBtnGroup, SIGNAL(buttonClicked(int)) , this, SLOT(handleTextFlow()));
connect(editShape , SIGNAL(clicked()) , this, SLOT(handleShapeEdit()));
connect(roundRect , SIGNAL(valueChanged(double)) , this, SLOT(handleCornerRadius()));
connect(evenOdd , SIGNAL(clicked()) , this, SLOT(handleFillRule()) );
connect(nonZero , SIGNAL(clicked()) , this, SLOT(handleFillRule()) );
connect(customShape, SIGNAL(FormSel(int, int, qreal *)), this, SLOT(handleNewShape(int, int, qreal *)));
 
roundRect->showValue(0);
fillRuleLabel->setEnabled(false);
evenOdd->setEnabled(false);
490,7 → 483,7
 
customShape->setToolTip( tr("Choose the shape of frame..."));
roundRect->setToolTip( tr("Set radius of corner rounding"));
textFlowLabel->setText( tr("Text &Flow Around Frame"));
textFlowLabel->setText( tr("Text Wrap"));
textFlowDisabled->setToolTip( tr("Disabled"));
textFlowUsesFrameShape->setToolTip( tr("Use Frame Shape"));
textFlowUsesBoundingBox->setToolTip( tr("Use Bounding Box"));
/branches/ScribusOIF/scribus/ui/propertiespalette.h
59,8 → 59,6
 
void endPatchAdd();
void updateColorSpecialGradient();
const VGradient getMaskGradient();
const VGradient getMaskGradientGroup();
void updateColorList();
void setGradientEditMode(bool);
void setTextFlowMode(PageItem::TextFlowMode mode);
105,7 → 103,7
void SelTab(int t);
 
void NewLineMode(int mode);
void NewAlignement(int a);
void handleGradientChanged();
void handleNewShape(int frameType);
void NewSpGradient(double x1, double y1, double x2, double y2, double fx, double fy, double sg, double sk, double cx, double cy);
void toggleGradientEdit(int);
/branches/ScribusOIF/scribus/scribus.cpp
7438,22 → 7438,6
}
}
 
void ScribusMainWindow::updtGradMask()
{
if (!HaveDoc)
return;
VGradient vg(propertiesPalette->getMaskGradient());
doc->itemSelection_SetMaskGradient(vg);
}
 
void ScribusMainWindow::updtGradMaskGroup()
{
if (!HaveDoc)
return;
VGradient vg(propertiesPalette->getMaskGradientGroup());
doc->itemSelection_SetMaskGradient(vg);
}
 
//CB-->??
void ScribusMainWindow::MakeFrame(int f, int c, double *vals)
{
/branches/ScribusOIF/scribus/scribus.h
455,21 → 455,7
/** Color Replacement */
void slotReplaceColors();
/** Style Manager */
/*
// Setzt den Pen-Tonwert
void setPenShade(int sh);
// Setzt den Brush-Tonwert
void setBrushShade(int sh);
void setGradFill(int typ);
*/
void updtGradMask();
void updtGradMaskGroup();
/*
// Setzt die Pen-Farbe
void setPenFarbe(QString farbe);
// Setzt die Brush-Farbe
void setBrushFarbe(QString farbe);
*/
 
//CB: void setCSMenu();
/** Erzeugt einen Rahmen */
void MakeFrame(int f, int c, double *vals);
/branches/ScribusOIF/scribus/CMakeLists.txt
393,6 → 393,8
ui/propertywidget_colortrans.h
ui/propertywidget_distance.h
ui/propertywidget_flop.h
ui/propertywidget_group.h
ui/propertywidget_groupshape.h
ui/propertywidget_image.h
ui/propertywidget_line.h
ui/propertywidget_optmargins.h
826,6 → 828,8
ui/propertywidget_distance.cpp
ui/propertywidget_flop.cpp
ui/propertywidget_image.cpp
ui/propertywidget_group.cpp
ui/propertywidget_groupshape.cpp
ui/propertywidget_line.cpp
ui/propertywidget_optmargins.cpp
ui/propertywidget_orphans.cpp
/branches/ScribusOIF/win32/vc9/scribus-main/Scribus.vcproj
1483,6 → 1483,14
>
</File>
<File
RelativePath="..\..\..\scribus\ui\propertywidget_group.cpp"
>
</File>
<File
RelativePath="..\..\..\scribus\ui\propertywidget_groupshape.cpp"
>
</File>
<File
RelativePath="..\..\..\scribus\ui\propertywidget_image.cpp"
>
</File>
6362,6 → 6370,42
</FileConfiguration>
</File>
<File
RelativePath="..\..\..\scribus\ui\propertywidget_group.h"
>
<FileConfiguration
Name="Debug-cairo|Win32"
>
<Tool
Name="moc.exe"
/>
</FileConfiguration>
<FileConfiguration
Name="Release-cairo|Win32"
>
<Tool
Name="moc.exe"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\..\scribus\ui\propertywidget_groupshape.h"
>
<FileConfiguration
Name="Debug-cairo|Win32"
>
<Tool
Name="moc.exe"
/>
</FileConfiguration>
<FileConfiguration
Name="Release-cairo|Win32"
>
<Tool
Name="moc.exe"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\..\scribus\ui\propertywidget_image.h"
>
<FileConfiguration
9029,11 → 9073,11
>
</File>
<File
RelativePath="..\..\..\scribus\ui\ui_propertywidget_imagebase.h"
RelativePath="..\..\..\..\scribus-1.5.x-svn\Scribus\scribus\ui\ui_propertywidget_imagebase.h"
>
</File>
<File
RelativePath="..\..\..\..\scribus-1.5.x-svn\Scribus\scribus\ui\ui_propertywidget_imagebase.h"
RelativePath="..\..\..\scribus\ui\ui_propertywidget_imagebase.h"
>
</File>
<File
9958,6 → 10002,14
>
</File>
<File
RelativePath="..\..\..\scribus\ui\moc_propertywidget_group.cpp"
>
</File>
<File
RelativePath="..\..\..\scribus\ui\moc_propertywidget_groupshape.cpp"
>
</File>
<File
RelativePath="..\..\..\scribus\ui\moc_propertywidget_image.cpp"
>
</File>