Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2019-04

Bug when using frames

5 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Van Canneyt

Hi,

When you work with frames, you cannot change the frame in the designer when the frame is used in other frames/forms.

- Create frame.
- Add Control on frame (eg button)
- Drop frame on a form or frame, keep open
- Add event handler in original frame (e.g. Button.OnClick) -> event handler is set to Nil in the form where the frame is dropped.

3 issues:

1. The form/frame on which the frame is dropped should not set the event handler to Nil to begin with.

2. There is no way to restore the 'original state' of the frame. Delphi has a 'Revert to inherited' context menu.

3. To fix this, I do a 'View Source .lfm' and remove the Nil event handlers (OnClick = Nil) but that does not work, it keeps setting the event handlers to Nil.

So now I quit lazarus, manually edit the .lfms and simply remove all superfluous properties from it. i.e. I do what a 'Revert to inherited' context menu would do, manually. Then I restart lazarus and force a build (compile is not enough)

Far from ideal :(

Before I dive in the bugtracker and create 3 bug reports, are these known issues ?

Michael.

Reply by email

Ondrej Pokorny
to Michael Van Canneyt
Michael Van Canneyt wrote
Before I dive in the bugtracker and create 3 bug reports, are these known issues ?

I don't know if there are bug reports about it but I have been facing the same issues ever since as well. I didn't have the motivation to work on them, though.

I rather create all my frames in runtime, which I also did in Delphi. Even Delphi lost properties/events (set event handlers to nil) of controls in frames quite frequently.

Ondrej

Reply by email

Marcos Douglas B. Santos
to Ondrej Pokorny
AM Ondrej Pokorny wrote
... I rather create all my frames in runtime, which I also did in Delphi. Even Delphi lost properties/events (set event handlers to nil) of controls in frames quite frequently.

+1
Much better create them, docking on a panel, in runtime only.

Marcos Douglas

Reply by email

Michael Van Canneyt
to Juha Manninen
Juha Manninen wrote 9 lines
On Mon, Apr 15, 2019 at 10:52 AM Michael Van Canneyt via lazarus wrote: > When you work with frames, you cannot change the frame in the designer when > the frame is used in other frames/forms. Maybe related to : https://bugs.freepascal.org/view.php?id=20026 or https://bugs.freepascal.org/view.php?id=12483

Yep. Good that I asked first :)

I added a feature request for 'revert to inherited'.

Thanks !

Michael.

Reply by email