Recent

Author Topic: TToolButton: OnArrowEvent not being fired  (Read 513 times)

piola

  • Full Member
  • ***
  • Posts: 124
  • Lazarus 2.2, 64bit on Windows 8.1 x64
TToolButton: OnArrowEvent not being fired
« on: October 06, 2022, 05:05:15 pm »
Hello,

I have a TToolButton set to tbsButtonDrop and an OnArrowClick event assigned. I do not get the event fired neither clicking on the arrow itself or the button's caption next to it (which shouldn't matter anyway for tbsButtonDrop). When changing the button style to tbsDropDown, the OnClick event fires, but the OnArrowClick doesn't either.

Using: Lazarus 2.2.2 (rev lazarus_2_2_2) FPC 3.2.2 x86_64-win64-win32/win64

Could someone confirm this behavior, maybe either with Lazarus 2.2.2 or with current 2.2.4 release (maybe it's been fixed meanwhile? - although I didn't find a report about it)

ASerge

  • Hero Member
  • *****
  • Posts: 2240
Re: TToolButton: OnArrowEvent not being fired
« Reply #1 on: October 07, 2022, 12:22:22 am »
I have a TToolButton set to tbsButtonDrop and an OnArrowClick event assigned. I do not get the event fired neither clicking on the arrow itself or the button's caption next to it (which shouldn't matter anyway for tbsButtonDrop). When changing the button style to tbsDropDown, the OnClick event fires, but the OnArrowClick doesn't either.
tbsButtonDrop
This is a button that has an arrow drawn to show that a popup menu can open. There is no OnArrowClick event, because the arrow is part of the button.

tbsDropDown
This is a button divided into two parts, an arrow separately. There is an OnArrowClick event for a separate part with an arrow.

The OnClick event works in both cases. The OnArrowClick only for tbsDropDown.

jamie

  • Hero Member
  • *****
  • Posts: 6128
Re: TToolButton: OnArrowEvent not being fired
« Reply #2 on: October 07, 2022, 12:44:21 am »
If you read, he is also stating that even with the other style he not getting the arrow event.

But I did look at it and he is correct to a point.

The Tick timer is being used and if you don't click fast enough on the arrow you won't get the event.

I think if he was to not attach the dropDown menu and then show it in the Onarrow event, it maybe what he needs.

« Last Edit: October 07, 2022, 01:31:48 am by jamie »
The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018