I am creating a package that has a design time component. It originally used the Resize method to paint the window. After the component is dropped an error is given and the component is not added to the form. I tried to change from Resize to DoOnResize without success. See callstack below:

ERROR in LCL: TWinControl.CreateWnd: no parent :TATBinHex
Creating gdb catchable error:
 $0040EE88  RAISEGDBEXCEPTION,  line 779 of LCLProc.pas
 $0048B418  TWINCONTROL__CREATEWND,  line 5173 of ./include/wincontrol.inc
$0048B0FF TWINCONTROL__CREATEHANDLE, line 5113 of ./include/wincontrol.inc $0048BF48 TWINCONTROL__HANDLENEEDED, line 5469 of ./include/wincontrol.inc
 $0048A419  TWINCONTROL__GETHANDLE,  line 4463 of ./include/wincontrol.inc
 $009A1D1F  TATBINHEX__HIDESCROLLBAR,  line 1280 of ATBinHex.pas
 $009A0660  TATBINHEX__REDRAW,  line 1026 of ATBinHex.pas
 $009A22D1  TATBINHEX__DOONRESIZE,  line 1427 of ATBinHex.pas
 $00492718  TCONTROL__RESIZE,  line 2560 of ./include/control.inc
$009A20A5 TATBINHEX__RESIZE, line 1369 of ATBinHex.pas //TABINHEX.Resize does nothing
 $0048E699  TCONTROL__CHANGEBOUNDS,  line 406 of ./include/control.inc
 $00492ADE  TCONTROL__SETBOUNDS,  line 2662 of ./include/control.inc
 $0048C796  TWINCONTROL__SETBOUNDS,  line 5724 of ./include/wincontrol.inc
 $00495F27  TCONTROL__SETINITIALBOUNDS,  line 3915 of ./include/control.inc
 $004AB0B2  TCUSTOMPANEL__CREATE,  line 44 of ./include/custompanel.inc
 $0099FDC0  TATBINHEX__CREATE,  line 797 of ATBinHex.pas
$00596C2B TCUSTOMFORMEDITOR__CREATECOMPONENT, line 1348 of CustomFormEditor.pp $0058F856 ADDCOMPONENT, line 1469 of E:/repositories/lazarus/designer/Designer.pp


Since TControl.Resize checks the ComponentState before calling DoOnResize, i think that would resolve the problem but is not true. It seems that csLoading is not in component state at that time.

So the question is there's a way to check if a TComponent is being Created? What the ComponentState just after the call to the constructor?

Thanks in advance

Luiz

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to