21 #include <qlineedit.h>
22 #include <qpushbutton.h>
23 #include <qcombobox.h>
52 int x1_, y1_, x2_, y2_, x3_, y3_;
54 p->
Painter->setPen(QPen(QPen::darkGray,
Pen.width()+5));
59 p->
Painter->setPen(QPen(QPen::white,
Pen.width(),
Pen.style()));
61 p->
Painter->setPen(QPen(QPen::white,
Pen.width(), Qt::SolidLine));
67 p->
Painter->setPen(QPen(QPen::white,
Pen.width(),
Pen.style()));
70 p->
Painter->setPen(QPen(QPen::white,
Pen.width(), Qt::SolidLine));
71 p->
Painter->setBrush(QPen::white);
75 Points.setPoints(3, x1_, y1_, x2_, y2_, x3_, y3_);
76 p->
Painter->drawConvexPolygon(Points);
77 p->
Painter->setBrush(QBrush::NoBrush);
80 p->
Painter->setPen(QPen(QPen::darkRed,2));
87 p->
Painter->setPen(QPen(
Pen.color(),
Pen.width(), Qt::SolidLine));
97 Points.setPoints(3, x1_, y1_, x2_, y2_, x3_, y3_);
98 p->
Painter->drawConvexPolygon(Points);
99 p->
Painter->setBrush(QBrush::NoBrush);
122 if(relative) {
cx +=
x;
cy += y; }
123 else {
cx = x-(
x2>>1);
cy = y-(
y2>>1); }
135 Name = QObject::tr(
"Arrow");
136 BitmapFile = (
char *)
"arrow";
138 if(getNewOne)
return new Arrow();
148 n = s.section(
' ',1,1);
150 if(!ok)
return false;
152 n = s.section(
' ',2,2);
154 if(!ok)
return false;
156 n = s.section(
' ',3,3);
158 if(!ok)
return false;
160 n = s.section(
' ',4,4);
162 if(!ok)
return false;
164 n = s.section(
' ',5,5);
166 if(!ok)
return false;
168 n = s.section(
' ',6,6);
169 Width = n.toDouble(&ok);
170 if(!ok)
return false;
172 n = s.section(
' ',7,7);
176 if(!
Pen.color().isValid())
return false;
178 n = s.section(
' ',8,8);
179 Pen.setWidth(n.toInt(&ok));
180 if(!ok)
return false;
182 n = s.section(
' ',9,9);
183 Pen.setStyle((Qt::PenStyle)n.toInt(&ok));
184 if(!ok)
return false;
186 n = s.section(
' ',10,10);
188 Style = n.toInt(&ok);
189 if(!ok)
return false;
201 QString
s =
Name+QString::number(
cx)+
" "+QString::number(
cy)+
" ";
202 s += QString::number(
x2)+
" "+QString::number(
y2)+
" ";
203 s += QString::number(
int(
Height))+
" "+QString::number(
int(
Width))+
" ";
204 s +=
Pen.color().name()+
" "+QString::number(
Pen.width())+
" ";
205 s += QString::number(
Pen.style()) +
" " + QString::number(
Style);
214 QString (
"new Line (%1, %2, %3, %4, QPen (QColor (\"%5\"), %6, %7))").
217 s =
"Lines.append (" + s +
");";
225 float fCX = float(
cx),fCY = float(
cy);
226 if(fX < fCX+len)
if(fX > fCX-len)
if(fY < fCY+len)
if(fY > fCY-len) {
233 if(fX < fCX+len)
if(fX > fCX-len)
if(fY < fCY+len)
if(fY > fCY-len) {
257 double phi =
atan2(
double(
y2),
double(
x2));
272 QPainter *paintScale,
int,
int,
int gx,
int gy,
273 QPainter *p,
int x,
int y,
bool drawn)
286 else {
cx = gx;
cy = gy; }
289 p->setPen(Qt::SolidLine);
291 p->drawLine(
x1+25,
y1,
x1+13,
y1+12);
292 p->drawLine(
x1+18,
y1+2,
x1+25,
y1);
293 p->drawLine(
x1+23,
y1+7,
x1+25,
y1);
297 p->drawLine(
x1+25,
y1,
x1+13,
y1+12);
298 p->drawLine(
x1+18,
y1+2,
x1+25,
y1);
299 p->drawLine(
x1+23,
y1+7,
x1+25,
y1);
346 A = float(
x2)*fY - fX*float(
y2);
353 xn = float(
xp1-
x2); fX -= float(
x2);
354 yn = float(
yp1-y2); fY -= float(y2);
378 if(A <= w*w*(xn*xn + yn*yn))
406 if(A <= w*w*(xn*xn + yn*yn))
415 if(
x2 < 0) { _x1 =
cx+
x2; _x2 =
cx; }
416 else { _x1 =
cx; _x2 =
cx+
x2; }
418 if(
y2 < 0) { _y1 =
cy+
y2; _y2 =
cy; }
419 else { _y1 =
cy; _y2 =
cy+
y2; }
467 bool changed =
false;
477 if(d->exec() == QDialog::Rejected) {
490 if(
Pen.color() != d->
ColorButt->paletteBackgroundColor()) {