select control with right click mouse

General TRichView support forum. Please post your questions here
Post Reply
piet van Blokland
Posts: 6
Joined: Fri Sep 09, 2005 2:17 pm

select control with right click mouse

Post by piet van Blokland »

I have inserted several controls in my richvieweditor
If left click the control is selected and the resizing handles appear.
How to select the control when right click with the mouse?

Can you help me?

Piet van Blokland
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Resizing handles appear when the control is selected.
That means you have code selecting controls on clicking.
If you used this demo as a sample: http://www.trichview.com/forums/viewtopic.php?t=157
this code is

Code: Select all

// This procedure is assigned to OnMouseDown of all inserted buttons
procedure TForm1.ControlMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  if Button = mbLeft then begin
    rve.SelectControl(TControl(Sender));
    ClickedControl := Sender;
    ClickPoint := Point(X, Y);
  end;
end;
Just change
Button = mbLeft
to
Button in [mbLeft, mbRight].
Post Reply