Recent

Author Topic: Embded form editor (DockedFormEditor fork)  (Read 3133 times)

K155LA3

  • New Member
  • *
  • Posts: 14
Embded form editor (DockedFormEditor fork)
« on: February 19, 2022, 10:50:46 pm »
The DockedFormEditor component from Michael W. Vogel (version of approximately early 2021 ) is taken as the basis. Renamed to "EmbdedFormEditor" in order to avoid confusion.
Main changes:
1. Added TitleBar. When you double click on TitleBar, the form caption editor is launched. When clamping the left mouse button on the TitleBar and the mouse movement, the form position editor on Desktop starts.
2. When the sizes of the form change, a hint appears indicating the current form size.
3. Added the implementation of the main menu with any level of nested , as well as the display of glyphs (where they are there). If you select the menu item (if item does not have nested items), the editor automatically select the corresponding component in the object inspector.
4. Solved the position of the StatusBar position: when adding the main menu, all components are lowered down to the height of the main menu. When you turn on the "smart position StatusBar" StatusBar lying on the form rises up by an equal to the height of the main menu. This behavior is implemented via the StatusBar.BorderSpacing.Bottom parameter. The StatusBar.BorderSpacing.Bottom parameter is added to the corresponding value when the file / project saving event occurs when the project compilation is occurred, switching from the form editor to the code editor. Since there may be unexpected problems This option may be turned off in the settings.

За основу взят компонент DockedFormEditor от Michael W. Vogel (версия приблизительно начала 2021 года). Переименовано в "EmbdedFormEditor" во избежании путаницы.
Основные изменения:
1. Добавлен заголовка формы. При двойном клике по заголовку запускается редактор текста заголовока формы. При зажатии левой кнопки мыши на заголовке и поледующем движении мыши запускается редактор положения формы на рабочем столе.
2. При изменении размеров формы появляется подсказка, указывающая текущий размер формы.
3. Добавлена реализация основного меню с любым уровнем вложения, а также отображением глифов (там где они есть). При выборе пункта меню (если пункт не имеет вложенных пунктов меню) в редакторе автоматически происходит выбор соответсвующего компонента в инспекторе объектов.
4. Решена проблема положения StatusBar: при добавлении главного меню все компоненты опускаются вниз на высоту главного меню. При включении "умного положения StatusBar" StatusBar лежащий на форме поднимается вверх на величину равную высоте главного меню. Данное поведение реализовано через параметр StatusBar.BorderSpacing.Bottom. Соответсвенно добавлено обнуление параметра  StatusBar.BorderSpacing.Bottom при возникновении события сохранения файла/проекта, компиляции проекта, переключения из редактора формы в редактор кода. Так как могут возникнуть непредвиденные проблемы данная опция может быть выключена в настройках.

Tested in Lazarus 2.2.0 (rev lazarus_2_2_0) FPC 3.2.2 x86_64-win64-win32/win64 on Windows 10 x64 and Windows 7 x32.
« Last Edit: February 19, 2022, 10:54:17 pm by K155LA3 »

jcmontherock

  • Full Member
  • ***
  • Posts: 152
Re: Embded form editor (DockedFormEditor fork)
« Reply #1 on: February 20, 2022, 10:02:26 am »
Very nice. Thank you.  :O)

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4131
  • I like bugs.
Re: Embded form editor (DockedFormEditor fork)
« Reply #2 on: February 20, 2022, 10:10:05 am »
Can you please fork the Lazarus sources in GitLab and apply your improvements to DockedFormEditor, preferably one improvement per commit.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

K155LA3

  • New Member
  • *
  • Posts: 14
Re: Embded form editor (DockedFormEditor fork)
« Reply #3 on: February 20, 2022, 02:29:01 pm »
Can you please fork the Lazarus sources in GitLab and apply your improvements to DockedFormEditor, preferably one improvement per commit.
I will try. But first, I propose to integrate all these improvements to the current version of DockedFormEditor and lay out in this topic for testing. After all, more than a year has passed since the version of DockedFormEeditor in which these changes are made.
And also I will try to note the sections of the code so that it is easier to add one by one improvement per commit.
I propose to divide improvements to the following steps:
1. Add a form header, as it is associated with the change in the location of the panels (including the main menu panel) in ResizeFrame.
2. Add the implementation of the main menu.
3. Add the implementation of the "smart" position of StatusBar.
4. Add the implementation of the selection of the form position on the desktop.

wp

  • Hero Member
  • *****
  • Posts: 10296
Re: Embded form editor (DockedFormEditor fork)
« Reply #4 on: February 20, 2022, 03:39:23 pm »
Please make the form header optional. The designer form is often too small and requires scrolling; adding a title bar makes it even smaller.

K155LA3

  • New Member
  • *
  • Posts: 14
Re: Embded form editor (DockedFormEditor fork)
« Reply #5 on: February 20, 2022, 07:09:32 pm »
Please make the form header optional. The designer form is often too small and requires scrolling; adding a title bar makes it even smaller.
Well, it is not difficult.
In the options added Chekbox to show/hide Titlebar. Fixed version in attachment.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4131
  • I like bugs.
Re: Embded form editor (DockedFormEditor fork)
« Reply #6 on: February 20, 2022, 10:01:23 pm »
I will try. But first, I propose to integrate all these improvements to the current version of DockedFormEditor and lay out in this topic for testing. After all, more than a year has passed since the version of DockedFormEeditor in which these changes are made.
I proposed the GitLab fork for exactly that reason. Just copying your sources on top of the existing ones reverts any bug fixes since a year ago.
Revision control is a good invention. Please use it.

Quote
And also I will try to note the sections of the code so that it is easier to add one by one improvement per commit.
I propose to divide improvements to the following steps:
Add a separate commit with a descriptive message for each step using Git tools like "git gui" or TortoiseGit or whatever you use.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

K155LA3

  • New Member
  • *
  • Posts: 14
Re: Embded form editor (DockedFormEditor fork)
« Reply #7 on: February 23, 2022, 09:03:56 pm »
I proposed the GitLab fork for exactly that reason. Just copying your sources on top of the existing ones reverts any bug fixes since a year ago.
Revision control is a good invention. Please use it.
It is not so easy as it seems. DockedFormEditor with whom I worked I took from Mantis Bug Tracker, before it moving to Gitlab and DockedFormEditor was added to the Lazarus components. It looks more like SpartaDockedFormEditor than on the current release DockedForMeditor.
For example "ResizeFrame" now has ceased to be TFrame and turned into several classes.
Most likely, I will have to transfer the changes manually and after that, to transfer to the GitLab.

I proposed the GitLab fork for exactly that reason. Just copying your sources on top of the existing ones reverts any bug fixes since a year ago.
Revision control is a good invention. Please use it.
Alas, I am to some extent "dinosaur", most of the time I am offline. It will be necessary to learn how to work with Git, but it will not be quickly.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 8479
  • Debugger - SynEdit - and more
    • wiki
Re: Embded form editor (DockedFormEditor fork)
« Reply #8 on: February 23, 2022, 09:20:53 pm »
most of the time I am offline. It will be necessary to learn how to work with Git, but it will not be quickly.

Well, git is perfect for offline. You can commit, compare, check history, and a cornucopia more - all while being offline.

As for learning. If you come from SVN then check out either of those 2 sides
- https://wiki.lazarus.freepascal.org/SVN_to_GIT_Cheatsheet  (my preference / recommendation)
- https://wiki.lazarus.freepascal.org/FPC_git

They both cover the same. You only need one, and then should ignore the other.

I marked my recommendation, and on that (marked) page is also a short summary about the difference between them.

As you seem to be on Windows, install TortoiseGit. It is really similar to TortoiseSvn. => So as soon as you have done your reading on the diff between "svn commit" and "git commit" + "git push", well you are good to go. The rest you learn on the go.

If you use commandline git, read up on the diff between "svn add" and "git add". TortoiseGit hides that from you, so you kinda get the svn like behaviour.


K155LA3

  • New Member
  • *
  • Posts: 14
Re: Embded form editor (DockedFormEditor fork)
« Reply #9 on: March 08, 2022, 10:13:01 pm »
All improvements added. In attachments, two archives, one final, the other contains a phased implementation of improvements (be on the safe side).
Now I will deal with how Git works.
P.S.: On the GitLab, my nickname is already busy (perhaps it happened when it was transferred all Issue from Mantis Bug Tracker).

 

TinyPortal © 2005-2018