Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 230 → Rev 231

/trunk/Scribus/ChangeLogCVS
1,4 → 1,9
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/mpalette.h
174,6 → 174,7
QLabel* TextCms2;
QComboBox* InputP;
QComboBox* MonitorI;
QLabel* LineModeT;
QComboBox* LineMode;
QLabel* Text9;
MSpinBox* LSize;
/trunk/Scribus/scribus/mpalette.cpp
663,7 → 663,9
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/page.h
228,6 → 228,7
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,17 → 1343,19
}
if (NextBox->OwnPage != OwnPage)
{
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;
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();
}
else
{
/trunk/Scribus/scribus/cpalette.cpp
238,22 → 238,16
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:
updateShade(shp);
PM1->setValue(shp);
updateBoxS(p);
break;
case 2:
updateShade(shb);
PM1->setValue(shb);
updateBoxS(b);
Color3 = b;
Shade3 = shb;
265,12 → 259,12
{
if (GrColor1->isChecked())
{
updateShade(Shade);
PM1->setValue(Shade);
updateBoxS(Color);
}
if (GrColor2->isChecked())
{
updateShade(Shade2);
PM1->setValue(Shade2);
updateBoxS(Color2);
}
}
293,7 → 287,7
updateCList();
updateGeometry();
repaint();
updateShade(Shade3);
PM1->setValue(Shade3);
updateBoxS(Color3);
break;
default:
300,12 → 294,12
updateCList();
if (GrColor1->isChecked())
{
updateShade(Shade);
PM1->setValue(Shade);
updateBoxS(Color);
}
if (GrColor2->isChecked())
{
updateShade(Shade2);
PM1->setValue(Shade2);
updateBoxS(Color2);
}
break;
367,14 → 361,6
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/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("12").arg("March").arg("2004");
QString bu = tr("%1. %2 %3 ").arg("13").arg("March").arg("2004");
#ifdef HAVE_CMS
bu += "C";
#else
/trunk/Scribus/scribus/scribus.cpp
964,6 → 964,9
}
else
b->CPos = 0;
int l;
if (b->CPos > (l = b->Ptext.count()) )
b->CPos = l;
b->HasSel = false;
DisableTxEdit();
}
1283,6 → 1286,16
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:
1302,6 → 1315,16
}
}
}
// 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:
2186,7 → 2209,10
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/page.cpp
807,6 → 807,9
 
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));
1212,7 → 1215,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);
3296,6 → 3299,7
{
for (a = 0; a < SelItem.count(); ++a)
{
QWMatrix ma;
b = SelItem.at(0);
switch (HowTo)
{
3381,6 → 3385,9
{
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),
3393,6 → 3400,9
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))),
3402,6 → 3412,9
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)),
3411,6 → 3424,9
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)),
3421,6 → 3437,9
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)),
3431,6 → 3450,9
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)),
3442,6 → 3464,9
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()),
3481,7 → 3506,10
p.setRasterOp(XorROP);
p.setBrush(NoBrush);
p.setPen(QPen(white, 1, DotLine, FlatCap, MiterJoin));
p.drawRect(0, 0, static_cast<int>(b->Width)+1, static_cast<int>(b->Height)+1);
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.end();
erf = MoveItem(newX-Mxp, newY-Myp, b);
p.begin(this);
3489,7 → 3517,10
p.setRasterOp(XorROP);
p.setBrush(NoBrush);
p.setPen(QPen(white, 1, DotLine, FlatCap, MiterJoin));
p.drawRect(0, 0, static_cast<int>(b->Width)+1, static_cast<int>(b->Height)+1);
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.end();
}
if (erf)
3592,6 → 3623,12
}
}
}
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()))
{
3605,8 → 3642,7
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
3968,8 → 4004,13
{
p.begin(this);
Transform(b, &p);
if (!QRegion(p.xForm(QPointArray(QRect(0, 0, static_cast<int>(b->Width),
static_cast<int>(b->Height))))).contains(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);
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)
4394,6 → 4435,12
 
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)));
4459,6 → 4506,14
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))))
4476,8 → 4531,6
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)
4603,12 → 4656,16
double sc = doku->Scale;
QPainter p;
QRect tx, mpo;
PageItem* b = Items.last();
PageItem* b;
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);
4637,13 → 4694,21
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);
if ((QRegion(p.xForm(QPointArray(QRect(0, 0, static_cast<int>(b->Width),
static_cast<int>(b->Height))))).contains(mpo)) ||
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)) ||
(QRegion(p.xForm(b->Clip)).contains(mpo)))
{
if (!b->Select)
4858,6 → 4923,109
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;}
4992,9 → 5160,9
TransformM(b, &p);
if (b->CPos > 0)
{
if (b->Ptext.at(b->CPos-1)->yp == 0)
offs = QMIN(b->CPos-1, static_cast<int>(b->Ptext.count()-1));
if (b->Ptext.at(offs)->yp == 0)
return;
offs = b->CPos-1;
chx = b->Ptext.at(offs)->ch;
if (chx == QChar(30))
chx = b->ExpandToken(offs);
/trunk/Scribus/scribus/shadebutton.cpp
40,7 → 40,7
{
c = dia->Answer->text().toInt(&ok);
if (ok)
b = c;
b = QMAX(QMIN(c, 100),0);
else
b = 100;
delete dia;
57,7 → 57,9
 
int ShadeButton::getValue()
{
return text().remove(" %").toInt();
int l = text().length();
QString tx = text().remove(l-2,2);
return tx.toInt();
}
 
void ShadeButton::setValue(int val)
/trunk/Scribus/scribus/cpalette.h
73,7 → 73,6
void InnenButton();
void SetColors(CListe farben);
void updateCList();
void updateShade(int sh);
void updateBoxS(QString Farbe);
void selFarbe(QListBoxItem *c);
void slotGrad(int nr);
81,7 → 80,6
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);