Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 5619 → Rev 5620

/branches/Version13x/Scribus/scribus/fileloader.cpp
2282,8 → 2282,19
currItem->BottomLinkID = obj->attribute("BottomLINK", "-1").toInt();
currItem->PoShow = obj->attribute("PLTSHOW", "0").toInt();
currItem->BaseOffs = obj->attribute("BASEOF", "0").toDouble();
currItem->setTextFlowsAroundFrame(obj->attribute("TEXTFLOW").toInt());
currItem->setTextFlowUsesBoundingBox(obj->attribute("TEXTFLOW2", "0").toInt());
if ( obj->hasAttribute("TEXTFLOWMODE") )
currItem->setTextFlowMode((PageItem::TextFlowMode) obj->attribute("TEXTFLOWMODE", "0").toInt());
else if ( obj->attribute("TEXTFLOW").toInt() )
{
if (obj->attribute("TEXTFLOW2", "0").toInt())
currItem->setTextFlowMode(PageItem::TextFlowUsesBoundingBox);
else if (obj->attribute("TEXTFLOW3", "0").toInt())
currItem->setTextFlowMode(PageItem::TextFlowUsesContourLine);
else
currItem->setTextFlowMode(PageItem::TextFlowUsesFrameShape);
}
else
currItem->setTextFlowMode(PageItem::TextFlowDisabled);
if (obj->hasAttribute("EXTRAV"))
currItem->ExtraV = qRound(obj->attribute("EXTRAV", "0").toDouble() / obj->attribute("ISIZE", "12").toDouble() * 1000.0);
else
2305,7 → 2316,6
currItem->ColGap = obj->attribute("COLGAP", "0.0").toDouble();
if (obj->attribute("LAYER", "0").toInt() != -1)
currItem->LayerNr = obj->attribute("LAYER", "0").toInt();
currItem->setTextFlowUsesContourLine(obj->attribute("TEXTFLOW3", "0").toInt());
tmp = "";
if ((obj->hasAttribute("GROUPS")) && (obj->attribute("NUMGROUP", "0").toInt() != 0))
{
/branches/Version13x/Scribus/scribus/mpalette.h
104,6 → 104,7
void setGradientEditMode(bool);
void updateCList();
void updateCmsList();
void setTextFlowMode(PageItem::TextFlowMode mode);
void ShowCMS();
/*! \brief fills the langs combobox in language specific order
\author 10/07/2004 - Petr Vanek - rewritten to fix #1185.
123,7 → 124,7
ArrowChooser* startArrow;
ArrowChooser* endArrow;
QButtonGroup* RotationGroup;
QButtonGroup* textFlowsAroundFrame;
QButtonGroup* textFlowOptions;
public slots:
void setMainWindow(ScribusMainWindow *mw);
242,9 → 243,6
void HandleTLines();
void setStartArrow(int id);
void setEndArrow(int id);
void toggleTextFlowsAroundFrame(bool);
void clickTextFlowUsesBoundingBox();
void clickTextFlowUsesContourLine();
 
protected slots:
//virtual void reject();
303,7 → 301,7
QVBoxLayout* DistanceLayout3;
QGridLayout* GroupBox3aLayout;
QVBoxLayout* GroupBoxCMLayout;
QVBoxLayout* textFlowsAroundFrameLayout;
QVBoxLayout* textFlowOptionsLayout;
QHBoxLayout* layout23;
QHBoxLayout* layout24;
410,8 → 408,10
QGroupBox* TLines;
QGroupBox* GroupBox3a;
 
QCheckBox* textFlowUsesBoundingBox;
QCheckBox* textFlowUsesContourLine;
QRadioButton* textFlowDisabled;
QRadioButton* textFlowUsesFrameShape;
QRadioButton* textFlowUsesBoundingBox;
QRadioButton* textFlowUsesContourLine;
QCheckBox* Aspect;
QCheckBox* showcurveCheckBox;
QCheckBox* TopLine;
/branches/Version13x/Scribus/scribus/mpalette.cpp
432,18 → 432,23
 
pageLayout_2->addWidget( TabStack2 );
 
textFlowsAroundFrame = new QButtonGroup( page_2, "textFlowsAroundFrame" );
textFlowsAroundFrame->setColumnLayout(0, Qt::Vertical );
textFlowsAroundFrame->layout()->setSpacing( 5 );
textFlowsAroundFrame->layout()->setMargin( 10 );
textFlowsAroundFrameLayout = new QVBoxLayout( textFlowsAroundFrame->layout() );
textFlowsAroundFrameLayout->setAlignment( Qt::AlignTop );
textFlowsAroundFrame->setCheckable( true );
textFlowUsesBoundingBox = new QCheckBox( "Use &Bounding Box", textFlowsAroundFrame, "textFlowUsesBoundingBox" );
textFlowsAroundFrameLayout->addWidget( textFlowUsesBoundingBox );
textFlowUsesContourLine = new QCheckBox( "&Use Contour Line", textFlowsAroundFrame, "textFlowUsesContourLine" );
textFlowsAroundFrameLayout->addWidget( textFlowUsesContourLine );
pageLayout_2->addWidget( textFlowsAroundFrame );
textFlowOptions = new QButtonGroup( page_2, "textFlowOptions" );
textFlowOptions->setColumnLayout(0, Qt::Vertical );
textFlowOptions->layout()->setSpacing( 5 );
textFlowOptions->layout()->setMargin( 10 );
textFlowOptionsLayout = new QVBoxLayout( textFlowOptions->layout() );
textFlowOptionsLayout->setAlignment( Qt::AlignTop );
textFlowOptions->setCheckable( false );
textFlowOptions->setExclusive( true );
textFlowDisabled = new QRadioButton( "Disabled", textFlowOptions, "textFlowDisabled" );
textFlowOptionsLayout->addWidget( textFlowDisabled );
textFlowUsesFrameShape = new QRadioButton( "Use &Frame Shape", textFlowOptions, "textFlowUsesObjectFrame" );
textFlowOptionsLayout->addWidget( textFlowUsesFrameShape );
textFlowUsesBoundingBox = new QRadioButton( "Use &Bounding Box", textFlowOptions, "textFlowUsesBoundingBox" );
textFlowOptionsLayout->addWidget( textFlowUsesBoundingBox );
textFlowUsesContourLine = new QRadioButton( "&Use Contour Line", textFlowOptions, "textFlowUsesContourLine" );
textFlowOptionsLayout->addWidget( textFlowUsesContourLine );
pageLayout_2->addWidget( textFlowOptions );
 
QSpacerItem* spacer6 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
pageLayout_2->addItem( spacer6 );
810,11 → 815,7
connect(ZTop, SIGNAL(clicked()), this, SLOT(DoFront()));
connect(ZBottom, SIGNAL(clicked()), this, SLOT(DoBack()));
connect(RotationGroup, SIGNAL(clicked(int)), this, SLOT(NewRotMode(int)));
// Workaround for a qt 3.3.6 bug
//connect(textFlowsAroundFrame, SIGNAL(clicked(int)), this, SLOT(DoFlow(int)));
connect(textFlowsAroundFrame, SIGNAL(toggled(bool)), this, SLOT(toggleTextFlowsAroundFrame(bool)));
connect(textFlowUsesBoundingBox, SIGNAL(clicked()), this, SLOT(clickTextFlowUsesBoundingBox()));
connect(textFlowUsesContourLine, SIGNAL(clicked()), this, SLOT(clickTextFlowUsesContourLine()));
connect(textFlowOptions, SIGNAL(clicked(int)), this, SLOT(DoFlow(int)));
 
connect(SCustom, SIGNAL(FormSel(int, int, double *)), this, SLOT(MakeIrre(int, int, double *)));
connect(EditShape, SIGNAL(clicked()), this, SLOT(EditSh()));
1009,11 → 1010,8
Revert->setOn(i->reversed());
setDvals(i->textToFrameDistLeft(), i->textToFrameDistTop(), i->textToFrameDistBottom(), i->textToFrameDistRight());
LevelTxt->setText(QString::number(i->ItemNr));
textFlowsAroundFrame->setChecked(i->textFlowsAroundFrame());
textFlowUsesBoundingBox->setChecked(i->textFlowUsesBoundingBox());
setTextFlowMode(i->textFlowMode());
RoundRect->setValue(i->cornerRadius()*Umrech);
 
textFlowUsesContourLine->setChecked(i->textFlowUsesContourLine());
/*
disconnect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
disconnect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
1187,6 → 1185,20
}
 
 
void Mpalette::setTextFlowMode(PageItem::TextFlowMode mode)
{
if (!m_MainWindow || m_MainWindow->ScriptRunning)
return;
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);
}
 
void Mpalette::SetCurItem(PageItem *i)
{
if (!m_MainWindow || m_MainWindow->ScriptRunning)
1255,9 → 1267,7
DRight->setValue(i2->textToFrameDistRight()*Umrech);
}
Revert->setOn(i->reversed());
textFlowsAroundFrame->setChecked(i->textFlowsAroundFrame());
textFlowUsesBoundingBox->setChecked(i->textFlowUsesBoundingBox());
textFlowUsesContourLine->setChecked(i->textFlowUsesContourLine());
setTextFlowMode(i->textFlowMode());
/*
disconnect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
disconnect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
3126,56 → 3136,27
}
}
 
void Mpalette::DoFlow(int id)
void Mpalette::DoFlow(int /*id*/)
{
PageItem::TextFlowMode mode = PageItem::TextFlowDisabled;
if (!m_MainWindow || m_MainWindow->ScriptRunning)
return;
if ((HaveDoc) && (HaveItem))
{
switch (id)
{
case 0:
CurItem->setTextFlowsAroundFrame(textFlowsAroundFrame->isChecked());
textFlowUsesBoundingBox->setChecked(CurItem->textFlowUsesBoundingBox());
textFlowUsesContourLine->setChecked(CurItem->textFlowUsesContourLine());
break;
case 1:
CurItem->setTextFlowUsesBoundingBox(textFlowUsesBoundingBox->isChecked());
if (textFlowUsesBoundingBox->isChecked())
{
textFlowUsesContourLine->setChecked(!textFlowUsesBoundingBox->isChecked());
CurItem->setTextFlowUsesContourLine(textFlowUsesContourLine->isChecked());
}
break;
case 2:
CurItem->setTextFlowUsesContourLine(textFlowUsesContourLine->isChecked());
if (textFlowUsesContourLine->isChecked())
{
textFlowUsesBoundingBox->setChecked(!textFlowUsesContourLine->isChecked());
CurItem->setTextFlowUsesBoundingBox(textFlowUsesBoundingBox->isChecked());
}
break;
}
if (textFlowDisabled->isChecked())
mode = PageItem::TextFlowDisabled;
if (textFlowUsesFrameShape->isChecked())
mode = PageItem::TextFlowUsesFrameShape;
if (textFlowUsesBoundingBox->isChecked())
mode = PageItem::TextFlowUsesBoundingBox;
if (textFlowUsesContourLine->isChecked())
mode = PageItem::TextFlowUsesContourLine;
CurItem->setTextFlowMode(mode);
m_MainWindow->view->DrawNew();
emit DocChanged();
}
}
 
void Mpalette::toggleTextFlowsAroundFrame(bool)
{
DoFlow(0);
}
 
void Mpalette::clickTextFlowUsesBoundingBox()
{
DoFlow(1);
}
 
void Mpalette::clickTextFlowUsesContourLine()
{
DoFlow(2);
}
 
void Mpalette::MakeIrre(int f, int c, double *vals)
{
if (!m_MainWindow || m_MainWindow->ScriptRunning)
3856,7 → 3837,9
Distance3->setTitle( tr("Fill Rule"));
EvenOdd->setText( tr("Even-Odd"));
NonZero->setText( tr("Non Zero"));
textFlowsAroundFrame->setTitle( tr("Text &Flows Around Frame"));
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"));
styleLabel->setText( tr("St&yle:"));
3986,7 → 3969,9
QToolTip::remove(Locked);
QToolTip::remove(NoResize);
QToolTip::remove(NoPrint);
QToolTip::remove(textFlowsAroundFrame);
QToolTip::remove(textFlowOptions);
QToolTip::remove(textFlowDisabled);
QToolTip::remove(textFlowUsesFrameShape);
QToolTip::remove(textFlowUsesBoundingBox);
QToolTip::remove(textFlowUsesContourLine);
 
4059,7 → 4044,9
QToolTip::add(Locked, tr("Lock or unlock the object"));
QToolTip::add(NoResize, tr("Lock or unlock the size of the object"));
QToolTip::add(NoPrint, tr("Enable or disable printing of the object"));
QToolTip::add(textFlowsAroundFrame, tr("Make text in lower frames flow around the object shape"));
QToolTip::add(textFlowOptions, tr("Make text in lower frames flow around the object shape"));
QToolTip::add(textFlowDisabled, tr("Disable text flow around object"));
QToolTip::add(textFlowUsesFrameShape, tr("Use the frame shape for text flow"));
QToolTip::add(textFlowUsesBoundingBox, tr("Use a surrounding box instead of the frame's shape for text flow"));
QToolTip::add(textFlowUsesContourLine, tr("Use a second line originally based on the frame's shape for text flow"));
 
/branches/Version13x/Scribus/scribus/util.cpp
921,9 → 921,19
OB->m_annotation.setScaleW(obj->attribute("ANSCALE", "0").toInt());
if (obj->attribute("TRANSPARENT", "0").toInt() == 1)
OB->Pcolor = CommonStrings::None;
OB->Textflow=obj->attribute("TEXTFLOW").toInt();
OB->Textflow2 =obj->attribute("TEXTFLOW2", "0").toInt();
OB->UseContour = obj->attribute("TEXTFLOW3", "0").toInt();
if ( obj->hasAttribute("TEXTFLOWMODE") )
OB->TextflowMode = (PageItem::TextFlowMode) obj->attribute("TEXTFLOWMODE", "0").toInt();
else if ( obj->attribute("TEXTFLOW").toInt() )
{
if (obj->attribute("TEXTFLOW2", "0").toInt())
OB->TextflowMode = PageItem::TextFlowUsesBoundingBox;
else if (obj->attribute("TEXTFLOW3", "0").toInt())
OB->TextflowMode = PageItem::TextFlowUsesContourLine;
else
OB->TextflowMode = PageItem::TextFlowUsesFrameShape;
}
else
OB->TextflowMode = PageItem::TextFlowDisabled;
OB->Extra=obj->attribute("EXTRA").toDouble();
OB->TExtra=obj->attribute("TEXTRA", "1").toDouble();
OB->BExtra=obj->attribute("BEXTRA", "1").toDouble();
/branches/Version13x/Scribus/scribus/undomanager.h
506,10 → 506,12
static QString ImportEPS;
static QString ImportOOoDraw;
static QString ScratchSpace;
static QString TextFlow;
//static QString TextFlow;
static QString ObjectFrame;
static QString BoundingBox;
static QString ContourLine;
static QString NoTextFlow;
static QString NoObjectFrame;
static QString NoBoundingBox;
static QString NoContourLine;
static QString PageNmbr;
/branches/Version13x/Scribus/scribus/scribusXml.cpp
370,7 → 370,11
else
ob->setAttribute("ANNOTATION",0);
ob->setAttribute("ANNAME", !item->AutoName ? item->itemName() : QString(""));
ob->setAttribute("TEXTFLOW", item->textFlowsAroundFrame() ? 1 : 0);
// "TEXTFLOWMODE" succeed to "TEXTFLOW" "TEXTFLOW2" and "TEXTFLOW3" attributes
ob->setAttribute("TEXTFLOWMODE", (int) item->textFlowMode() );
// Set "TEXTFLOW" "TEXTFLOW2" and "TEXTFLOW3" attributes for compatibility
// with versions prior to 1.3.4
ob->setAttribute("TEXTFLOW" , item->textFlowAroundObject() ? 1 : 0);
ob->setAttribute("TEXTFLOW2", item->textFlowUsesBoundingBox() ? 1 : 0);
ob->setAttribute("TEXTFLOW3", item->textFlowUsesContourLine() ? 1 : 0);
ob->setAttribute("AUTOTEXT", item->isAutoText ? 1 : 0);
/branches/Version13x/Scribus/scribus/pageitem.h
82,8 → 82,6
Q_PROPERTY(int startArrowIndex READ startArrowIndex WRITE setStartArrowIndex DESIGNABLE false)
Q_PROPERTY(int endArrowIndex READ endArrowIndex WRITE setEndArrowIndex DESIGNABLE false)
 
Q_PROPERTY(bool textFlowsAroundFrame READ textFlowsAroundFrame WRITE setTextFlowsAroundFrame DESIGNABLE false)
Q_PROPERTY(bool textFlowUsesBoundingBox READ textFlowUsesBoundingBox WRITE setTextFlowUsesBoundingBox DESIGNABLE false)
Q_PROPERTY(bool m_PrintEnabled READ printEnabled WRITE setPrintEnabled DESIGNABLE false)
Q_PROPERTY(double xPos READ xPos WRITE setXPos DESIGNABLE false)
Q_PROPERTY(double yPos READ yPos WRITE setYPos DESIGNABLE false)
142,6 → 140,17
PathText = 8
};
 
/** @brief Text flow mode
*
* Describe if and how text flow around object
*/
enum TextFlowMode {
TextFlowDisabled = 0,
TextFlowUsesFrameShape = 1,
TextFlowUsesBoundingBox = 2,
TextFlowUsesContourLine = 3
};
 
/* these do essentially the same as a dynamic cast but might be more readable */
virtual PageItem_ImageFrame * asImageFrame() { return NULL; }
virtual PageItem_Line * asLine() { return NULL; }
668,55 → 677,42
/** @brief set lock for resizing */
void setSizeLocked(bool isLocked);
 
 
/**
* @brief Does text flow around this object
* @sa setTextFlowsAroundFrame()
* @brief Does text flow around this object and how
* @sa setTextFlowMode()
*/
bool textFlowsAroundFrame() const { return textFlowsAroundFrameVal; }
TextFlowMode textFlowMode() const { return textFlowModeVal; }
 
/**
* @brief Enable/disable text flowing around this item
* @param isFlowing true if text is wanted to flow around this object or false if not
* @sa textFlowsAroundFrame()
* @brief Changes the way text flows around this item
* @param mode true if text is wanted to flow around this object or false if not
* @sa textFlowMode()
*/
void setTextFlowsAroundFrame(bool isFlowing);
void setTextFlowMode(TextFlowMode mode);
 
/**
* @brief Should text flow around the object's bounding box if text flow is enabled?
* @sa PageItem::setTextFlowUsesBoundingBox()
* @brief If text should flow around object frame
* @sa PageItem::setTextFlowMode()
*/
bool textFlowUsesBoundingBox() const { return textFlowUsesBoundingBoxVal; }
bool textFlowAroundObject() const { return (textFlowModeVal != TextFlowDisabled); }
 
/**
* @brief Tells if the text flow should follow the square frame border if <code>useBounding</code>
* @brief is true, if it is set false text fill flow around the object border rather than frame.
*
* Setting this to true will unset contour line to false. Bounding box and contour line cannot
* be used at the same time.
* @param useBounding true if text should flow around the frame border false if it should follow
* the actual shape of the object.
* @sa setTextFlowsAroundFrame()
* @sa setTextFlowUsesContourLine()
* @sa textFlowUsesBoundingBox()
* @brief If text should flow around object frame
* @sa PageItem::setTextFlowMode()
*/
void setTextFlowUsesBoundingBox(bool useBounding);
bool textFlowUsesFrameShape() const { return (textFlowModeVal == TextFlowUsesFrameShape); }
 
/**
* @brief Should text flow around the contour line of the frame?
* @sa setTextFlowUsesContourLine()
* @brief If text should flow around bounding box
* @sa PageItem::setTextFlowMode()
*/
bool textFlowUsesContourLine() const { return textFlowUsesContourLineVal; }
bool textFlowUsesBoundingBox() const { return (textFlowModeVal == TextFlowUsesBoundingBox); }
 
/**
* @brief Tells if the text flow should follow the contour line of the frame.
*
* Setting this to true will unset bounding box to false. Contour line and bounding box cannot
* be used at the same time.
* @param useContour true if text should flow around the contour line of the frame false if
* it should flow around the actual shap of the object.
* @sa setTextFlowsAroundFrame()
* @sa setTextFlowUsesBoundingBox()
* @sa textFlowUsesContourLine()
* @brief If text should flow around contour line
* @sa PageItem::setTextFlowMode()
*/
void setTextFlowUsesContourLine(bool useContour);
bool textFlowUsesContourLine() const { return (textFlowModeVal == TextFlowUsesContourLine); }
 
/** @brief Get the frame type
*
965,23 → 961,11
 
/**
* @brief Should text flow around the item
* @sa PageItem::textFlowsAroundFrame(), PateItem::setTextFlowsAroundFrame()
* @sa PageItem::textFlowMode(), PateItem::setTextFlowMode()
*/
bool textFlowsAroundFrameVal;
TextFlowMode textFlowModeVal;
 
/**
* @brief Should text flow around the item's bounding box?
* @sa PageItem::textFlowUsesBoundingBox(), PageItem::setTextFlowUsesBoundingBox()
*/
bool textFlowUsesBoundingBoxVal;
 
/**
* @brief Should text flow around the item's contour line?
* @sa PageItem::textFlowUsesContourLine(), PageItem::setTextFlowUsesContourLine()
*/
bool textFlowUsesContourLineVal;
 
/**
* @brief Stores the attributes of the pageitem (NOT properties, the user defined ATTRIBUTES)
* @sa
*/
/branches/Version13x/Scribus/scribus/scribusstructs.h
102,9 → 102,7
FPointArray ContourLine;
bool PoShow;
double BaseOffs;
bool Textflow;
bool Textflow2;
bool UseContour;
int TextflowMode;
int textAlignment;
QString IFont;
int ISize;
/branches/Version13x/Scribus/scribus/pageitem.cpp
184,9 → 184,7
m_ImageIsFlippedV(other.m_ImageIsFlippedV),
m_Locked(other.m_Locked),
m_SizeLocked(other.m_SizeLocked),
textFlowsAroundFrameVal(other.textFlowsAroundFrameVal),
textFlowUsesBoundingBoxVal(other.textFlowUsesBoundingBoxVal),
textFlowUsesContourLineVal(other.textFlowUsesContourLineVal),
textFlowModeVal(other.textFlowModeVal),
pageItemAttributes(other.pageItemAttributes),
m_PrintEnabled(other.m_PrintEnabled),
tagged(other.tagged),
243,9 → 241,7
m_ImageIsFlippedV(0),
m_Locked(false),
m_SizeLocked(false),
textFlowsAroundFrameVal(false),
textFlowUsesBoundingBoxVal(false),
textFlowUsesContourLineVal(false)
textFlowModeVal(TextFlowDisabled)
{
QString tmp;
BackBox = 0;
1924,51 → 1920,29
emit printEnabled(m_PrintEnabled);
}
 
void PageItem::setTextFlowsAroundFrame(bool isFlowing)
void PageItem::setTextFlowMode(TextFlowMode mode)
{
if (textFlowsAroundFrameVal == isFlowing)
if (textFlowModeVal == mode)
return;
if (UndoManager::undoEnabled())
{
SimpleState *ss = new SimpleState(isFlowing ? Um::TextFlow : Um::NoTextFlow, "", Um::IFont);
ss->set("TEXT_FLOW", isFlowing);
QString stateMessage;
if( mode == TextFlowUsesFrameShape )
stateMessage = Um::ObjectFrame;
else if( mode == TextFlowUsesBoundingBox )
stateMessage = Um::BoundingBox;
else if( mode == TextFlowUsesContourLine )
stateMessage = Um::ContourLine;
else
stateMessage = Um::NoTextFlow;
SimpleState *ss = new SimpleState(stateMessage, "", Um::IFont);
ss->set("TEXTFLOW_OLDMODE", (int) textFlowModeVal);
ss->set("TEXTFLOW_NEWMODE", (int) mode);
undoManager->action(this, ss);
}
textFlowsAroundFrameVal = isFlowing;
textFlowModeVal = mode;
}
 
void PageItem::setTextFlowUsesBoundingBox(bool useBounding)
{
if (textFlowUsesBoundingBoxVal == useBounding)
return;
if (UndoManager::undoEnabled())
{
SimpleState *ss = new SimpleState(useBounding ? Um::BoundingBox : Um::NoBoundingBox, "", Um::IFont);
ss->set("TEXT_FLOW", textFlowsAroundFrame());
ss->set("BOUNDING_BOX", useBounding);
undoManager->action(this, ss);
}
if (useBounding && textFlowUsesContourLineVal)
textFlowUsesContourLineVal = false;
textFlowUsesBoundingBoxVal = useBounding;
}
 
void PageItem::setTextFlowUsesContourLine(bool useContour)
{
if (textFlowUsesContourLineVal == useContour)
return;
if (UndoManager::undoEnabled())
{
SimpleState *ss = new SimpleState(useContour ? Um::ContourLine : Um::NoContourLine, "", Um::IFont);
ss->set("TEXT_FLOW", textFlowsAroundFrame());
ss->set("CONTOUR_LINE", useContour);
undoManager->action(this, ss);
}
if (useContour && textFlowUsesBoundingBoxVal)
textFlowUsesBoundingBoxVal = false;
textFlowUsesContourLineVal = useContour;
}
 
void PageItem::convertTo(ItemType newType)
{
if (m_ItemType == newType)
2285,7 → 2259,7
restorePStyle(ss, isUndo);
else if (ss->contains("CONVERT"))
restoreType(ss, isUndo);
else if (ss->contains("TEXT_FLOW"))
else if (ss->contains("TEXTFLOW_OLDMODE"))
restoreTextFlowing(ss, isUndo);
else if (ss->contains("SCALE_TYPE"))
restoreImageScaleType(ss, isUndo);
2591,27 → 2565,12
 
void PageItem::restoreTextFlowing(SimpleState *state, bool isUndo)
{
if (state->contains("BOUNDING_BOX"))
{
if (isUndo)
textFlowUsesBoundingBoxVal = !state->getBool("BOUNDING_BOX");
else
textFlowUsesBoundingBoxVal = state->getBool("BOUNDING_BOX");
}
else if (state->contains("CONTOUR_LINE"))
{
if (isUndo)
textFlowUsesContourLineVal = !state->getBool("CONTOUR_LINE");
else
textFlowUsesContourLineVal = state->getBool("CONTOUR_LINE");
}
TextFlowMode oldMode = (TextFlowMode) state->getInt("TEXTFLOW_OLDMODE");
TextFlowMode newMode = (TextFlowMode) state->getInt("TEXTFLOW_NEWMODE");
if (isUndo)
textFlowModeVal = oldMode;
else
{
if (isUndo)
textFlowsAroundFrameVal = !state->getBool("TEXT_FLOW");
else
textFlowsAroundFrameVal = state->getBool("TEXT_FLOW");
}
textFlowModeVal = newMode;
}
 
void PageItem::restoreImageScaleType(SimpleState *state, bool isUndo)
2899,14 → 2858,13
Buffer->Clip = Clip.copy();
Buffer->PoLine = PoLine.copy();
Buffer->ContourLine = ContourLine.copy();
Buffer->UseContour = textFlowUsesContourLine();
//Buffer->UseContour = textFlowUsesContourLine();
Buffer->TabValues = TabValues;
Buffer->DashValues = DashValues;
Buffer->DashOffset = DashOffset;
Buffer->PoShow = PoShow;
Buffer->BaseOffs = BaseOffs;
Buffer->Textflow = textFlowsAroundFrame();
Buffer->Textflow2 = textFlowUsesBoundingBox();
Buffer->TextflowMode = textFlowMode();
Buffer->Groups = Groups;
Buffer->IProfile = IProfile;
Buffer->IRender = IRender;
/branches/Version13x/Scribus/scribus/scribusview.cpp
1696,8 → 1696,9
z = Doc->itemAdd(PageItem::TextFrame, PageItem::Unspecified, Tx + offX, Ty + offY, deltaX, deltaY, Doc->toolSettings.dWidth, CommonStrings::None, Doc->toolSettings.dPenText, !m_MouseButtonPressed);
currItem = Doc->Items->at(z);
currItem->isTableItem = true;
currItem->setTextFlowsAroundFrame(true);
currItem->setTextFlowUsesBoundingBox(true);
//currItem->setTextFlowsAroundFrame(true);
//currItem->setTextFlowUsesBoundingBox(true);
currItem->setTextFlowMode(PageItem::TextFlowUsesBoundingBox);
Doc->m_Selection->addItem(currItem);
offX += deltaX;
}
5419,7 → 5420,7
currItem->annotation().setType(11);
currItem->annotation().setZiel(Doc->currentPage()->pageNr());
currItem->annotation().setAction("0 0");
currItem->setTextFlowsAroundFrame(false);
currItem->setTextFlowMode(PageItem::TextFlowDisabled);
break;
}
SetupDraw(z);
9680,8 → 9681,9
currItem->Clip = Buffer->Clip.copy();
currItem->PoShow = Buffer->PoShow;
currItem->BaseOffs = Buffer->BaseOffs;
currItem->setTextFlowsAroundFrame(Buffer->Textflow);
currItem->setTextFlowUsesBoundingBox(Buffer->Textflow2);
//currItem->setTextFlowsAroundFrame(Buffer->Textflow);
//currItem->setTextFlowUsesBoundingBox(Buffer->Textflow2);
currItem->setTextFlowMode((PageItem::TextFlowMode) Buffer->TextflowMode);
// currItem->textAlignment = Buffer->textAlignment;
// currItem->setFont(Buffer->IFont);
// currItem->setFontSize(Buffer->ISize);
9702,7 → 9704,8
if (Buffer->LayerNr != -1)
currItem->LayerNr = Buffer->LayerNr;
currItem->PoLine = Buffer->PoLine.copy();
currItem->setTextFlowUsesContourLine(Buffer->UseContour);
//currItem->setTextFlowUsesContourLine(Buffer->UseContour);
currItem->setTextFlowMode((PageItem::TextFlowMode) Buffer->TextflowMode);
if (Buffer->ContourLine.size() == 0)
currItem->ContourLine = currItem->PoLine.copy();
else
10035,8 → 10038,9
}
uint z = Doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, currItem->xPos(), currItem->yPos(), currItem->width(), currItem->height(), currItem->lineWidth(), currItem->lineColor(), currItem->fillColor(), !m_MouseButtonPressed);
bb = Doc->Items->at(z);
bb->setTextFlowsAroundFrame(currItem->textFlowsAroundFrame());
bb->setTextFlowUsesBoundingBox(currItem->textFlowUsesBoundingBox());
//bb->setTextFlowsAroundFrame(currItem->textFlowsAroundFrame());
//bb->setTextFlowUsesBoundingBox(currItem->textFlowUsesBoundingBox());
bb->setTextFlowMode(currItem->textFlowMode());
bb->setSizeLocked(currItem->sizeLocked());
bb->setLocked(currItem->locked());
bb->NamedLStyle = currItem->NamedLStyle;
/branches/Version13x/Scribus/scribus/pageitem_textframe.cpp
120,7 → 120,7
int LayerLevItem = m_Doc->layerLevelFromNumber(docItem->LayerNr);
if (((docItem->ItemNr > ItemNr) && (docItem->LayerNr == LayerNr)) || (LayerLevItem > LayerLev) && (m_Doc->layerFlow(docItem->LayerNr)))
{
if (docItem->textFlowsAroundFrame())
if (docItem->textFlowAroundObject())
{
result = result.subtract(itemShape(docItem, m_Doc->view(), Mp->xOffset() - Dp->xOffset(), Mp->yOffset() - Dp->yOffset()));
}
133,7 → 133,7
PageItem* docItem = m_Doc->Items->at(a);
Page* Mp = m_Doc->MasterPages.at(m_Doc->MasterNames[OnMasterPage]);
Page* Dp = m_Doc->Pages->at(OwnPage);
if ((docItem->textFlowsAroundFrame()) && (docItem->OwnPage == OwnPage))
if ((docItem->textFlowAroundObject()) && (docItem->OwnPage == OwnPage))
{
result = result.subtract(itemShape(docItem, m_Doc->view(), Mp->xOffset() - Dp->xOffset(), Mp->yOffset() - Dp->yOffset()));
}
148,7 → 148,7
int LayerLevItem = m_Doc->layerLevelFromNumber(docItem->LayerNr);
if (((docItem->ItemNr > ItemNr) && (docItem->LayerNr == LayerNr)) || (LayerLevItem > LayerLev) && (m_Doc->layerFlow(docItem->LayerNr)))
{
if (docItem->textFlowsAroundFrame())
if (docItem->textFlowAroundObject())
result = result.subtract(itemShape(docItem, m_Doc->view(), 0, 0));
}
} // for all docItems
/branches/Version13x/Scribus/scribus/scribus.cpp
2668,7 → 2668,8
{
actionManager->setPDFActions(view);
updateItemLayerList();
propertiesPalette->textFlowsAroundFrame->setChecked(currItem->textFlowsAroundFrame());
//propertiesPalette->textFlowsAroundFrame->setChecked(currItem->textFlowsAroundFrame());
propertiesPalette->setTextFlowMode(currItem->textFlowMode());
scrActions["itemLock"]->setEnabled(true);
scrActions["itemLockSize"]->setEnabled(true);
scrActions["itemPrintingEnabled"]->setEnabled(true);
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/cmdobj.cpp
487,9 → 487,20
if (i == NULL)
return NULL;
if (state == -1)
i->setTextFlowsAroundFrame(!i->textFlowsAroundFrame());
else
i->setTextFlowsAroundFrame( state ? true : false);
{
if (i->textFlowAroundObject())
i->setTextFlowMode(PageItem::TextFlowDisabled);
else
i->setTextFlowMode(PageItem::TextFlowUsesFrameShape);
}
else if( state == (int) PageItem::TextFlowDisabled )
i->setTextFlowMode(PageItem::TextFlowDisabled);
else if( state == (int) PageItem::TextFlowUsesFrameShape )
i->setTextFlowMode(PageItem::TextFlowUsesFrameShape);
else if( state == (int) PageItem::TextFlowUsesBoundingBox )
i->setTextFlowMode(PageItem::TextFlowUsesBoundingBox);
else if( state == (int) PageItem::TextFlowUsesContourLine )
i->setTextFlowMode(PageItem::TextFlowUsesContourLine);
ScMW->view->DrawNew();
ScMW->slotDocCh(true);
Py_INCREF(Py_None);
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/scripter2/scripter2_scribus_pageitem.cpp
262,9 → 262,7
//.def("lineSpacing", &PageItem::lineSpacing)
.def("setLineSpacing", &PageItem::setLineSpacing)
.add_property("language", &PageItem::language, &PageItem::setLanguage)
.add_property("textFlowsAroundFrame", &PageItem::textFlowsAroundFrame, &PageItem::setTextFlowsAroundFrame)
.add_property("textFlowUsesBoundingBox", &PageItem::textFlowUsesBoundingBox, &PageItem::setTextFlowUsesBoundingBox)
.add_property("textFlowUsesContourLine", &PageItem::textFlowUsesContourLine, &PageItem::setTextFlowUsesContourLine)
.add_property("textFlowMode", &PageItem::textFlowMode, &PageItem::setTextFlowMode)
.def("itemType", &PageItem::itemType)
.def("convertTo", &PageItem::convertTo)
.def("setLayer", &PageItem::setLayer)
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/cmdobj.h
181,16 → 181,21
 
/*! docstring */
PyDoc_STRVAR(scribus_textflow__doc__,
QT_TR_NOOP("textFlowsAroundFrame(\"name\" [, state])\n\
QT_TR_NOOP("textFlowMode(\"name\" [, state])\n\
\n\
Enables/disables \"Text Flows Around Frame\" feature for object \"name\".\n\
Called with parameters string name and optional boolean \"state\". If \"state\"\n\
is not passed, text flow is toggled.\n\
Called with parameters string name and optional int \"state\" (0 <= state <= 3).\n\
Setting \"state\" to 0 will disable text flow.\n\
Setting \"state\" to 1 will make text flow around object frame.\n\
Setting \"state\" to 2 will make text flow around bounding box.\n\
Setting \"state\" to 3 will make text flow around contour line.\n\
If \"state\" is not passed, text flow is toggled.\n\
"));
/**
Enables/disables "Text Flows Around Box" feature for object.
Called with params string objectName and voluntary 1|0.
When 1 set flowing to true (0 to false). When is second param
Enables/disables "Text Flows Around Object" feature for object.
Called with params string objectName and state 0|1|2|3.
When set to 0 disable flowing, 1 text flows around frame,
2 around bounding box, 3 around contour line. When is second param
empty flowing is reverted.
02/28/2004 petr vanek
*/
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp
430,7 → 430,7
{const_cast<char*>("setVGuides"), scribus_setVguides, METH_VARARGS, tr(scribus_setVguides__doc__)},
{const_cast<char*>("sizeObject"), scribus_sizeobjabs, METH_VARARGS, tr(scribus_sizeobjabs__doc__)},
{const_cast<char*>("statusMessage"), scribus_messagebartext, METH_VARARGS, tr(scribus_messagebartext__doc__)},
{const_cast<char*>("textFlowsAroundFrame"), scribus_textflow, METH_VARARGS, tr(scribus_textflow__doc__)},
{const_cast<char*>("textFlowMode"), scribus_textflow, METH_VARARGS, tr(scribus_textflow__doc__)},
{const_cast<char*>("traceText"), scribus_tracetext, METH_VARARGS, tr(scribus_tracetext__doc__)},
{const_cast<char*>("unGroupObject"), scribus_ungroupobj, METH_VARARGS, tr(scribus_ungroupobj__doc__)},
{const_cast<char*>("unlinkTextFrames"), scribus_unlinktextframes, METH_VARARGS, tr(scribus_unlinktextframes__doc__)},
/branches/Version13x/Scribus/scribus/plugins/svgimplugin/svgplugin.cpp
630,7 → 630,8
ite->setLineTransparency(gc->TranspStroke);
ite->PLineEnd = gc->PLineEnd;
ite->PLineJoin = gc->PLineJoin;
ite->setTextFlowsAroundFrame(false);
//ite->setTextFlowsAroundFrame(false);
ite->setTextFlowMode(PageItem::TextFlowDisabled);
ite->DashOffset = gc->dashOffset;
ite->DashValues = gc->dashArray;
if (gc->Gradient != 0)
1881,7 → 1882,8
ite->setLineTransparency(gc->TranspStroke);
ite->PLineEnd = gc->PLineEnd;
ite->PLineJoin = gc->PLineJoin;
ite->setTextFlowsAroundFrame(false);
//ite->setTextFlowsAroundFrame(false);
ite->setTextFlowMode(PageItem::TextFlowDisabled);
ite->DashOffset = gc->dashOffset;
ite->DashValues = gc->dashArray;
/* if (gc->Gradient != 0)
1969,7 → 1971,7
ite->setLineTransparency(gc->TranspStroke);
ite->PLineEnd = gc->PLineEnd;
ite->PLineJoin = gc->PLineJoin;
ite->setTextFlowsAroundFrame(false);
ite->setTextFlowMode(PageItem::TextFlowDisabled);
ite->DashOffset = gc->dashOffset;
ite->DashValues = gc->dashArray;
/* if (gc->Gradient != 0)
/branches/Version13x/Scribus/scribus/undomanager.cpp
730,10 → 730,12
UndoManager::ImportEPS = tr("Import EPS image");
UndoManager::ImportOOoDraw = tr("Import OpenOffice.org Draw image");
UndoManager::ScratchSpace = tr("Scratch space");
UndoManager::TextFlow = tr("Text flows around the frame");
//UndoManager::TextFlow = tr("Text flows around the frame");
UndoManager::ObjectFrame = tr("Text flows around the frame");
UndoManager::BoundingBox = tr("Text flows around bounding box");
UndoManager::ContourLine = tr("Text flows around contour line");
UndoManager::NoTextFlow = tr("No text flow");
UndoManager::NoObjectFrame = tr("No object frame");
UndoManager::NoBoundingBox = tr("No bounding box");
UndoManager::NoContourLine = tr("No contour line");
UndoManager::PageNmbr = tr("Page %1");
899,10 → 901,12
QString UndoManager::ImportEPS = "";
QString UndoManager::ImportOOoDraw = "";
QString UndoManager::ScratchSpace = "";
QString UndoManager::TextFlow = "";
//QString UndoManager::TextFlow = "";
QString UndoManager::ObjectFrame = "";
QString UndoManager::BoundingBox = "";
QString UndoManager::ContourLine = "";
QString UndoManager::NoTextFlow = "";
QString UndoManager::NoObjectFrame = "";
QString UndoManager::NoBoundingBox = "";
QString UndoManager::NoContourLine = "";
QString UndoManager::PageNmbr = "";
/branches/Version13x/Scribus/scribus/scpreview.cpp
250,8 → 250,21
OB.m_isAnnotation = pg.attribute("ANNOTATION", "0").toInt();
if (pg.attribute("TRANSPARENT", "0").toInt() == 1)
OB.Pcolor = CommonStrings::None;
OB.Textflow = pg.attribute("TEXTFLOW").toInt();
OB.Textflow2 = pg.attribute("TEXTFLOW2", "0").toInt();
//OB.Textflow = pg.attribute("TEXTFLOW").toInt();
//OB.Textflow2 = pg.attribute("TEXTFLOW2", "0").toInt();
if ( pg.hasAttribute("TEXTFLOWMODE") )
OB.TextflowMode = (PageItem::TextFlowMode) pg.attribute("TEXTFLOWMODE", "0").toInt();
else if ( pg.attribute("TEXTFLOW").toInt() )
{
if (pg.attribute("TEXTFLOW2", "0").toInt())
OB.TextflowMode = PageItem::TextFlowUsesBoundingBox;
else if (pg.attribute("TEXTFLOW3", "0").toInt())
OB.TextflowMode = PageItem::TextFlowUsesContourLine;
else
OB.TextflowMode = PageItem::TextFlowUsesFrameShape;
}
else
OB.TextflowMode = PageItem::TextFlowDisabled;
OB.Extra = pg.attribute("EXTRA").toDouble();
OB.TExtra = pg.attribute("TEXTRA", "1").toDouble();
OB.BExtra = pg.attribute("BEXTRA", "1").toDouble();