TRVAControlPanel.OnGetActionControlCoords

<< Click to display table of contents >>

TRVAControlPanel.OnGetActionControlCoords

The event requests coordinates of the control which called the given action.

type

  TRVGetActionControlCoordsEvent = procedure (Sender: TrvAction;

    var R: TRect) of object;

property OnGetActionControlCoords: TRVGetActionControlCoordsEvent;

This event may occur when one of the following actions needs to position a color-picker window relative to the control which called this action:

TrvActionFontColor

TrvActionFontBackColor

TrvActionParaColor

TrvActionColor

(if UserInterface=rvacAdvanced)

This event occurs only when the component linked to the action is not a TControl (if a control executes the action, coordinates are calculated automatically).

Input parameters:

Sender – the action that is being executed.

R = Rect(0,0,0,0).

Output parameter:

R – screen coordinates of the control (if non-empty).

If this action is not processed, or if empty R is returned, a color-picker window will be displayed at the mouse pointer position.

 

Example:

This example shows how to work with TdxBarManager by Developer Express:

procedure TMyForm.RVAControlPanel1GetActionControlCoords(

  Sender: TrvAction; var R: TRect);

begin

  if (Sender.ActionComponent<>niland

     (Sender.ActionComponent is TdxBarItem) then

     with TdxBarItem(Sender.ActionComponent).ClickItemLink do begin

       R := BarControl.GetItemRect (Control);

       R.TopLeft := BarControl.ClientToScreen (R.TopLeft);

       R.BottomRight := BarControl.ClientToScreen (R.BottomRight);

     end;

end;