I'm using Lazarus IDE v1.0.2 on Windows 7.
When I right click a button, I don't get an OnClick Event?
Is this expected? If so, why?
Tom Crone

Mailing lists / lazarus / 2012-12
6 messages · 5 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
I'm using Lazarus IDE v1.0.2 on Windows 7.
When I right click a button, I don't get an OnClick Event?
Is this expected? If so, why?
Tom Crone
Seems we're faithfully following the competition/inspiration/other product: http://docwiki.embarcadero.com/Libraries/XE3/en/Vcl.StdCtrls.TButton.OnClick
.. that states the event fires for left mouse click, but nothing about right mouse click..
The competition/inspiration/other's doc says:
Use the OnClick event handler to respond when the user clicks the control. <<cut>>
Usually, OnClick occurs when the user presses and releases the left mouse button with the mouse pointer over the control. This event can also occur when: ...
So it doesn't outlaw OnClick for right click... :-)
Or could there be an OnRightClick event?
I have a Step button in a celluar automaton program, and hoped to have left click do one more line, right click to 10 more lines, and shift-click to 10 times the unshifted...
Now, in OnMouseDown, I have:
if Button=mbRight then StepCount:=10 else StepCount:=1;
if ssShift in Shift then StepCount:=10*StepCount;
Then in OnClick I use StepCount, but I have to doubleClick to get OnClick to fire....Tom
I'm using Lazarus IDE v1.0.2 on Windows 7. When I right click a button, I don't get an…
Tested with Delphi 3. No OnClick on right-clicking.
Bart
The competition/inspiration/other's doc says: Use the OnClick event handler to respond…
Thomas J. wroteThen in OnClick I use StepCount, but I have to doubleClick to get OnClick to fire....
Why is that? OnClick should fire with a single click.
Anyway you can use OnMouseUp to test Left/Right click. OnClick is not needed at all then.
Juha
I'm using Lazarus IDE v1.0.2 on Windows 7. When I right click a button, I don't get an…
Probably to avoid interference with any Menu defined for the Form. ?
A. G.
?