LargeButtonedItem events don't fire

I want to be able to click on the Caption and/or description and/or button in a LargeButtonedItem in a Poly list.
 
The Button click event fires but the OnItemClick and OnItemDblClick events never fire.
 
How do I capture the mouse click on any other part of the LargeButtonedItem?
 
Regards
Adam
 

 

Hi, 


By default the button is not clickable, it inherits and implements default behavior of a section.
Yet, there is a workaround for this. You need to create a package that registers a new component and inherits from TLargeButtonedItem:

  TClickableLargeButtonedItem = class(TLargeButtonedItem)
  public
    function GetItemInteraction(pX, pY: integer): TItemInteractionType; override;
  end;

function TClickableLargeButtonedItem.GetItemInteraction(pX,
  pY: integer): TItemInteractionType;
begin
  Result := itNone;
  if IsButtonAtXY(pX, pY) and ButtonEnabled then
    result := itButton
  else if IsStatusAtXY(pX, pY) then
    result := itStatus
  else if IsItemAtXY(pX, pY) then
    result := itDefault;
end;

in the register call you need to call RegisterPolyItem(TClickableLargeButtonedItem) to make sure it is visible in the designtime editor. The OnItemClick should then work when clicking on a part that is not the button.

Creating a custom item is also explained in the manual.

Kind Regards,
Scheldeman Pieter