Recent

Author Topic: TPopupMenu bug?  (Read 1124 times)

Birger52

  • Sr. Member
  • ****
  • Posts: 309
TPopupMenu bug?
« on: September 20, 2019, 04:15:10 pm »
I have a TNotifyIcon with an attached TPopupMenu
Two fields for the menu
AutoPopup and TTrackButton seem to be non functioning.
The menu always pops up when the icon is rightclicked - and only when rightclicked.

Menu pops up, with AutoPopup set to both true and false.

According to documentation (https://lazarus-ccr.sourceforge.io/docs/lcl/menus/ttrackbutton.html)
Setting TrackButton to tbRightButton, should make the menu popup with either button - it dont; only when clicked with the right button.
Setting TrackButton to tb LeftButton should make it popup only when clicked with the left button - but it still only pops up with a click of the right button.
Lazarus 2.0.8 FPC 3.0.4
Win7 64bit
Playing and learning - strictly for my own pleasure.

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: TPopupMenu bug?
« Reply #1 on: September 20, 2019, 04:31:22 pm »
IIRC, TTrackButton only specifies which button(s) can be used to "click" a menu item, not which can be used to popup the menu itself. This last, again IIRC, is widgetset-dependent and can't be easily changed: one has to use some workaround---like, say, intercepting mouse operations.

As for AutoPopup, I've never used it but according to the documentation it's used to popup the menu whenever the mouse hovers over the corresponding object, but this is probably wodgetset-dependent too.
« Last Edit: September 20, 2019, 04:35:28 pm by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

Birger52

  • Sr. Member
  • ****
  • Posts: 309
Re: TPopupMenu bug?
« Reply #2 on: September 20, 2019, 09:59:53 pm »
Thx for the answer.
And it seems you do remember correctly (better than I read, obviously) - at least about which button to click to obtain a result.
Changing the setting has no effect tho - Items are always activated with right or left..
 ;)
So I'll assume you're correct about AutoPopup as well - it is not functioning with my widgetset (default).
Lazarus 2.0.8 FPC 3.0.4
Win7 64bit
Playing and learning - strictly for my own pleasure.

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: TPopupMenu bug?
« Reply #3 on: September 21, 2019, 03:18:22 am »
In case it interests you, I've made a little test in Linux (GTK2 widgetset) and they do nothing here either. The menu doesn't pop up on mouse hover, whatever the value of AutoPopup, and the items can be "clicked" with both left and right buttons whatever the value of TrackButton.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

Birger52

  • Sr. Member
  • ****
  • Posts: 309
Re: TPopupMenu bug?
« Reply #4 on: September 21, 2019, 12:21:22 pm »
Thx for info.

Searching in Forum, brings up the same question - but from 2012, and with no answers at all.
So one would think, something had been done in the meantime...

I'm still learning - both Free Pascal and Lazarus -, so stick to Windoze for now.
I do have a Linux/Peppermint here tho, so at some point I might give it a try in linux.
 8)
Lazarus 2.0.8 FPC 3.0.4
Win7 64bit
Playing and learning - strictly for my own pleasure.

 

TinyPortal © 2005-2018