Sign in Join

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

Mailing lists / qt / 2008-01

qDrawShadeRect

6 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Paul Ishenin
to Den Jean
Den Jean wrote 7 lines
On Sunday 06 January 2008 08:48:59 am Paul Ishenin wrote: >> Den, can you add qDrawShadeRect? >> > and also qDrawPlainRect Done. And Os X should be fixed now too. V1.58

My fault. I thought qDrawShadeRect will be useful for Frame3D function but seems I need qDrawWinPanel there.

Can you add qDrawWinPanel?

Best regards,
Paul Ishenin.

Reply by email

Den Jean

Hi,

Can you add qDrawWinPanel?

Done: V.159

I added several, not all of qdrawutil.h. Because these functions are not in a class, I need to do it manually.(Created a header with a temp class with static functions like the requested ones, copy pasted the temp result to the scripts that add this to qtpas.cpp)

Both the x,y,w,h and PRect version available:
procedure q_DrawPlainRect(p: QPainterH; x: Integer; y: Integer; w: Integer;
h: Integer; p6: PQColor; lineWidth: Integer = 1; fill: QBrushH = nil);
procedure q_DrawPlainRect(p: QPainterH; r: PRect; p3: PQColor; lineWidth:
Integer = 1; fill: QBrushH = nil);

I added some the PRect functions due to the differences in rectangle between lazarus/fpc and Qt: "-1". Remember also the Mac OS X specific stuff needed.

Therefore the functions that use a rect have this code:

void q_DrawPlainRect2(QPainterH p, PRect r, const QColorH p3, int lineWidth , const QBrushH fill) {

  QRect t_r;
  copyPRectToQRect(r, t_r);
  qDrawPlainRect((QPainter*)p, t_r, *(const QColor*)p3, lineWidth, (const

QBrush*)fi
ll);
}

and:
inline void copyPRectToQRect(PRect pr, QRect &qr)
{
#if defined DARWIN
  qr.setLeft(((QRect *)pr)->top());
  qr.setTop(((QRect *)pr)->left());
  qr.setRight(((QRect *)pr)->bottom()-1);
  qr.setBottom(((QRect *)pr)->right()-1);
#else
  qr.setLeft(((QRect *)pr)->left());
  qr.setTop(((QRect *)pr)->top());
  qr.setRight(((QRect *)pr)->right()-1);
  qr.setBottom(((QRect *)pr)->bottom()-1);
#endif
}

so carefully choose with x,y,w,h or with rect.

regards,

Den Jean
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/qt/attachments/20080109/f078747d/attachment.html>

Reply by email