Recent

Author Topic: [Solved] TPopupMenu does't seem to work for TComboBox?  (Read 7868 times)

Avishai

  • Hero Member
  • *****
  • Posts: 1021
[Solved] TPopupMenu does't seem to work for TComboBox?
« on: March 11, 2011, 09:35:12 pm »
TPopupMenu does't seem to work for TComboBox?  Is this by design, or do I have something set wrong?
« Last Edit: March 12, 2011, 09:56:37 am by Avishai »
Lazarus Trunk / fpc 2.6.2 / Win32

Blaazen

  • Hero Member
  • *****
  • Posts: 3241
  • POKE 54296,15
    • Eye-Candy Controls
Re: TPopupMenu does't seem to work for TComboBox?
« Reply #1 on: March 11, 2011, 09:45:22 pm »
Works here (Qt) - when Combo is closed. Does't work if combo is opened, in this case right-click only selects item. I think it is normal.
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

Avishai

  • Hero Member
  • *****
  • Posts: 1021
Re: TPopupMenu does't seem to work for TComboBox?
« Reply #2 on: March 11, 2011, 09:53:29 pm »
Mmm.  I must have something set wrong someplace though I can't think where.  I just added the first popup so there is no code that I can think of that would cause this.  Popup works fine in TEdit, but in TComboBox.Text area it gives the standard popup as though no popup was assigned.  Same for the ComboBox Items List.  I'm using Win7-64 and FPC 2.5.1 if that means anything.
« Last Edit: March 12, 2011, 10:25:45 pm by Avishai »
Lazarus Trunk / fpc 2.6.2 / Win32

Avishai

  • Hero Member
  • *****
  • Posts: 1021
Re: TPopupMenu does't seem to work for TComboBox?
« Reply #3 on: March 12, 2011, 01:04:24 am »
OK.  I started a new blank program to test the problem with the Popup Menu.  I added a TComboBox, a TEdit and a TPopupMenu. The PopupMenu acted as expected on the TEdit, but on the TComboBox I got the default popup menu, Not the menu I provided.  So it appears that the problem isn't with my code.  It isn't that big of a problem for me.  I can find another way to do what I need to do.  But if this is a bug in FPC or Lazarus, it should be addressed.  Then again, maybe I'm just having a bad day.
Lazarus Trunk / fpc 2.6.2 / Win32

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: TPopupMenu does't seem to work for TComboBox?
« Reply #4 on: March 12, 2011, 01:26:06 am »
I can reproduce that.

Lazarus 0.9.29 r28656 FPC 2.5.1 i386-win32-win32/win64

fabienwang

  • Sr. Member
  • ****
  • Posts: 449
  • Lazarus is the best
    • My blog
Re: TPopupMenu does't seem to work for TComboBox?
« Reply #5 on: March 12, 2011, 09:24:55 am »
I can reproduce too. But i think it's a normal behavior.

Lazarus 0.9.31 r29668 FPC 2.4.3 i386-win32-win32/win64


Look at the picture ;)
I'm using Arch Linux.
Known for: CPickSniff, OpenGrabby
Contributed to: LazPaint

Avishai

  • Hero Member
  • *****
  • Posts: 1021
Re: TPopupMenu does't seem to work for TComboBox?
« Reply #6 on: March 12, 2011, 09:35:56 am »
Ah, I see.  Thanks FabienWang :)  I didn't know that.  I was expecting it to act the way it does in Delphi.  I'm not sure yet which way I like better.  I'll have to give it some thought, although I don't think it matters.  If this is Lazarus way, then that's the way it will be.  I'm very new to Lazarus but an old-timer with Delphi.  So far, I'm loving what I see with Lazarus.
« Last Edit: March 12, 2011, 10:30:12 pm by Avishai »
Lazarus Trunk / fpc 2.6.2 / Win32

fabienwang

  • Sr. Member
  • ****
  • Posts: 449
  • Lazarus is the best
    • My blog
Re: TPopupMenu does't seem to work for TComboBox?
« Reply #7 on: March 12, 2011, 09:54:03 am »
Great :) same for me about Lazarus :)

oh and as you said, if you'd really want your popup menu,
you can still implement the onMouseDown of the combobox,
and put:

  if Button = mbRight then
    PopupMenu1.PopUp;

it will work ^^

PS: you can change the first post topic with "[SOLVED]" or something :)

Best Regards,
FabienWang
I'm using Arch Linux.
Known for: CPickSniff, OpenGrabby
Contributed to: LazPaint

jixian.yang

  • Full Member
  • ***
  • Posts: 173
Re: [Solved] TPopupMenu does't seem to work for TComboBox?
« Reply #8 on: March 12, 2011, 05:20:48 pm »
Is it not a bug? Should we do it in onMouseDown?

 

TinyPortal © 2005-2018