On Thu, 02 Mar 2006 09:20:36 -0300
Felipe Monteiro de Carvalho <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I am trying to implement TLabel for the Qt widgetset. I implemented
> ExtTextOut winapi function and then droped a TLabel on a form and
> compiled it, but at run-time I get this error:
>
> TControl.DoSetBounds Label1:TLabel Old=174,44,65,17
> New=174,44,145497925,1208546853
> ERROR in LCL: TControl.DoSetBounds Label1:TLabel Invalid bounds
> Creating gdb catchable error:
> [FORMS.PP] ExceptionOccurred
> Sender=EInvalidOp
> Exception=Invalid floating point operation
> Stack trace:
> $080AC6F8 RAISEGDBEXCEPTION, line 737 of lclproc.pas
> $080DA7B3 BOUNDSOUTOFBOUNDS, line 440 of ./include/control.inc
> $080DA545 TCONTROL__DOSETBOUNDS, line 445 of ./include/control.inc
> $080DA1D1 TCONTROL__CHANGEBOUNDS, line 364 of ./include/control.inc
> ......
>
> This doesn't happen with other controls I tested. Any ideas what this
> is? Wrong values are being passed to DoSetBounds, but where does LCL
> read the Width and Height of the control?
How to find out:
- add a check to DoSetBounds to raise an error if bounds over 10000
- create a backtrace
> Another problem is that Qt does not allow painting outside a paint
> event, but winapi is allows it. Has anyone had this problem before?
Yes. The Gtk interface has the same problem: Painting is only allowed during
Paint event.
> Like on Carbon widgetset, perhaps.
No. The Carbon interface will probably allow it.
> Maybe I should try to detect if a drawing function was called outside a
> paint event and if so, create a list of functions to be called when a
> paint event occur.
>
> Or Should I send a paint message everytime a paint function is called
> outside OnPaint?
Better: Write into the wiki, that painting on controls should only be done
in the 'OnPaint' event or the 'Paint' method. Some widgetsets like gtk and
qt require it.
Mattias
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives