Recent

Author Topic: PopUp Menu Assigned to Form Show'sUp on Title Bar  (Read 7144 times)

Never

  • Sr. Member
  • ****
  • Posts: 409
  • OS:Win7 64bit / Lazarus 1.4
PopUp Menu Assigned to Form Show'sUp on Title Bar
« on: September 20, 2014, 09:37:41 pm »
 [win7 64 bit laz 1.2.4]
The case
Create a new project
Add a popup menu [PopupMenu1]
Add items to [PopupMenu1]
Use the form's property [PopupMenu] and set the value to [PopupMenu1]
Run the app
right click on the title bar of the form

you will get the popup in place of the system menu

Is this a wanted feature?or a bug?
Νέπε Λάζαρε λάγγεψων οξωκά ο φίλοσ'ς αραεύσε

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: PopUp Menu Assigned to Form Show'sUp on Title Bar
« Reply #1 on: September 20, 2014, 10:32:29 pm »
I admit, getting the popup menu by right clicking on the Title Bar surprised me.  I would have expected to see the System Menu too.  In fact, right click on Lazarus's Title Bar, and you do get the System Menu and I would have presumed that's using the same controls.  I wonder what's happening?

UPDATE: I see, no popupmenu for the Lazarus MainBar...

Hmmm, sounds like a bug to me...
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

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: PopUp Menu Assigned to Form Show'sUp on Title Bar
« Reply #2 on: September 20, 2014, 10:32:44 pm »
Well, you are clicking on the form, after all.
If you don't like the title bar being considered part of the form you can always add an OnPopup handler to exclude the menu popping up when outside the form client area.

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: PopUp Menu Assigned to Form Show'sUp on Title Bar
« Reply #3 on: September 20, 2014, 10:34:59 pm »
Well, you are clicking on the form, after all.
If you don't like the title bar being considered part of the form you can always add an OnPopup handler to exclude the menu popping up when outside the form client area.

Is that clicking on the form?  I thought that Title Bar was outside our Client Area...
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

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: PopUp Menu Assigned to Form Show'sUp on Title Bar
« Reply #4 on: September 20, 2014, 10:52:03 pm »
Well if 'form' = 'client area' then, yes I guess this behaviour should be considered a bug if it suppresses display of the system menu.

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: PopUp Menu Assigned to Form Show'sUp on Title Bar
« Reply #5 on: September 20, 2014, 11:06:37 pm »
I actually cannot think of windows executable to test this on.  All the Windows exe's I know don't have any exposed form (and all the popup menus are assigned to child controls).

Not really sure what the rules are here...
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

Never

  • Sr. Member
  • ****
  • Posts: 409
  • OS:Win7 64bit / Lazarus 1.4
Re: PopUp Menu Assigned to Form Show'sUp on Title Bar
« Reply #6 on: September 20, 2014, 11:23:49 pm »
The above behaivor is in my opinion is related to this post

[ http://forum.lazarus.freepascal.org/index.php/topic,25815.msg157352.html#msg157352 ]

in my opinion something is wrong  there
Νέπε Λάζαρε λάγγεψων οξωκά ο φίλοσ'ς αραεύσε

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: PopUp Menu Assigned to Form Show'sUp on Title Bar
« Reply #7 on: September 20, 2014, 11:36:07 pm »
The above behaivor is in my opinion is related to this post

[ http://forum.lazarus.freepascal.org/index.php/topic,25815.msg157352.html#msg157352 ]

in my opinion something is wrong  there

How so?
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

ChrisF

  • Hero Member
  • *****
  • Posts: 542
Re: PopUp Menu Assigned to Form Show'sUp on Title Bar
« Reply #8 on: September 20, 2014, 11:41:31 pm »
Definitively a bug.

Even my old Delphi 7 process it properly (i.e. system menu displayed).

As you probably won't take my words for granted, a link to the Microsoft documentation:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms647553%28v=vs.85%29.aspx#_win32_Shortcut_Menus

Extract of this documentation:
Quote
The user can open the window menu by clicking the application icon on the title bar or by right-clicking anywhere on the title bar.

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: PopUp Menu Assigned to Form Show'sUp on Title Bar
« Reply #9 on: September 20, 2014, 11:52:54 pm »
M$ tend to take their own medicine, and the (few) M$ apps I have all show a system menu (sometimes modified) when right-clicking on the title bar (Win 7). Lazarus itself follows suit.
However quite a number of other apps including Firefox, Chrome, mp3 players and internet radio apps, graphics apps etc. have no standard system menu showing at all on a title bar right-click, often subtituting a rather different and sometimes quite extensive menu.
What is the norm for Linux distros and recent Macs?

ChrisF

  • Hero Member
  • *****
  • Posts: 542
Re: PopUp Menu Assigned to Form Show'sUp on Title Bar
« Reply #10 on: September 21, 2014, 12:09:45 am »
Well, some applications don't have any title bar at all: especially audio or video applications, I agree. Or they have their own native one.

But, if you take VideoLan for instance (www.videolan.org), the standard interface (i.e. a "normal" window) shows the system menu when right-clicking on the title. While an interface with a theme for the same program doesn't.

Firefox and Thunderbird have also completely modified the whole title area, to give more place to the web content.

So, my interpretation is:

- if you have a "standard" window, you should get the "standard" system menu when right-clicking on its title.

- if not, feel free to do as you wish.

Rails

  • Guest
Re: PopUp Menu Assigned to Form Show'sUp on Title Bar
« Reply #11 on: September 21, 2014, 03:01:19 am »

What is the norm for Linux distros and recent Macs?

Looks like it is controlled by the window manager on Linux. I use the xfce4 desktop (xfwm4 window manager). Right clicking on the title bar brings up a window menu. It appears to be identical for all applications. Iceweasel (Debian specific name for Firefox) is the same as everything else. Same for the VLC media player from VideoLan.


« Last Edit: September 21, 2014, 03:03:02 am by Rails »

 

TinyPortal © 2005-2018