Lazarus

Programming => LCL => Topic started by: Michl on February 14, 2021, 09:23:23 pm

Title: New DockedFormEditor
Post by: Michl on February 14, 2021, 09:23:23 pm
Hi,

I created a new docked form editor, which can be found in Lazarus Trunk via MainMenu -> Package -> Install/Uninstall Packages... dockedformeditor. It comes with a optional WYSIWYG anchor designer. You have to deinstall other docked form editors like Sparta_DockedFormEditor first!

This package is initially forked from Sparta_DockedFormEditor and its replacement in future Lazarus versions. All Sparta packages are now deprecated and will be removed in a future Lazarus release.

For more info, I wrote a little Wiki page: https://wiki.lazarus.freepascal.org/DockedFormEditor (https://wiki.lazarus.freepascal.org/DockedFormEditor)

It's written and tested on Windows 7 and fundamental tested on Windows 10, Linux Mint Cinnamon with GTK2, QT(4) and QT5. It can be used as standalone IDE extension or in combination with AnchorDockingDsgn.

Now I need your support. Please test it - especially if you are currently using Sparta_DockedFormEditor - if there are open bugs or feature requests. If possible, use bug tracker for bugs!

Thank you!

Michl

Known Issues:
    - when form / frame is moved out of screen, there the form has no designer grid (dots)
    - Qt5 shows own menu in form, this isn't shown in anchor editor
    - designer: mouse wheel to scroll content doesn't work - csDesigning is set and
      form doesn't get a LM_MOUSEWHEEL message
    - if main menu is visible, height of client area is wrong, see https://bugs.freepascal.org/view.php?id=38701
    - UnDo / ReDo of AnchorDesigner is currently not implemented
Title: Re: New DockedFormEditor
Post by: Michl on April 13, 2021, 07:39:52 am
There was a question in a other thread and Sparta https://forum.lazarus.freepascal.org/index.php/topic,54041 (https://forum.lazarus.freepascal.org/index.php/topic,54041).

Maybe if interesting. If you want to check with a stable release, you can test the added zip (for Lazarus 2.0.xxx only!). If you want check with Lazarus Trunk, please test version shipped with Lazarus Trunk as mentioned above.

Title: Re: New DockedFormEditor
Post by: El Salvador on April 13, 2021, 09:31:45 am
Why was a fork created? Wasn't it better to continue without forking?
Title: Re: New DockedFormEditor
Post by: Michl on April 13, 2021, 10:11:54 am
The idea of Sparta was adding of new designer functionality. Therefore there was a big overhead of code and a lot of access points and of course mixture of its packages. Sparta_SmartFormEditor was in source of Lazarus for a long time but, as I can see, never working. All changes made in new DockedFormEditor would have broken this package even more. Thatswhile it stays untouched.

Sparta can exists further as alternative (I think in Lazarus CCR), if someone is willing to investigate here. But there is no Lazarus developer working on it.
Title: Re: New DockedFormEditor
Post by: mav on April 13, 2021, 01:10:34 pm
There is not DockedFormEditor in trunks....
Title: Re: New DockedFormEditor
Post by: Michl on April 13, 2021, 01:39:47 pm
Try MainMenu -> Package -> Package Links ... -> Rescan lpl files. This should work. If not, you can open the package in LazarusDirectory\components\dockedformeditor\dockedformeditor.lpk.
Title: Re: New DockedFormEditor
Post by: El Salvador on April 13, 2021, 04:29:22 pm
There was a question in a other thread and Sparta https://forum.lazarus.freepascal.org/index.php/topic,54041 (https://forum.lazarus.freepascal.org/index.php/topic,54041).

Maybe if interesting. If you want to check with a stable release, you can test the added zip (for Lazarus 2.0.xxx only!). If you want check with Lazarus Trunk, please test version shipped with Lazarus Trunk as mentioned above.
Tried in Lazarus 2.0.12. But I had to close all open files and reopen them to use DockedFormEditor. Again, after changed DFF's settings.
Title: Re: New DockedFormEditor
Post by: Soner on April 13, 2021, 05:59:22 pm
It looks good in pictures but why don't you use TNotebook and add 3 buttons in source-editors  statusbar for switching between code, form and anchors. We need every vertical space.
Title: Re: New DockedFormEditor
Post by: Soner on April 13, 2021, 06:26:26 pm
Here (https://www.thoughtco.com/placing-a-tprogressbar-into-a-tstatusbar-4092539) is how to do it, maybe my solution is better for cross platform, look at attachment.
Title: Re: New DockedFormEditor
Post by: Michl on April 13, 2021, 07:35:04 pm
Tried in Lazarus 2.0.12. But I had to close all open files and reopen them to use DockedFormEditor. Again, after changed DFF's settings.
Thank you for testing. I don't understand. Can you explain a little bit more detailed?
Title: Re: New DockedFormEditor
Post by: Michl on April 13, 2021, 07:37:29 pm
It looks good in pictures but why don't you use TNotebook and add 3 buttons in source-editors  statusbar for switching between code, form and anchors. We need every vertical space.
If you want more space, why don't you place the tabs on the right or left side? See MainMenu -> Tools -> Options -> Docked Form Editor -> Tab position
Title: Re: New DockedFormEditor
Post by: Michl on April 13, 2021, 07:42:11 pm
Here (https://www.thoughtco.com/placing-a-tprogressbar-into-a-tstatusbar-4092539) is how to do it, maybe my solution is better for cross platform, look at attachment.
Thank you for testing and your example. For me it is important to not move the mouse far distances. If I have to do it, I'm faster with keybord. Thats the reason, why the tabs are next to the source editor tabs by default. You can change this per option.

But I'm wondering, why is your solution more cross platform suitable then a PageControl?
Title: Re: New DockedFormEditor
Post by: El Salvador on April 13, 2021, 08:01:25 pm
Tried in Lazarus 2.0.12. But I had to close all open files and reopen them to use DockedFormEditor. Again, after changed DFF's settings.
Thank you for testing. I don't understand. Can you explain a little bit more detailed?
After you change the tab position setting, you must reopen all forms previously opened (or restart IDE) because tab position remained unchanged. Basically, the setting only affects future forms.

Same way, if you open lazarus project with forms previously opened. In this case, the steps are:

1 Open docked lazarus project without DFF
2 Open some forms (they are floating)
3 Install DFF
4 With the reopening of Lazarus, the forms will remain floating and not docked with DFF. I must close them and reopen.
Title: Re: New DockedFormEditor
Post by: Soner on April 13, 2021, 08:15:26 pm
But I'm wondering, why is your solution more cross platform suitable then a PageControl?
Not compared to PageControl, I mean my solution can be more cross platform compared to Zarko Gajic's solution (https://www.thoughtco.com/placing-a-tprogressbar-into-a-tstatusbar-4092539).
Title: Re: New DockedFormEditor
Post by: Michl on April 13, 2021, 08:17:34 pm
Tried in Lazarus 2.0.12. But I had to close all open files and reopen them to use DockedFormEditor. Again, after changed DFF's settings.
Thank you for the hint. This was working. I managed to get it broken somehow. I'll fix that.

[Edit] Fixed in Lazarus Trunk revision 64987.


1 Open docked lazarus project without DFF
2 Open some forms (they are floating)
3 Install DFF
4 With the reopening of Lazarus, the forms will remain floating and not docked with DFF. I must close them and reopen.
OK, I have done it exactly as you wrote, I can't see it, neither in Lazarus 2.0.10 nor in 2.1. (Windows 7).

What is your OS and FPC?
Title: Re: New DockedFormEditor
Post by: mav on April 16, 2021, 05:36:15 pm
Hello I have a problem, you carry a project from one pc to another, the same operating system configuration, lazarus version etc ... the forms do not appear, neither docked nor floating  :) :)
Title: Re: New DockedFormEditor
Post by: Michl on April 16, 2021, 07:53:51 pm
Hello I have a problem, you carry a project from one pc to another, the same operating system configuration, lazarus version etc ... the forms do not appear, neither docked nor floating  :) :)
Can you add such a minimal example here? Also interesting for me, what is your OS and Lazarus/FPC setup? You can find it via MainMenu -> Help -> About Lazarus -> right click in window and click on "Copy version inforation to clipboard".
Title: Re: New DockedFormEditor
Post by: Gustavo 'Gus' Carreno on April 16, 2021, 08:20:57 pm
Hey Mav,

Hello I have a problem, you carry a project from one pc to another, the same operating system configuration, lazarus version etc ... the forms do not appear, neither docked nor floating  :) :)

If the project *.lpi was created with Lazarus trunk 2.1.0 the XML is not fully readable for Lazarus 2.0.12 and below.
You don't get any files on the Project explorer is the symptom.

I got a fixlp tool from @wp that can fix this issue if it's a version mismatch.
Tool can be found on Sourceforge->lazarus-ccr->applications->fixlp
https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/applications/fixlp

If it's not that it could be a Multi-monitor issue.
If it's one of those, sorry I have no quick fix :(

Hope it helps.

Cheers,
Gus
Title: Re: New DockedFormEditor
Post by: mav on April 16, 2021, 11:43:45 pm
Thank you Gus, I will try your tool..
My Lazarus 2.0.12 r64642 FPC 3.2.0 x86_64-win64-win32/win64, my OS Windows 10 last.

Title: Re: New DockedFormEditor
Post by: mav on April 18, 2021, 12:30:00 am
Hello,I have updated all my lazarus to the last trunk and everything works, I can take projects from one pc to another
without problems .... and when I share projects with other people I will tell them to update .
greetings and sorry for the inconvenience!!!
Title: Re: New DockedFormEditor
Post by: zoltanleo on May 17, 2021, 10:57:47 am
Hi,

I created a new docked form editor, which can be found in Lazarus Trunk via MainMenu -> Package -> Install/Uninstall Packages... dockedformeditor. It comes with a optional WYSIWYG anchor designer. You have to deinstall other docked form editors like Sparta_DockedFormEditor first!

Hi, Michl. That's cool!

I discovered a feature that could hardly be called a bug. But fixing it will make it convenient to use the plugin when the form is very large and does not fit on the display.

If you stretch the form outside the screen for a very long time, then a panel appears, below which the edges of the form are not visible. I got this effect when the height of the form reached 1090px

Can you fix this or is this a plugin limitation?
Title: Re: New DockedFormEditor
Post by: Michl on May 17, 2021, 12:50:31 pm
Yes, I know it. It is a OS limtation, that a form can't be created bigger then the screen dimensions. I had documented it https://wiki.freepascal.org/DockedFormEditor#Known_Issues (https://wiki.freepascal.org/DockedFormEditor#Known_Issues). Till now, I haven't hardly tried to fix - there were bigger issues I was working on. Maybe I can have a look at it in next time. Hints are welcome ;)
TinyPortal © 2005-2018