TdxCustomNavBar.IsPtBottomScrollButton(TPoint) Method
Returns a value indicating whether the point specified is over the bottom scroll button.
Declaration
function IsPtBottomScrollButton(const pt: TPoint): Boolean;
Parameters
Name | Type |
---|---|
pt | TPoint |
Returns
Type |
---|
Boolean |
Remarks
Call this function when you need to determine if a point is over the bottom scroll button. The point tested is specified by the pt parameter (in the client coordinates of the control). If the point is within the bottom scroll button’s bounding rectangle, the function returns True. Otherwise, False is returned.
If you need to determine whether a point is within the top scroll button’s area, use the IsPtTopScrollButton function.
The IsPtBottomScrollButton function can be used, for instance, when handling mouse movements or clicks to perform appropriate actions. The example below shows how to invoke a context menu when a group’s client area is clicked. If the clicked point is within the top or bottom scroll button, the menu is not invoked. The sample uses the GetGroupAtItemsPos, IsPtBottomScrollButton and IsPtTopScrollButton functions to see if the mouse cursor is over a group’s client area or whether it is over a scroll button. (The code assumes that there is a popup menu component named PopupMenu1 residing on the form.)
procedure TfrmNavBarDemo.dxNavBarMouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
APoint: TPoint;
begin
if Button <> mbRight then Exit;
APoint := Point(X, Y);
if dxNavBar.GetGroupAtItemsPos(APoint) = nil then Exit;
if dxNavBar.IsPtBottomScrollButton(APoint) or dxNavBar.IsPtTopScrollButton(APoint) then Exit;
APoint := dxNavBar.ClientToScreen(APoint);
PopupMenu1.Popup(APoint.X, APoint.Y);
end;