Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / qt / 2007-07

Qt TArrow implementation

14 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

zeljko

Hi,
I've had some free time this morning to implement TArrow, but cannot make decision on my own.
Pls, look at screenshoot and give a vote for arrows look. Left arrows are like winXp ones, right arrows are my idea. Also each arrow have different shadow type (I didn't see implementation of ShadowType on winXp & linux ).Is this correct or shadow have to be around arrow ?

zeljko
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tarrows.png
Type: image/png
Size: 7797 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/qt/attachments/20070705/f3633265/attachment.png>

Felipe Monteiro de Carvalho
to zeljko

How are you implementing this? Using custom drawing?

If so, shouldn't lcl draw this itself?

Felipe Monteiro de Carvalho
zeljko
to Felipe Monteiro de Carvalho
Felipe Monteiro de Carvalho wrote
How are you implementing this? Using custom drawing?

winapi.Polygon(), but of course it can be custom drawed (right arrows from 1st screenshoot are custom drawed).

If so, shouldn't lcl draw this itself?

yes, via polygon, but seem that last 1.40 bindings messed up points. now it looks like s**t.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tarrows1.png
Type: image/png
Size: 8016 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/qt/attachments/20070705/5cb66bbf/attachment.png>

Felipe Monteiro de Carvalho
to zeljko
zeljko wrote
yes, via polygon, but seem that last 1.40 bindings messed up points. now it looks like s**t. that should be fixed instead.

Drawing our own TArrow will just hide the real problem.

Felipe Monteiro de Carvalho
zeljko
to Felipe Monteiro de Carvalho
Felipe Monteiro de Carvalho wrote 5 lines
On 7/5/07, zeljko wrote: > yes, via polygon, but seem that last 1.40 bindings messed up points. > now it looks like s**t. Look at attachment. Then that should be fixed instead.

what ? polygon() or bindings ? seem that points are reversed now on linux.

Drawing our own TArrow will just hide the real problem.

we'll draw it via LCL definitelly.

Felipe Monteiro de Carvalho
to zeljko
zeljko wrote
what ? polygon() or bindings ? seem that points are reversed now on linux.

One of the two, I'm not sure which. If the points are really wrong on linux, then it's the bindings.

Felipe Monteiro de Carvalho
zeljko
to Felipe Monteiro de Carvalho
Felipe Monteiro de Carvalho wrote 6 lines
On 7/5/07, zeljko wrote: > what ? polygon() or bindings ? seem that points are reversed now on > linux. One of the two, I'm not sure which. If the points are really wrong on linux, then it's the bindings.

This code doesn't work as of 1.40 (with 1.37 it was ok). procedure QPainter_drawPolygon(handle: QPainterH; points: PPoint; pointCount: Integer; fillRule: QtFillRule = QtOddEvenFill); which is used in qtwinapi.Polygon() doesn't work anymore.
Seem that PPoints aren't properly copied to QPoint under linux. Den ?

Den Jean
to zeljko: winapi.Polygon(), but of course it can be custom drawed (right arrows from 1st…
pm zeljko wrote
yes, via polygon, but seem that last 1.40 bindings messed up points. now it looks like s**t. already noticed. This is due to QPoint copying for DARWIN.

There are many procedures with a QPoint * parameter, that is not a single point, but an array of QPoint. The binding cannot know that and copies the provided PPoint into one QPoint .....

I cannot reliably fix this, so I will remove the DARWIN QPoint copiers and use a different pascal Point type. Please be aware of the obvious consequence: never to mix Types.Point and TQtPoint.

void drawConvexPolygon ( const QPoint * points, int pointCount )

becomes:

void QPainter_drawConvexPolygon3(QPainterH handle, PPoint points, int pointCount)
{

	QPoint t_points;
	if ( points )
		copyPPointToQPoint(points, t_points);
	((QPainter *)handle)->drawConvexPolygon(points ? &t_points : NULL,

pointCount);

Jesus Reyes A.
to zeljko: winapi.Polygon(), but of course it can be custom drawed (right arrows from 1st…

----- Original Message -----

Earlier message 37 lines
From: "zeljko" To: "Items specific to the Qt widget set" Sent: Thursday, July 05, 2007 5:07 AM Subject: Re: [Qt] Qt TArrow implementation > On Thursday 05 July 2007 10:36, Felipe Monteiro de Carvalho wrote: >> How are you implementing this? Using custom drawing? > > winapi.Polygon(), but of course it can be custom drawed (right arrows from > 1st > screenshoot are custom drawed). Using winapi.Polygon looks custom drawn to me, at least under linux and windows they are not custom drawn. Under windows it looks it's drawing unsing DrawFrameControl to draw scrollbar arrow (but it's not yet themed, maybe Paul know if can be themed if so maybe it should be changed, and that would be if arrows are supposed to be scrollbars arrows). Under gtk, TArrow is drawn using native widget and I guess it's the origin of this component. in neither gtk or windows was able to draw any frame, in fact I don't know what ShadowType means, will try to find out next time I boot linux. > >> If so, shouldn't lcl draw this itself? > > yes, via polygon, but seem that last 1.40 bindings messed up points. > now it looks like s**t. Look at attachment. > > zeljko > Jesus Reyes A.
zeljko
to Jesus Reyes A.
Jesus Reyes A. wrote 23 lines
----- Original Message ----- From: "zeljko" To: "Items specific to the Qt widget set" Sent: Thursday, July 05, 2007 5:07 AM Subject: Re: [Qt] Qt TArrow implementation > On Thursday 05 July 2007 10:36, Felipe Monteiro de Carvalho wrote: >> How are you implementing this? Using custom drawing? > > winapi.Polygon(), but of course it can be custom drawed (right arrows > from 1st > screenshoot are custom drawed). Using winapi.Polygon looks custom drawn to me, at least under linux and windows they are not custom drawn. Under windows it looks it's drawing unsing DrawFrameControl to draw scrollbar arrow (but it's not yet themed, maybe Paul know if can be themed if so maybe it should be changed, and that would be if arrows are supposed to be scrollbars arrows). Under gtk, TArrow is drawn using native widget and I guess it's the origin of this component.

Theres procedure in lclintf called DrawArrow() which do the job, so arrow can look like gtk one (very ugly), or win32, whatever ... It's already implemented at my svn copy, but I'm waiting for bindings update and fixation of points problem.

in neither gtk or windows was able to draw any frame, in fact I don't know what ShadowType means, will try to find out next time I boot linux.

Think that's frame of the widget, not arrow, but could be also arrow frame, didn't found anywhere in docs what it could be.

zeljko

Unknown author
It's already implemented at my svn copy, but I'm waiting for bindings update and fixation of points problem.

I did a quick release. Can you test and report back. After that I will make a windows binary.

I will also see for Qt4.2.3 releases.
Perhaps source only for windows, I do not know yet if I can get 2 Qt's on my windows machine

regards,

Den Jean

Felipe Monteiro de Carvalho
to Unknown author
I will also see for Qt4.2.3 releases. Perhaps source only for windows, I do not know yet if I can get 2 Qt's on my windows machine

This should be enougth.

Felipe Monteiro de Carvalho