![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 11 to 17 of 17 total |
![]() |
Wed, Jun 28 2017 12:17 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() | Mark,
<< Tim - is this procedure ok - do I need to set the Parent to nil - thanks >> No, you shouldn't need to do so, which is what I'm trying to confirm with Chris because he's saying that it's required in his case. Tim Young Elevate Software www.elevatesoft.com |
Wed, Jun 28 2017 1:47 PM | Permanent Link |
Mark Brooks Slikware | Tim Young [Elevate Software] wrote:
>>No, you shouldn't need to do so, which is what I'm trying to confirm with Chris because he's saying that it's required >>in his case. Ok. Will wait on your guidance and leave it in for now. |
Thu, Jun 29 2017 9:07 AM | Permanent Link |
Chris Holland SEC Solutions Ltd. ![]() | Hi Tim,
Sorry for the delay, been on an extended holiday ![]() I used the code that Mark posted and changed my TComponent to a TControl and set the parent to nil and then the error went away. When I created the panels in the first place I didn't do it the way you showed in your code: TBasicPanel.Create(Self); Because they were placed on another top level panel they were created using this: TempPanel := TBasicPanel.Create(JobListSubPanel); TempPanel.Layout.Position := lpTopLeft; TempPanel.Layout.Consumption := lcBottom; TempPanel.Layout.Reset := true; TempPanel.Layout.Stretch := lsRight; TempPanel.Width := PanelWidth; TempPanel.Height := 100; TempPanel.Tag := PanelCount; TempPanel.Name := 'AppointmentPanel' + IntToStr(PanelCount); TempPanel.OnClick := AppointmentPanelClicked; TempPanel.Border.Top.Visible := true; TempPanel.Border.Bottom.Visible := true; TempPanel.Border.Left.Visible := true; TempPanel.Border.Right.Visible := true; TempPanel.Background.Fill.FillType := ftSolid; TempPanel.Background.Fill.Color := clCornSilk; if Appointment.StartDate < Now then TempPanel.Background.Fill.Color := clPink; Hope this helps. (Although it is all working fine now with those changes) Chris Holland [Team Elevate] |
Thu, Jun 29 2017 11:14 AM | Permanent Link |
Mark Brooks Slikware | Hi Chris
I have also seen "strange" behaviour if I didn't set the Parent to nil, but that was some time ago and maybe has been fixed / enhanced now. Hence my question about whether I need to or not. Cheers Mark |
Mon, Jul 3 2017 2:04 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() | Chris,
<< Sorry for the delay, been on an extended holiday ![]() I hope you had a great time. ![]() I tried this again with no ill effects, and this is the code that I'm using: // Creation procedure TForm1.Button1Click(Sender: TObject); var I: Integer; TempPanel: TBasicPanel; begin for I:=0 to 4 do begin TempPanel := TBasicPanel.Create(BasicPanel1); TempPanel.Layout.Position := lpTopLeft; TempPanel.Layout.Consumption := lcBottom; TempPanel.Layout.Reset := true; TempPanel.Layout.Stretch := lsRight; TempPanel.Width := BasicPanel1.ClientWidth; TempPanel.Height := 100; TempPanel.Tag := I; TempPanel.Name := 'AppointmentPanel' + IntToStr(I); // TempPanel.OnClick := AppointmentPanelClicked; TempPanel.Border.Top.Visible := true; TempPanel.Border.Bottom.Visible := true; TempPanel.Border.Left.Visible := true; TempPanel.Border.Right.Visible := true; TempPanel.Background.Fill.FillType := ftSolid; TempPanel.Background.Fill.Color := clCornSilk; end; end; // Removal procedure TForm1.Button2Click(Sender: TObject); var i: Integer; c: TComponent; begin for i := BasicPanel1.ControlCount - 1 downto 0 do begin c := BasicPanel1.Controls[i]; if c is TBasicPanel then begin c.Free; end; end; end; Could you possibly try the code there and see if you're still seeing any issues with closing the form/deleting the panels ? Thanks, Tim Young Elevate Software www.elevatesoft.com |
Wed, Jul 5 2017 7:53 AM | Permanent Link |
Chris Holland SEC Solutions Ltd. ![]() | Hi Tim,
That all appears to work fine. I can't test the original code as having been on holiday I can't remember which part of my code I was having problems with as I found a solution so didn't keep a not of it ![]() Chris Holland [Team Elevate] On 03/07/2017 19:04, Tim Young [Elevate Software] wrote: > Chris, > > << Sorry for the delay, been on an extended holiday ![]() > > I hope you had a great time. ![]() > > I tried this again with no ill effects, and this is the code that I'm using: > > // Creation > > procedure TForm1.Button1Click(Sender: TObject); > var > I: Integer; > TempPanel: TBasicPanel; > begin > for I:=0 to 4 do > begin > TempPanel := TBasicPanel.Create(BasicPanel1); > TempPanel.Layout.Position := lpTopLeft; > TempPanel.Layout.Consumption := lcBottom; > TempPanel.Layout.Reset := true; > TempPanel.Layout.Stretch := lsRight; > > TempPanel.Width := BasicPanel1.ClientWidth; > TempPanel.Height := 100; > TempPanel.Tag := I; > TempPanel.Name := 'AppointmentPanel' + IntToStr(I); > // TempPanel.OnClick := AppointmentPanelClicked; > > TempPanel.Border.Top.Visible := true; > TempPanel.Border.Bottom.Visible := true; > TempPanel.Border.Left.Visible := true; > TempPanel.Border.Right.Visible := true; > > TempPanel.Background.Fill.FillType := ftSolid; > TempPanel.Background.Fill.Color := clCornSilk; > end; > end; > > // Removal > > procedure TForm1.Button2Click(Sender: TObject); > var > i: Integer; > c: TComponent; > begin > for i := BasicPanel1.ControlCount - 1 downto 0 do > begin > c := BasicPanel1.Controls[i]; > if c is TBasicPanel then > begin > c.Free; > end; > end; > end; > > Could you possibly try the code there and see if you're still seeing any issues with closing the form/deleting the panels ? > > Thanks, > > Tim Young > Elevate Software > www.elevatesoft.com > |
Wed, Jul 5 2017 10:30 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() | Chris,
<< I can't test the original code as having been on holiday I can't remember which part of my code I was having problems with as I found a solution so didn't keep a not of it ![]() No worries, I'll just chalk it up to chance at this point. If you see something weird again, please let me know. Tim Young Elevate Software www.elevatesoft.com |
« Previous Page | Page 2 of 2 | |
Jump to Page: 1 2 |
This web page was last updated on Wednesday, August 14, 2024 at 03:12 PM | Privacy Policy![]() © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |