[Lazarus] Scaling problem in object inspector constructor: form does not exist

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] Scaling problem in object inspector constructor: form does not exist

Free Pascal - Lazarus mailing list

Hi,

I create a RTTI  property grid in the constructor of a TTabsheet descendent.
At this point, the tabsheet does not yet have a parent set.

This leads to an exception because of the scaling that is attempted in the
constructor of the object inspector.

You can test this in the Lazarus data desktop, by opening a data dictionary.
Below a stack trace.

I think this is a bug in the LCL; in case there is no form, a default should
be used instead. Or maybe the application object should be used.

Michael.

#0 fpc_raiseexception(0x7fffeef0b650, 0x0, 0x0) at ../inc/except.inc:158
#1 NEEDPARENTDESIGNCONTROL(0x7fffeef0b650) at forms.pp:2059
#2 SCALE96TOFORM(0x7fffeef0b650, 22) at include/control.inc:787
#3 REALDEFAULTITEMHEIGHT(0x7fffeef0b650) at objectinspector.pp:1464
#4 CREATE(0x7fffeec9c540, 0x1, 0x7fffeef0b650, 0x7fffeefa0180, 0x0, []) at objectinspector.pp:3715
#5 ADDPROPERTYEDITOR(0x7fffeef0b650, 0x7fffeefa0180) at objectinspector.pp:2044
#6 GETPERSISTENTPROPERTIES(0x7ffff7fe1e40, [TKINTEGER..TKPOINTER], 0x7fffeec8c040, {Proc = {procedure (POINTER, TPROPERTYEDITOR)} 0x7fffffffcc88, Self = 0x7fffeef0b650}, {Proc = {function  (POINTER, PPROPINFO) : BOOLEAN} 0x7fffffffccc0, Self = 0x0}, {Proc = {function  (POINTER, TPROPERTYEDITOR) : BOOLEAN} 0x7fffffffccd0, Self = 0x7fffeef0b650}) at propedits.pp:2464
#7 GETPERSISTENTPROPERTIES(0x7ffff7fe1e40, [TKINTEGER..TKPOINTER], 0x7fffeec8c040, {Proc = {procedure (POINTER, TPROPERTYEDITOR)} 0x7fffffffcce8, Self = 0x7fffeef0b650}, {Proc = {function  (POINTER, TPROPERTYEDITOR) : BOOLEAN} 0x7fffffffcd40, Self = 0x7fffeef0b650}) at propedits.pp:2481
#8 BUILDPROPERTYLIST(0x7fffeef0b650, false, true) at objectinspector.pp:1979
#9 SETSELECTION(0x7fffeef0b650, 0x7ffff7fe2040) at objectinspector.pp:1392
#10 SETTIOBJECT(0x7fffeef0b650, 0x7ffff7f54e40) at objectinspector.pp:6080
#11 CREATEPROPERTYGRID(0x7fffeef09610, 0x7ffff7f54e40) at dicteditor.pp:775
#12 SELECTSINGLEOBJECT(0x7fffeef09610, 0x7ffff7f54e40) at dicteditor.pp:764
#13 DOSELECTNODE(0x7fffeef09610, 0x7ffff7f77c30) at dicteditor.pp:589
#14 DOSELECTIONCHANGED(0x7ffff7f77c30) at include/treeview.inc:4652
#15 INTERNALSELECTIONCHANGED(0x7ffff7f77c30) at include/treeview.inc:6044
#16 SETSELECTION(0x7ffff7f77c30, 0x7fffeeed6c60) at include/treeview.inc:4472
#17 SHOWDICTIONARY(0x7fffeef09610) at dicteditor.pp:448
#18 CREATEGUI(0x7fffeef09610) at dicteditor.pp:415
#19 CREATE(0x7fffeef09610, 0x1, 0x7fffeef651f0) at dicteditor.pp:354
#20 NEWDATAEDITOR(0x7fffeef651f0) at frmmain.pp:1437
#21 OPENFILE(0x7fffeef651f0, 0x7fffeef29918 '/home/michael/dinac/sql/d'...) at frmmain.pp:1285
#22 OPENDATADICT(0x7fffeef651f0, 0x7fffeef29480) at frmmain.pp:1274
#23 TVALLDBLCLICK(0x7fffeef651f0, 0x7fffeef71530) at frmmain.pp:1257
#24 DBLCLICK(0x7fffeef71530) at include/control.inc:1668
#25 WMLBUTTONDBLCLK(0x7fffeef71530, {MSG = 515, KEYS = 129, XPOS = 80, YPOS = 497, POS = {X = 80, Y = 497}, DUMMY = 32571472, RESULT = 0}) at include/control.inc:2543
#26 DISPATCH(0x7fffeef71530, 0) at ../inc/objpas.inc:684
#27 WNDPROC(0x7fffeef71530, {MSG = 515, UNUSEDMSG = 0, WPARAM = 129, LPARAM = 32571472, RESULT = 0}) at include/control.inc:2243
#28 WNDPROC(0x7fffeef71530, {MSG = 515, UNUSEDMSG = 0, WPARAM = 129, LPARAM = 32571472, RESULT = 0}) at include/wincontrol.inc:5425
#29 DELIVERMESSAGE(0x7fffeef71530, 0) at lclmessageglue.pas:112
#30 DELIVERMESSAGE(0x7fffeef71530, 0) at gtk2/gtk2proc.inc:3780
#31 DELIVERMOUSEDOWNMESSAGE(0x15ac6d0, 0x1665590, 0x7fffeef71530) at gtk2/gtk2callback.inc:2066
#32 GTKMOUSEBTNPRESS(0x1508ae0, 0x1665590, 0x7fffeef71530) at gtk2/gtk2callback.inc:1793
#33 ?? at :0
#34 g_closure_invoke at :0
#35 ?? at :0
#36 g_signal_emit_valist at :0
#37 g_signal_emit at :0
#38 ?? at :0
#39 gtk_propagate_event at :0
#40 gtk_main_do_event at :0
#41 ?? at :0
#42 g_main_context_dispatch at :0
#43 ?? at :0
#44 g_main_context_iteration at :0
#45 APPWAITMESSAGE(0x7ffff7f76230) at gtk2/gtk2widgetset.inc:2431
#46 IDLE(0x7ffff7f75bf0, true) at include/application.inc:414
#47 HANDLEMESSAGE(0x7ffff7f75bf0) at include/application.inc:1283
#48 RUNLOOP(0x7ffff7f75bf0) at include/application.inc:1419
#49 APPRUN(0x7ffff7f76230, {Proc = {procedure (POINTER)} 0x7fffffffe1a0, Self = 0x7ffff7f75bf0}) at include/interfacebase.inc:54
#50 RUN(0x7ffff7f75bf0) at include/application.inc:1407
#51 main at lazdatadesktop.lpr:21
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus