How complete are frames implemented? lazarus / 31-LCL ---------------------------------------------------------------------- CCRDude · 2012-10-24 08:59 I've recently started a growing project in Lazarus 1.0, and over time, the content of six or seven database tables is displayed over multiple tabs of a TPageControl. Now from a design perspective, I didn't like to have code handling the various tables all in the forms code, so I thought about frames. I started moving all UI elements and code for the first tab onto a separate frame, and added that frame to the main forms first tab. Everything working great so far. From Delphi, I was expecting that when I change something within the frame, the main form is adjusted accordingly. Sadly, events assigned to controls after adding the TFrame simply are not assigned on runtime. More or less, with every UI-related change within the frame, I need to remove the frame from the main form and re-add it again. Annoying, different from Delphi. What am I doing wrong, or assuming wrong? Second issue: from the main forms main menu, I have linked to actions within the frame. This works great in Delphi, but in Lazarus, the menu items do not display correctly (they do on design time!), they do not trigger the actions, and the app causes a SIGSEGV on exit (which it doesn't when not trying this). What am I doing wrong in using the frames actions? I looked up frames in Lazarus here, which seems to imply frames are implemented completely. Am I simply wrong in assuming that, or do I need to handle things differently in Lazarus? ---------------------------------------------------------------------- Leledumbo · 2012-10-24 12:17 It's been a while since the last time I use it, but I'm sure they work correctly. Changing the frame itself also changes its occurrences everywhere it's used. Could you attach a sample project? ---------------------------------------------------------------------- CCRDude · 2012-10-24 12:24 Sure See the attached demo, which demonstrates the actionlist bug. Frame has ActionList and Action. Main form has frame with button associated with action, which works. When I assign Frame1.aFrameTest to a button on the form, or to a menu item, it shows correctly at design time, but at run time, button and menu item have no text at all, and clicking them doesn't trigger anything. I've updated from Lazarus 1.0 to 1.0.2 (Win32 btw) to verify it's not an "old" bug. To test the other bug: open the frame, add a second button. Open the form, and see that the change to the frame is not reflected here! ---------------------------------------------------------------------- hallenberger · 2012-10-24 13:19 Hello! I had "problems" with frames too, but only if I set the frame in design-mode. Problems are for example: if I modify a positioned frame in the main form, and not the original frame, all modifikations in the original frame are not aktiv in the positioned frame of the main form. So I am now working like this: No problem occurs, if I make in form.create things like:   f1 := TFrame1.Create(FMain);   f1.OnChanged := @F1Onchanged;   f1.Parent := TabSheet1;   f1.Align := alClient; ---------------------------------------------------------------------- CCRDude · 2012-10-24 13:42 The issue that once you modify a frame on the main form, it is no longer in sync is the same in Delphi, I would describe that "as intended", since it allows changes to the "template" if wanted. What goes beyond Delphi is that in Lazarus (for me at this moment with 1.0 and 1.0.2 as Win32) it never seems to be in sync, which cannot be (imho) intended. Dynamical creation solves that issue, thanks for reminding me And I went ahead and also dynamically assigned the main menu item Action properties during runtime - that works as well. Means additional typing, but works Would be nicer if the "RAD" style IDE support for frames would work, but this means I can continue to structure my code into separate frames for separate panels and the issue is no longer blocking for me.