Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 11 to 14 of 14 total |
TPaint / Canvas |
Sun, May 22 2016 10:46 AM | Permanent Link |
Raul Team Elevate | On 5/22/2016 6:36 AM, thomh wrote:
> I created a simple test application with just a form. I use this code to create some TBasicPanel controls. > The FStartX and FStartY are just variables set in the OnMouseDown event of the form. > I get the same error with or without assigning the .Parent property. I suspect the issue is due to you freeing the panel while it's being processed as sender for the event. Tim can address as to why on framework level but one workaround i would suggest is to use the async call to queue up the panel delete as next UI thread event. So something like this : Add a new procedure DeletePanel that basically does the panel lookup by tag and actual freeing : procedure TForm1.DeletePanel(PanelTAG:integer); var i:integer; c:TControl; begin for i := Form1.ControlCount - 1 downto 0 do begin c := Form1.Controls[i]; if (TControl(c) is TBasicPanel) and (TControl(c).Tag = PanelTAG) then begin TControl(c).free; Break; end; end; end; and then change the event you trigger this (i.e. mouseclick or whatever) : if Sender is TBasicPanel then async DeletePanel(TBasicPanel(Sender).Tag); Raul |
Sun, May 22 2016 12:33 PM | Permanent Link |
thomh | That was indeed the problem, Raul!
Thanks for your help everybody. // Thom |
Mon, May 23 2016 1:04 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Thom,
<< which results in error: "Unable to get property 'tcomponent_fdestroying' of undefined or null reference Line 12448" >> Modify the WebUI unit as follows: function TElement.TriggerEvent(ID: Integer; AElement: TElement): Boolean; begin if Assigned(FController) and (not FController.Destroying) then <<<<< Changed !!!! begin if (ID=cdInput) then AElement.DoChanged(ecInputValueChanged); Result:=FController.DispatchEvent(ID,AElement); end else Result:=False; end; and let me know if that fixes the issue. Either way, please send me a project that includes the code that you're using so that I can test it here. This issue is one that "shouldn't occur" in a single-threaded environment, which is how the UI is running in a browser. Tim Young Elevate Software www.elevatesoft.com |
Tue, May 24 2016 9:47 AM | Permanent Link |
thomh | Tim Young [Elevate Software] wrote:
>>Modify the WebUI unit as follows: >>function TElement.TriggerEvent(ID: Integer; AElement: TElement): Boolean; >>begin >> if Assigned(FController) and (not FController.Destroying) then <<<<< Changed !!!! >> begin >> if (ID=cdInput) then >> AElement.DoChanged(ecInputValueChanged); >> Result:=FController.DispatchEvent(ID,AElement); >> end >> else >> Result:=False; >>end; Hi Tim, Yes, this fix worked with my old code. Thanks again. // Thom |
« Previous Page | Page 2 of 2 | |
Jump to Page: 1 2 |
This web page was last updated on Tuesday, April 23, 2024 at 08:10 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |