Recent

Author Topic: MainMenu: previously hidden menu item isn't displayed again  (Read 4656 times)

zoltanleo

  • Sr. Member
  • ****
  • Posts: 488
MainMenu: previously hidden menu item isn't displayed again
« on: September 14, 2021, 01:46:47 pm »
Hi folks.

I tried to programmatically hide the menu item and then show it again. I have failed. In contrast, the enable property works as expected.

Is that how it should be?

Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormShow(Sender: TObject);
  2. begin
  3.   CheckBox1Change(Sender);
  4. end;
  5.  
  6. procedure TForm1.CheckBox1Change(Sender: TObject);
  7. begin
  8.   miMiddle.Visible:= not CheckBox1.Checked;
  9.   mileft.Enabled:= CheckBox1.Checked;
  10. end;
Win10 LTSC x64/Deb 11 amd64(gtk2/qt5)/Darwin Cocoa (Monterey):
Lazarus x32/x64 2.3(trunk); FPC 3.3.1 (trunk), FireBird 3.0.10; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

zoltanleo

  • Sr. Member
  • ****
  • Posts: 488
Re: MainMenu: previously hidden menu item isn't displayed again
« Reply #1 on: September 14, 2021, 01:47:26 pm »
testcase
Win10 LTSC x64/Deb 11 amd64(gtk2/qt5)/Darwin Cocoa (Monterey):
Lazarus x32/x64 2.3(trunk); FPC 3.3.1 (trunk), FireBird 3.0.10; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

Zvoni

  • Hero Member
  • *****
  • Posts: 2327
Re: MainMenu: previously hidden menu item isn't displayed again
« Reply #2 on: September 14, 2021, 01:58:44 pm »
Repaint the form?
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

zoltanleo

  • Sr. Member
  • ****
  • Posts: 488
Re: MainMenu: previously hidden menu item isn't displayed again
« Reply #3 on: September 14, 2021, 02:00:53 pm »
Win10 LTSC x64/Deb 11 amd64(gtk2/qt5)/Darwin Cocoa (Monterey):
Lazarus x32/x64 2.3(trunk); FPC 3.3.1 (trunk), FireBird 3.0.10; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

Seenkao

  • Hero Member
  • *****
  • Posts: 550
    • New ZenGL.
Re: MainMenu: previously hidden menu item isn't displayed again
« Reply #4 on: September 14, 2021, 02:06:49 pm »
В Linux работает.

Yandex translate:
It works on Linux.
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

Zvoni

  • Hero Member
  • *****
  • Posts: 2327
Re: MainMenu: previously hidden menu item isn't displayed again
« Reply #5 on: September 14, 2021, 02:15:49 pm »
Works on Win10 Pro 64-Bit
FPC3.2.0/LAZ2.0.12 both 32-Bit
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

zoltanleo

  • Sr. Member
  • ****
  • Posts: 488
Re: MainMenu: previously hidden menu item isn't displayed again
« Reply #6 on: September 14, 2021, 02:26:14 pm »
Hmmmm. I'm use trunk fpc/laz.  :o
Win10 LTSC x64/Deb 11 amd64(gtk2/qt5)/Darwin Cocoa (Monterey):
Lazarus x32/x64 2.3(trunk); FPC 3.3.1 (trunk), FireBird 3.0.10; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

Seenkao

  • Hero Member
  • *****
  • Posts: 550
    • New ZenGL.
Re: MainMenu: previously hidden menu item isn't displayed again
« Reply #7 on: September 14, 2021, 06:44:11 pm »
Удали файл *.lpi и попробуй. Может что в настройках нахимичил? (мне приходится его удалять, для запуска проекта).

yandex translate:
Delete the *.lpi file and try it. Maybe you did something in the settings? (I have to delete it to run the project).
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4467
  • I like bugs.
Re: MainMenu: previously hidden menu item isn't displayed again
« Reply #8 on: September 14, 2021, 07:59:38 pm »
Delete the *.lpi file and try it. Maybe you did something in the settings?
The project cannot be opened without an *.lpi file. It is the main project info file and should not affect any GUI menu update issues.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

jamie

  • Hero Member
  • *****
  • Posts: 6130
Re: MainMenu: previously hidden menu item isn't displayed again
« Reply #9 on: September 15, 2021, 12:39:28 am »
I can load the project fine using the trunk.

It looks like MDI code that was worked on at some point in recent releases is effecting the issue..

There is code that merges and unmerges main menus from child MDI forms. I believe it is causing problems.

The only true wisdom is knowing you know nothing

Seenkao

  • Hero Member
  • *****
  • Posts: 550
    • New ZenGL.
Re: MainMenu: previously hidden menu item isn't displayed again
« Reply #10 on: September 15, 2021, 11:28:54 pm »
The project cannot be opened without an *.lpi file. It is the main project info file and should not affect any GUI menu update issues.
Я боюсь, вы ужаснётесь, когда узнаете сколько раз я удалял *.lpi файл, для того чтоб запустить проект на: другой машине/другой системе; или из-за какой либо попавшей в проект информации, которая портит проект (очень много ненужного хлама скапливается в файле). Разбираться что изменилось в файле у меня зачастую нет желания. А править запуск проекта дополнительными символами, я не считаю правильным, они нужны лишь в определённых случаях.

Да, я прекрасно понимаю, что для больших проектов, удаление файла *.lpi - не является правильным решением. Потому что зачастую проект приходится заново перенастраивать.

yandex translate:
I'm afraid you will be horrified when you find out how many times I deleted the*. lpi file in order to run the project on: another machine/another system; or because of any information that got into the project that spoils the project (a lot of unnecessary junk accumulates in the file). I often have no desire to understand what has changed in the file. And I don't think it's right to edit the launch of the project with additional symbols, they are needed only in certain cases.

Yes, I understand perfectly well that for large projects, deleting the *.lpi file is not the right solution. Because often the project has to be reconfigured again.
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

zoltanleo

  • Sr. Member
  • ****
  • Posts: 488
Re: MainMenu: previously hidden menu item isn't displayed again
« Reply #11 on: September 16, 2021, 12:49:39 am »
@Seenkao

Rus: мне кажется не стоит флудить. Как сказали выше, содержимое lpi-файла никак не связано с описанной проблемой.
Eng: I think that the contents of the lpi file have nothing to do with the problem described.

It might be worth creating a ticket in the bug tracker. What do you think of it?
Win10 LTSC x64/Deb 11 amd64(gtk2/qt5)/Darwin Cocoa (Monterey):
Lazarus x32/x64 2.3(trunk); FPC 3.3.1 (trunk), FireBird 3.0.10; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4467
  • I like bugs.
Re: MainMenu: previously hidden menu item isn't displayed again
« Reply #12 on: November 06, 2021, 07:08:22 pm »
I'm afraid you will be horrified when you find out how many times I deleted the*. lpi file in order to run the project on: another machine/another system; or because of any information that got into the project that spoils the project (a lot of unnecessary junk accumulates in the file). I often have no desire to understand what has changed in the file. And I don't think it's right to edit the launch of the project with additional symbols, they are needed only in certain cases.
I failed to notice this reply from September.
Maybe your session data is stored in the .lpi file. Go to Project Options -> Session and select "Save in .lps file in project directory".
Also some Build Mode data can be stored in the session. Go to the Build Mode management window, up in the Project Options.
The .lpi project info files are reasonably small without the session data.
Projects are cross-platform, they are meant to be copied and built in different systems.
A session on the other hand is local and should not be copied elsewhere. It contains editor file history and such private info.
« Last Edit: November 06, 2021, 09:31:24 pm by JuhaManninen »
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

zoltanleo

  • Sr. Member
  • ****
  • Posts: 488
Re: MainMenu: previously hidden menu item isn't displayed again
« Reply #13 on: November 06, 2021, 08:07:41 pm »
Hi Werner.

I think this behavior can be called a bug.  The visible property "worked" in version 2.0.12 (I checked for Windows) and "doesn't work" for the trunk.  Don't you think this is strange?
Win10 LTSC x64/Deb 11 amd64(gtk2/qt5)/Darwin Cocoa (Monterey):
Lazarus x32/x64 2.3(trunk); FPC 3.3.1 (trunk), FireBird 3.0.10; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

wp

  • Hero Member
  • *****
  • Posts: 11916
Re: MainMenu: previously hidden menu item isn't displayed again
« Reply #14 on: November 06, 2021, 09:48:53 pm »
Sorry, I had deleted my post before your response when I noticed that hiding a menu item does work in v2.0.12 even on Windows.

 

TinyPortal © 2005-2018