Sign in Join

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

Mailing lists / lazarus / 2017-07

Sparta Form Designer change

23 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Anthony Walter

I noticed hnb checked in quite a few changes to the sparta docked form designer yesterday.

Is this the majority of the changes coming for sparta? I was going to do some testing on it, but I want to wait until the bulk of the new changes, which I hear are coming, have been checked in.

Oh, and a small summary of what's changed would be appreciated.

Let me know. Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170719/d79d843e/attachment.html>

Reply by email

Maciej Izak
to Anthony Walter

2017-07-19 9:05 GMT+02:00 Anthony Walter via Lazarus <

Show quoted text 7 lines
: Okay, I was a little fast on the submit with my last message. I checked with the bug tracker and I can see the sparta related issues to test. Thanks for the fixes and kudos. Your work is very much appreciated!

Is to early to say "thanks" ;) we need more tests. For now I know from Juha Manninen that Sparta for Qt under Linux is broken :\

Best regards, Maciej Izak -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170719/6cfe67da/attachment.html>

Reply by email

Juha Manninen
to Maciej Izak: 2017-07-19 9:05 GMT+02:00 Anthony Walter via Lazarus < Is to early to say "thanks" ;) we…
Maciej Izak wrote
For now I know from Juha Manninen that Sparta for Qt under Linux is broken :\

I tested a little more.
Sparta form designer is broken for both GTK2 and QT. I used FPC trunk but I guess it makes no difference. Manjaro Linux + KDE.

With an empty form the designer just does nothing. It does not react to mouse clicks even when a component from palette is selected. The component remains selected in palette.

Then I tested with a form with many components.
With GTK2 the designer stays empty. The IDE still works otherwise. With QT the IDE freezes. An empty editor shows an hourglass. The process must be killed.

What more, testing an empty form with QT, the designer shows up initially when Lazarus starts. Normally the editor is shown initially. I remember a similar bug was fixed a long time ago (> a year).

Juha

Reply by email

Anthony Walter
to Juha Manninen

I tested on windows a few hours ago and noticed a few things. The biggest problem is that even without sparta installed, inherited forms is no longer working in trunk revisions.

In fact when I try to register and then create an inherited form using the "File > New..." dialog, the lazarus IDE crashes. I am using code which worked on lazarus a few months back. I will investigate further before filing a bug.

Also, on windows the sparta form design on resize shows the color green in any area that is freshly revealed. I assume that was left in there for testing reasons and is not some strange unexpected behavior. -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170719/e05c0339/attachment.html>

Reply by email

Anthony Walter
to Anthony Walter

Okay I've tested on windows it it works great, but not at all on gtk2 linux. I created a test project for inherited forms, because it might not be so straight forward for some of you test. I attached the test project to issue 29615

Here is a page with a video screen capture of the docked form designer working with inherited forms on windows:

https://www.getlazarus.org/videos/dockedform/
Browsable sources at: https://github.com/sysrpl/dockedform

Unfortunately I think the sparta docked form editor is currently not working on all other platforms.

Here is a link to the original issue with its status reverted back to "assigned".

https://bugs.freepascal.org/view.php?id=29615
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170719/cec734dc/attachment.html>

Reply by email

Anthony Walter
to Anthony Walter

If it wasn't clear, here are the EXAMPLE units which define and register an inheritable form.

Example note form:

https://github.com/sysrpl/dockedform/blob/master/docknotefrm.pas

The logic of the registration code:

https://github.com/sysrpl/dockedform/blob/master/dockerformdesign.pas

Usage:

procedure Register;
begin
  RegisterForm(TDockNoteForm, 'Note Form', 'A form to take notes',
'DockNoteFrm');
end;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170719/d4c2dace/attachment.html>

Reply by email

Anthony Walter
to Anthony Walter

Okay I tested on OSX. The sparta docked form designer mostly works. Notable problems on OSX are:

1) Forms appear at runtime without a border. This can be fixed by setting the BorderStyle at runtime to bsSingle or bsSizeable.

Note setting the BorderStyle at design time causes the border to be disabled at runtime, meaning buttons in the caption area are disabled and do not respond to mouse events.

2) Forms are green. I searched the sparta forms files and found the clGreen used as the color of a few items. I switched them to clBtnFace and the look normal again. I assume the green color is/was for testing. It's no problem to fix.

3) Not much of a big deal, but resizing the designer seems a bit laggy, especially when you release the mouse. It takes a second for the designer to refresh when this happens. again not a big deal but it would be nice if it felt a bit snappier.

Related, on OSX the cursor crSizeNWSE doesn't exist and instead reverts to crSizeWE. I suggest using an ${ifdef darwin} and revert to the four directional arrow crSizeAll when sizing from the lower right corner in unit:

./mdi/source/sparta_basicresizeframe.pas

Other than that, it looks good on both OSX and Windows. Let me know if you want my OSX patches.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170720/d4ff178e/attachment.html>

Reply by email

Maciej Izak
to Anthony Walter: I tested on windows a few hours ago and noticed a few things. The biggest problem is that…

2017-07-19 16:09 GMT+02:00 Anthony Walter via Lazarus <

Show quoted text 7 lines
: Also, on windows the sparta form design on resize shows the color green in any area that is freshly revealed. I assume that was left in there for testing reasons and is not some strange unexpected behavior.

This one is a part of new non finished yet feature :). Thanks for many info
- very valuable info. I will try to fix few problems in weekend.

Best regards, Maciej Izak -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170720/0e9259cd/attachment.html>

Reply by email

Anthony Walter
to Maciej Izak

Maciej,

Thanks for the work on this. I fixed a few problems on OSX (I haven't send patches) and it's working great other than that TMainMenu.

I will put together a few actually useful forms that can registered, just to demonstrate how and why anyone might use them. Maybe I'll sumbit them to bug tracker and they can be included in either packages or examples.

Also, I further generalized a RegisterForm procedure and think it should be added to the IDEIntf. To that end I created this routine.

procedure RegisterForm(const Package: string; FormClass: TCustomFormClass;
const Category, Caption, Description, Units: string);

Issue with patch:

https://bugs.freepascal.org/view.php?id=32182
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170720/b2debac5/attachment-0001.html>

Reply by email

Maciej Izak
to Juha Manninen: On Wed, Jul 19, 2017 at 10:11 AM, Maciej Izak via Lazarus I tested a little more. Sparta…

2017-07-19 15:10 GMT+02:00 Juha Manninen via Lazarus <

: Sparta form designer is broken for both GTK2 and QT.

...

With GTK2 the designer stays empty. The IDE still works otherwise. With QT the IDE freezes. An empty editor shows an hourglass. The

Sparta should works now with GTK2 (tested with Debian 9) - Anthony did the trick and I have fixed other bugs. Now I need to hunt QT :P. New GTK2 test is welcome! :)

Best regards, Maciej Izak -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170725/2679447e/attachment.html>

Reply by email

Anthony Walter
to Maciej Izak

Thanks, tests and working great on win, mac, and gtk2 linux. I suspect maybe it works on qt linux as well.

BorderStyle and BorderIcons work as well. Good job and thank you :)

Please set these issues to resolved and i will close:

032183
032171
032170
029615

Note: I will be filing two more issues that are effecting gtk2 at least:

1) Default event creation is not working and you cannot delete controls using the Delete keyboard key. I suspect these two issues are caused by the same problem so I will file as one issue.

2) TMainMenu can be removed, but it no longer shows menu items in the designer at the top of the form. This is because pFakeMenu is parented to pBG which is now set hide itself.

Probably a better solution than hiding pBG (sorry about my fix) would be to ensure it's ALWAYS in behind in z-order of pClient. This is something I tried but could not get working. There was always some something triggering pBG to be back on top of pClient which I couldn't isolate. -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170724/a6028c75/attachment.html>

Reply by email

Juha Manninen
to Anthony Walter

A serious issue with QT: When opening an existing form with controls, the IDE still freezes. Memory overflow, core dump is created.

A minor issue with QT: The designer tab is opened initially when the IDE is started. The editor tab should be opened.
I remember a similar problem was fixed a long time ago but I am not sure.

Juha

Reply by email

Anthony Walter
to Anthony Walter

Juha, I just tested on Qt4 (I haven't tested Qt5 yet) and the sparta form designer is working great with the latest svn trunk, with one outstanding problem:

TMainMenu is not working correctly with the Qt4 widget set. video <https://www.getlazarus.org/watch/?title=Sparta%20form%20designer%20crashes%20on%20Qt%20when%20deleteting%20TMainMenu&name=sparta-qt-menu-crash>

In the video linked above the crash occurs when the TMenuMenu is selected and I press the delete key. Not the designer is glitched during the menu editing, adding extra space above the design time menus. That is probably related to the issue.

I filed a bug for Qt TMainMenu crash: 32206
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170726/5a4be2d8/attachment.html>

Reply by email

Juha Manninen
to Anthony Walter
Anthony Walter wrote
Juha, I just tested on Qt4 (I haven't tested Qt5 yet) and the sparta form designer is working great with the latest svn trunk, ...

Did you try opening an existing project with a form + some components on it? I works for me, too, when starting with an empty form. Even then double-click for default action does not work.

Juha

Reply by email

Juha Manninen
to Anthony Walter
Anthony Walter wrote
Please see issue #32209 for a working fix. Someone familiar with the LCL Qt widget implementation needs to look at this in more depth.

The issue appears to be inherent to QT, not caused by LCL-QT code. I added a comment in the bug tracker issue. I copy it here to reach more people:

I don't see any good reason for using PostMessage in Sparta form designer code. It only makes the code more difficult to read and more prone to widgetset specific problems, as we saw.
The messages

  WM_SETNOFRAME = WM_USER;
  WM_BoundToDesignTabSheet = WM_USER + 1;

and their handlers should be replaced with normal functions. Any possible recursion can be avoided by boolean flags. If the operation must be delayed, then OnIdle is the right way to go. Or, is there something I don't understand?

Regards,
Juha

Reply by email