Jump to content

Button Down Event don't fire even when PointerEventsWhileDown is true

Recommended Posts

// on click only works when not button.down

procedure TForm1.W3Button1Click(Sender: TObject);
  writeln('entered W3Button1Click');
  tw3button(sender).down := not tw3button(sender).down;


procedure TForm1.InitializeForm;
  // this is a good place to initialize components

 // visually button responds when down but even don't fire
  w3button1.PointerEventsWhileDown := true;


You can see button is set to down. You can see button respond to mouse but the click event does not fire.

Link to post
Share on other sites

TW3Button is not a toggle-button. It simply implements "Down" for futher use by decendants. You can also manually handle the DownState, but "TButton" was never a togglebutton. The reason I introduced this here was to simplify button code throughout the API. Instead of having 4 different implementation of "down" we now have 1.

TW3ToolbarButton implements the toggle you are looking for, or you can just inherit and derive one yourself.

But good idea for a new feature! Ill write it down and see if we can sneak the feature in later :)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...