Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 231 → Rev 230

/trunk/Scribus/ChangeLogCVS
1,9 → 1,4
Changes since Version 1.1.5
13.03.2004 Added Patch from Jean-Jacques Sarton to enable Textselection with the Cursor Keys and Shift pressed.
Fixed Crash when cutting Text (also by Jean-Jacques Sarton).
Improved Object resizing and selecting.
Improved Display when moving Objects.
 
12.03.2004 Updated the Polish Translation.
Fixed a Typo in the Brazilian Translation.
Fixed Bug #340.
/trunk/Scribus/scribus/libabout/about.cpp
54,7 → 54,7
tabLayout1->addWidget( PixmapLabel1 );
BuildID = new QLabel( tab, "BB" );
BuildID->setAlignment(Qt::AlignCenter);
QString bu = tr("%1. %2 %3 ").arg("13").arg("March").arg("2004");
QString bu = tr("%1. %2 %3 ").arg("12").arg("March").arg("2004");
#ifdef HAVE_CMS
bu += "C";
#else
/trunk/Scribus/scribus/page.cpp
807,9 → 807,6
 
void Page::PaintSizeRect(QPainter *p, QRect alt, QRect neu)
{
QWMatrix ma = p->worldMatrix();
ma.setTransformationMode ( QWMatrix::Areas );
p->setWorldMatrix(ma);
p->setRasterOp(XorROP);
p->setBrush(NoBrush);
p->setPen(QPen(white, 1, DotLine, FlatCap, MiterJoin));
1215,7 → 1212,7
b->Tinput = true;
if ((HowTo == 1) && (b->PType != 5))
b->paintObj();
if ((b->FrameType == 0) || (b->PType == 5) || (HowTo != 1))
if ((b->FrameType == 0) || (b->PType == 5) || (HowTo != 1))
return true;
QPainter p;
p.begin(this);
3299,7 → 3296,6
{
for (a = 0; a < SelItem.count(); ++a)
{
QWMatrix ma;
b = SelItem.at(0);
switch (HowTo)
{
3385,9 → 3381,6
{
p.begin(this);
Transform(b, &p);
ma = p.worldMatrix();
ma.setTransformationMode ( QWMatrix::Areas );
p.setWorldMatrix(ma);
np = p.xFormDev(QPoint(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc)));
np2 = ApplyGrid(p.xFormDev(QPoint(m->x(), m->y())));
PaintSizeRect(&p, QRect(np, QPoint(static_cast<int>(b->Width),
3400,9 → 3393,6
case 3:
p.begin(this);
Transform(b, &p);
ma = p.worldMatrix();
ma.setTransformationMode ( QWMatrix::Areas );
p.setWorldMatrix(ma);
np = p.xFormDev(QPoint(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc)));
np2 = ApplyGrid(p.xFormDev(QPoint(m->x(), m->y())));
PaintSizeRect(&p, QRect(np, QPoint(0, static_cast<int>(b->Height))),
3412,9 → 3402,6
case 4:
p.begin(this);
Transform(b, &p);
ma = p.worldMatrix();
ma.setTransformationMode ( QWMatrix::Areas );
p.setWorldMatrix(ma);
np = p.xFormDev(QPoint(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc)));
np2 = ApplyGrid(p.xFormDev(QPoint(m->x(), m->y())));
PaintSizeRect(&p, QRect(np, QPoint(static_cast<int>(b->Width), 0)),
3424,9 → 3411,6
case 5:
p.begin(this);
Transform(b, &p);
ma = p.worldMatrix();
ma.setTransformationMode ( QWMatrix::Areas );
p.setWorldMatrix(ma);
np = p.xFormDev(QPoint(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc)));
np2 = ApplyGrid(p.xFormDev(QPoint(m->x(), m->y())));
PaintSizeRect(&p, QRect(QPoint(static_cast<int>(b->Width), np.y()), QPoint(0, 0)),
3437,9 → 3421,6
case 6:
p.begin(this);
Transform(b, &p);
ma = p.worldMatrix();
ma.setTransformationMode ( QWMatrix::Areas );
p.setWorldMatrix(ma);
np = p.xFormDev(QPoint(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc)));
np2 = ApplyGrid(p.xFormDev(QPoint(m->x(), m->y())));
PaintSizeRect(&p, QRect(QPoint(np.x(), static_cast<int>(b->Height)),
3450,9 → 3431,6
case 7:
p.begin(this);
Transform(b, &p);
ma = p.worldMatrix();
ma.setTransformationMode ( QWMatrix::Areas );
p.setWorldMatrix(ma);
np = p.xFormDev(QPoint(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc)));
np2 = ApplyGrid(p.xFormDev(QPoint(m->x(), m->y())));
PaintSizeRect(&p, QRect(QPoint(np.x(), static_cast<int>(b->Height)),
3464,9 → 3442,6
case 8:
p.begin(this);
Transform(b, &p);
ma = p.worldMatrix();
ma.setTransformationMode ( QWMatrix::Areas );
p.setWorldMatrix(ma);
np = p.xFormDev(QPoint(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc)));
np2 = ApplyGrid(p.xFormDev(QPoint(m->x(), m->y())));
PaintSizeRect(&p, QRect(QPoint(static_cast<int>(b->Width),np.y()),
3506,10 → 3481,7
p.setRasterOp(XorROP);
p.setBrush(NoBrush);
p.setPen(QPen(white, 1, DotLine, FlatCap, MiterJoin));
if ((b->PType != 5) && (b->FrameType != 0) || (b->PType == 7))
b->DrawPolyL(&p, b->Clip);
else
p.drawRect(0, 0, static_cast<int>(b->Width)+1, static_cast<int>(b->Height)+1);
p.drawRect(0, 0, static_cast<int>(b->Width)+1, static_cast<int>(b->Height)+1);
p.end();
erf = MoveItem(newX-Mxp, newY-Myp, b);
p.begin(this);
3517,10 → 3489,7
p.setRasterOp(XorROP);
p.setBrush(NoBrush);
p.setPen(QPen(white, 1, DotLine, FlatCap, MiterJoin));
if ((b->PType != 5) && (b->FrameType != 0) || (b->PType == 7))
b->DrawPolyL(&p, b->Clip);
else
p.drawRect(0, 0, static_cast<int>(b->Width)+1, static_cast<int>(b->Height)+1);
p.drawRect(0, 0, static_cast<int>(b->Width)+1, static_cast<int>(b->Height)+1);
p.end();
}
if (erf)
3623,12 → 3592,6
}
}
}
QWMatrix ma;
ma.scale(doku->Scale, doku->Scale);
ma.translate(b->Xpos, b->Ypos);
ma.rotate(b->Rot);
ma.setTransformationMode ( QWMatrix::Areas );
p.setWorldMatrix(ma);
tx = p.xForm(QRect(0, 0, static_cast<int>(b->Width), static_cast<int>(b->Height)));
if (tx.contains(m->pos()))
{
3642,7 → 3605,8
if (b->PType == 2)
qApp->setOverrideCursor(QCursor(loadIcon("HandC.xpm")), true);
}
QRect mpo = QRect(m->x()-doku->GrabRad, m->y()-doku->GrabRad, doku->GrabRad*2, doku->GrabRad*2);
QRect mpo = QRect(m->x()-doku->GrabRad, m->y()-doku->GrabRad, doku->GrabRad*2,
doku->GrabRad*2);
HandleCurs(&p, b, mpo);
}
else
4004,13 → 3968,8
{
p.begin(this);
Transform(b, &p);
QWMatrix ma;
ma.scale(doku->Scale, doku->Scale);
ma.translate(b->Xpos, b->Ypos);
ma.rotate(b->Rot);
ma.setTransformationMode ( QWMatrix::Areas );
p.setWorldMatrix(ma);
if (!QRegion(p.xForm(QPointArray(QRect(0, 0, static_cast<int>(b->Width), static_cast<int>(b->Height))))).contains(mpo))
if (!QRegion(p.xForm(QPointArray(QRect(0, 0, static_cast<int>(b->Width),
static_cast<int>(b->Height))))).contains(mpo))
{
SeleItem(m);
if (SelItem.count() != 0)
4435,12 → 4394,6
 
void Page::HandleCurs(QPainter *p, PageItem *b, QRect mpo)
{
QWMatrix ma;
ma.scale(doku->Scale, doku->Scale);
ma.translate(b->Xpos, b->Ypos);
ma.rotate(b->Rot);
ma.setTransformationMode ( QWMatrix::Areas );
p->setWorldMatrix(ma);
QPoint tx, tx2;
tx = p->xForm(QPoint(static_cast<int>(b->Width), 0));
tx2 = p->xForm(QPoint(0, static_cast<int>(b->Height)));
4506,14 → 4459,6
HowTo = 0;
if (b->LockRes)
return;
if (mpo.contains(p->xForm(QPoint(static_cast<int>(b->Width), static_cast<int>(b->Height)))))
HowTo = 1;
QWMatrix ma;
ma.scale(doku->Scale, doku->Scale);
ma.translate(b->Xpos, b->Ypos);
ma.rotate(b->Rot);
ma.setTransformationMode ( QWMatrix::Areas );
p->setWorldMatrix(ma);
if (b->PType != 5)
{
if (mpo.contains(p->xForm(QPoint(0, 0))))
4531,6 → 4476,8
if (mpo.contains(p->xForm(QPoint(static_cast<int>(b->Width), 0))))
HowTo = 3;
}
if (mpo.contains(p->xForm(QPoint(static_cast<int>(b->Width), static_cast<int>(b->Height)))))
HowTo = 1;
HandleCurs(p, b, mpo);
storeUndoInf(b);
if (HowTo != 0)
4656,16 → 4603,12
double sc = doku->Scale;
QPainter p;
QRect tx, mpo;
PageItem* b;
PageItem* b = Items.last();
Mpressed = true;
Mxp = static_cast<int>(m->x()/sc);
Myp = static_cast<int>(m->y()/sc);
mpo = QRect(m->x()-doku->GrabRad, m->y()-doku->GrabRad, doku->GrabRad*2, doku->GrabRad*2);
ClRe = -1;
if ((SelItem.count() != 0) && (m->state() == ControlButton))
b = SelItem.at(0);
else
b = Items.last();
if (doku->ActPage != this)
{
Deselect(false);
4694,21 → 4637,13
for (a = 0; a < Items.count(); ++a)
{
if (b == NULL)
{
Deselect(true);
SelItem.clear();
return false;
}
if (b->LayerNr == doku->ActiveLayer)
{
p.begin(this);
Transform(b, &p);
QWMatrix ma;
ma.scale(doku->Scale, doku->Scale);
ma.translate(b->Xpos, b->Ypos);
ma.rotate(b->Rot);
ma.setTransformationMode ( QWMatrix::Areas );
if ((QRegion(p.xForm(QPointArray(QRect(0, 0, static_cast<int>(b->Width), static_cast<int>(b->Height))))).contains(mpo)) ||
if ((QRegion(p.xForm(QPointArray(QRect(0, 0, static_cast<int>(b->Width),
static_cast<int>(b->Height))))).contains(mpo)) ||
(QRegion(p.xForm(b->Clip)).contains(mpo)))
{
if (!b->Select)
4923,109 → 4858,6
emit HaveSel(b->PType);
}
 
// jjsa added on 14-mar-2004 text selection with pressed
// shift button and <-, -> cursor keys
// Parameters
// PageItem *b text item to be processed
// inc < 0 for left key > 0 for right key
// if value is +/-1 work on slection
// if value is +/-2 refresh if text under cursor is selected
 
void Page::ExpandSel(PageItem *b, int inc)
{
int pos = b->CPos;
int len = b->Ptext.count();
int rightSel = false; // assume left right and actual char not selected
int leftSel = false;
int actSel = false;
int selMode = false;
if ( inc == -1 || inc == 1 )
selMode = true;
// show for selection of previous, actual and next character
if ( b->HasSel ) /* selection allready present */
{
if (inc > 0 ) // -> key
{
actSel = b->Ptext.at(pos-1)->cselect;
if ( pos < len )
rightSel = b->Ptext.at(pos)->cselect;
if ( pos > 1 )
leftSel = b->Ptext.at(pos-2)->cselect;
}
else // <- key
{
actSel = b->Ptext.at(pos)->cselect;
if ( pos > 0 )
leftSel = b->Ptext.at(pos-1)->cselect;
if ( pos+1 < len )
rightSel = b->Ptext.at(pos+1)->cselect;
}
if ( selMode && ! (leftSel||actSel||rightSel) )
{
// selected outside from concerned range
// deselect all
int i;
for (i=0; i < len; ++i )
{
b->Ptext.at(i)->cselect = false;
}
b->HasSel = false;
emit HasNoTextSel();
}
else if ( !selMode )
{
if (leftSel||actSel||rightSel)
Page::RefreshItem(b);
}
}
if ( !selMode )
return;
// no selection
if ( !b->HasSel )
{
if ( inc == -1 ) // <- key
b->Ptext.at(pos)->cselect = true;
else // -> key
b->Ptext.at(pos-1)->cselect = true;
b->HasSel = true;
emit HasTextSel();
}
else // Selection present
{
if (inc == 1) // -> key
{
if ( leftSel == true )
b->Ptext.at(pos-1)->cselect = true;
else
{
b->Ptext.at(pos-1)->cselect = false;
if ( rightSel == false )
{
b->HasSel = false;
emit HasNoTextSel();
}
}
}
else // <- key
{
if ( rightSel == true )
{
b->Ptext.at(pos)->cselect = true;
}
else
{
b->Ptext.at(pos)->cselect = false;
if ( leftSel == false )
{
b->HasSel = false;
emit HasNoTextSel();
}
}
}
}
Page::RefreshItem(b);
}
 
bool Page::slotSetCurs(int x, int y)
{
if (doku->ActPage != this) {return false;}
5160,9 → 4992,9
TransformM(b, &p);
if (b->CPos > 0)
{
offs = QMIN(b->CPos-1, static_cast<int>(b->Ptext.count()-1));
if (b->Ptext.at(offs)->yp == 0)
if (b->Ptext.at(b->CPos-1)->yp == 0)
return;
offs = b->CPos-1;
chx = b->Ptext.at(offs)->ch;
if (chx == QChar(30))
chx = b->ExpandToken(offs);
/trunk/Scribus/scribus/page.h
228,7 → 228,6
void RaiseItem();
void ClearItem();
void DeleteItem();
void ExpandSel(PageItem *b, int inc);
bool slotSetCurs(int x, int y);
void slotDoCurs(bool draw);
void BlinkCurs();
/trunk/Scribus/scribus/pageitem.cpp
1343,19 → 1343,17
}
if (NextBox->OwnPage != OwnPage)
{
if (Doc->RePos)
{
p->save();
QPixmap pgPix(1, 1);
ScPainter *painter = new ScPainter(&pgPix, 1, 1);
painter->translate(0.5, 0.5);
NextBox->DrawObj(painter, QRect(0, 0, 1, 1));
painter->end();
delete painter;
p->restore();
}
else
NextBox->OwnPage->update();
bool savre = Doc->RePos;
Doc->RePos = true;
p->save();
QPixmap pgPix(1, 1);
ScPainter *painter = new ScPainter(&pgPix, 1, 1);
painter->translate(0.5, 0.5);
NextBox->DrawObj(painter, QRect(0, 0, 1, 1));
painter->end();
delete painter;
p->restore();
Doc->RePos = savre;
}
else
{
/trunk/Scribus/scribus/scribus.cpp
964,9 → 964,6
}
else
b->CPos = 0;
int l;
if (b->CPos > (l = b->Ptext.count()) )
b->CPos = l;
b->HasSel = false;
DisableTxEdit();
}
1286,16 → 1283,6
b = b->BackBox;
}
}
// jjsa add (de)selection if keyMode == 0x00200000
// shift pressed ?
else if ( KeyMod & 0x00200000 && b->CPos >= 0 )
{
doc->ActPage->ExpandSel(b, -1 );
}
else // refresh if selected text under our cursor
{
doc->ActPage->ExpandSel(b,-2);
}
setTBvals(b);
break;
case Key_Right:
1315,16 → 1302,6
}
}
}
// jjsa add (de)selection if keyMode == 0x00200000
// shift pressed ?
else if ( KeyMod & 0x00200000 && b->CPos <= b->Ptext.count())
{
doc->ActPage->ExpandSel(b,1);
}
else // refresh if selected text under our cursor
{
doc->ActPage->ExpandSel(b,2);
}
setTBvals(b);
break;
case Key_Delete:
2209,10 → 2186,7
if (doc->MasterP)
WerkTools->KetteEin->setEnabled(false);
if (doc->AppMode == 7)
{
setTBvals(b);
editMenu->setItemEnabled(edid5, 1);
}
else
{
doc->CurrFont = b->IFont;
/trunk/Scribus/scribus/mpalette.cpp
663,9 → 663,7
pageLayout_5 = new QVBoxLayout( page_5, 0, 5, "pageLayout_5");
 
Layout13_2 = new QHBoxLayout( 0, 0, 4, "Layout13_2");
LineModeT = new QLabel( page_5, "LModeText" );
LineModeT->setText( tr( "Basepoint:" ) );
Layout13_2->addWidget( LineModeT );
 
LineMode = new QComboBox( true, page_5, "LMode" );
LineMode->setEditable(false);
LineMode->insertItem( tr( "Left Point" ) );
/trunk/Scribus/scribus/cpalette.cpp
238,16 → 238,22
ListBox1->setCurrentItem(c);
}
 
void Cpalette::updateShade(int sh)
{
/* PFJ - 29.02.04 - rewritten to use tenary */
SetMen(sh % 10 == 0 ? sh / 10 + 1 : 0);
}
 
void Cpalette::setActFarben(QString p, QString b, int shp, int shb)
{
switch (Mode)
{
case 1:
PM1->setValue(shp);
updateShade(shp);
updateBoxS(p);
break;
case 2:
PM1->setValue(shb);
updateShade(shb);
updateBoxS(b);
Color3 = b;
Shade3 = shb;
259,12 → 265,12
{
if (GrColor1->isChecked())
{
PM1->setValue(Shade);
updateShade(Shade);
updateBoxS(Color);
}
if (GrColor2->isChecked())
{
PM1->setValue(Shade2);
updateShade(Shade2);
updateBoxS(Color2);
}
}
287,7 → 293,7
updateCList();
updateGeometry();
repaint();
PM1->setValue(Shade3);
updateShade(Shade3);
updateBoxS(Color3);
break;
default:
294,12 → 300,12
updateCList();
if (GrColor1->isChecked())
{
PM1->setValue(Shade);
updateShade(Shade);
updateBoxS(Color);
}
if (GrColor2->isChecked())
{
PM1->setValue(Shade2);
updateShade(Shade2);
updateBoxS(Color2);
}
break;
361,6 → 367,14
connect(GradCombo, SIGNAL(activated(int)), this, SLOT(slotGrad(int)));
}
 
int Cpalette::SetMen(int c)
{
/* PFJ - 29.02.04 - merged initialisation of b and removed if (c > 0) */
int b = c > 0 ? (c - 1) * 10 : 0;
PM1->setValue(b);
return b;
}
 
void Cpalette::setActShade()
{
int b = PM1->getValue();
/trunk/Scribus/scribus/mpalette.h
174,7 → 174,6
QLabel* TextCms2;
QComboBox* InputP;
QComboBox* MonitorI;
QLabel* LineModeT;
QComboBox* LineMode;
QLabel* Text9;
MSpinBox* LSize;
/trunk/Scribus/scribus/cpalette.h
73,6 → 73,7
void InnenButton();
void SetColors(CListe farben);
void updateCList();
void updateShade(int sh);
void updateBoxS(QString Farbe);
void selFarbe(QListBoxItem *c);
void slotGrad(int nr);
80,6 → 81,7
void ChooseGrad(int nr);
void setActFarben(QString p, QString b, int shp, int shb);
void setActGradient(QString p, QString b, int shp, int shb, int typ);
int SetMen(int c);
void setActShade();
void setActTrans(double, double);
void slotTrans(int val);
/trunk/Scribus/scribus/shadebutton.cpp
40,7 → 40,7
{
c = dia->Answer->text().toInt(&ok);
if (ok)
b = QMAX(QMIN(c, 100),0);
b = c;
else
b = 100;
delete dia;
57,9 → 57,7
 
int ShadeButton::getValue()
{
int l = text().length();
QString tx = text().remove(l-2,2);
return tx.toInt();
return text().remove(" %").toInt();
}
 
void ShadeButton::setValue(int val)