Re: [Lazarus] Sparta Form Designer change

2017-07-30 Thread Juha Manninen via Lazarus
On Thu, Jul 27, 2017 at 1:24 AM, Anthony Walter via Lazarus
 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
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Sparta Form Designer change

2017-07-26 Thread Anthony Walter via Lazarus
Please see issue #32209 for a working fix. Someone familiar with the LCL Qt
widget implementation needs to look at this in more depth.

https://bugs.freepascal.org/view.php?id=32209
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Sparta Form Designer change

2017-07-26 Thread Anthony Walter via Lazarus
No I didn't try that, but I did right now. It locked up my linux. I
couldn't even switch to another tty. I'll look into it and possibly file a
bug. Thanks.
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Sparta Form Designer change

2017-07-26 Thread Juha Manninen via Lazarus
On Wed, Jul 26, 2017 at 9:53 AM, Anthony Walter via Lazarus
 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
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Sparta Form Designer change

2017-07-26 Thread Anthony Walter via Lazarus
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


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
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Sparta Form Designer change

2017-07-25 Thread Anthony Walter via Lazarus
Juha,

Thanks. I will install Qt and compile a second copy of lazarus to test this
issue.
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Sparta Form Designer change

2017-07-25 Thread Juha Manninen via Lazarus
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
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Sparta Form Designer change

2017-07-24 Thread Anthony Walter via Lazarus
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.
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Sparta Form Designer change

2017-07-24 Thread Maciej Izak via Lazarus
2017-07-19 15:10 GMT+02:00 Juha Manninen via Lazarus <
lazarus@lists.lazarus-ide.org>:

> 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
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Sparta Form Designer change

2017-07-20 Thread Maciej Izak via Lazarus
2017-07-19 16:09 GMT+02:00 Anthony Walter via Lazarus <
lazarus@lists.lazarus-ide.org>:

>
> 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
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Sparta Form Designer change

2017-07-19 Thread Anthony Walter via Lazarus
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.
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Sparta Form Designer change

2017-07-19 Thread Anthony Walter via Lazarus
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;
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Sparta Form Designer change

2017-07-19 Thread Anthony Walter via Lazarus
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
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Sparta Form Designer change

2017-07-19 Thread Anthony Walter via Lazarus
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.
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Sparta Form Designer change

2017-07-19 Thread Maciej Izak via Lazarus
2017-07-19 9:26 GMT+02:00 Anthony Walter via Lazarus <
lazarus@lists.lazarus-ide.org>:

> I don't use for qt lcl widget set, but I can test under window, linux
> gtk2, and mac carbon.
>

would be great!

-- 
Best regards,
Maciej Izak
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Sparta Form Designer change

2017-07-19 Thread Anthony Walter via Lazarus
I don't use for qt lcl widget set, but I can test under window, linux gtk2,
and mac carbon.
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Sparta Form Designer change

2017-07-19 Thread Maciej Izak via Lazarus
2017-07-19 9:05 GMT+02:00 Anthony Walter via Lazarus <
lazarus@lists.lazarus-ide.org>:

> 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
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Sparta Form Designer change

2017-07-19 Thread Anthony Walter via Lazarus
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!
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus