Recent

Author Topic: Can't add menu items.  (Read 14508 times)

Leledumbo

  • Hero Member
  • *****
  • Posts: 8747
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Can't add menu items.
« Reply #15 on: November 02, 2012, 05:27:27 pm »
Quote
Am running 1.0RC1.
Upgrade please...

ghendric

  • Newbie
  • Posts: 6
Re: Can't add menu items.
« Reply #16 on: October 02, 2014, 12:12:30 pm »
I'm having the same problem and I am using IDE version 1.2.4... I'm running Windows 8.1. Is there a fix for this?

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: Can't add menu items.
« Reply #17 on: October 02, 2014, 01:06:49 pm »
I'm having the same problem and I am using IDE version 1.2.4... I'm running Windows 8.1. Is there a fix for this?

Are you right clicking in the Menu Designer (which you get by double clicking on the TMainMenu component) or are you right clicking on the TMainMenu itself?  Reading through this thread, I'm unsure if there's any actual issues with the Menu Designer been encountered...

Oh wait...   Ahh....  There is one scenario that makes sense :(

Under the following sequence, no new MenuItems will be added.  This is a (newly) known issue, and the patch has already been created and is ready for adding to trunk:

Open the Form in the designer.  Don't change anything else.  Double click on the editor.  Do some work in the Menu Designer only (don't touch the object inspector).  Everything looks good in the Menu Designer.  Close the Designer.  Close the form, close the unit.  Re-open the unit, none of the changes were saved.

Is the above roughly what was happening?

Under a series of circumstances (Right Click on a Menu in the designer, choose Move Up/Move Down for example, but these weren't the only ones), the Menu Editor was not notifying Lazarus that the form had changed.   Once you closed the Menu Designer, Lazarus still has no clue that changes have been made, so when you closed the form/unit, you weren't asked to save changes.

If this is the case, then the workaround for now is really easy.  Close the Menu Designer.  Move the form in the designer to a new location (even by one pixel).  Now Lazarus knows the form has changed, and when you close the form, you will be asked to save changes.  And presumably this is why this went unnoticed for so long.  When working with Menu's, people usually make other changes to the form as well (including rename Menu Items) which was sufficient for Lazarus to know changes had been made.

As I said, a patch for this has been prepared (including a series of other minor improvements/fixes to the menu designer) and will be uploaded to Trunk sometime soon.  (Lazarus Developers are waiting on me for some clarifications on tangentially related issues)

http://bugs.freepascal.org/view.php?id=26795
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

snorkel

  • Hero Member
  • *****
  • Posts: 817
Re: Can't add menu items.
« Reply #18 on: October 02, 2014, 05:21:27 pm »
I had that issue when using the QT widget set on windows a while ago, but never with the
win32/win64.

I reported the QT issue as a bug and I believe it was fixed awhile ago.
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: Can't add menu items.
« Reply #19 on: October 03, 2014, 03:38:34 pm »
I had that issue when using the QT widget set on windows a while ago, but never with the
win32/win64.

I reported the QT issue as a bug and I believe it was fixed awhile ago.

You're not the only one that the issues I encountered (and described above) don't replicate for them.  They definitely did for me - but I only tested in trunk.  I'm wondering if something else is going on (either an earlier change to trunk had consequences - in which case what I've done is a workaround, and I need to find that earlier change and correctly fix, or there's something odd about my setup :-( - given that some of the people not reproducing the issue were lazarus dev's makes me suspect my system...)

Could you do me a favour and test the following sequence in 1.2.4?  (Shouldn't matter which OS or widgetset - or at least I can't see any widgetset specific code...)

Add a TMainMenu to a form.  Add two menu items.  Use Lazarus, do File - Save All.  The Save Button on the IDE should now be disabled.  Now, without making any other changes, using the menu designer right click on a menu item and choose "Move Down (or Left)".  Tell me if the Save Button gets enabled, or if it remains disabled?  (The Save Button SHOULD become enabled)

Many thanks...
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

 

TinyPortal © 2005-2018