Jump to content

MouseDown and Scroll bars


Harry Rogers

Recommended Posts

Certainly.

 

I've added a MouseDown event handler to a tree view. So I can display a popup menu when the user does a right click on the Treeview Items.

 

procedure TfrmTransactions.tvTransMouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
 if Button=mbRight then
  UniPopupMenu1.Popup(X, Y,tvtrans);
end;
 
By having UniGui 'trap' the MouseDown like this - it's not possible to scroll the items in the TreeView by clicking on the scroll bars. That is clicking on the scroll bar or the up/down arrows of the TreeView has no effect.
Taking out the MouseDown event handler restores normal behavior.
 
Thanks
Link to comment
Share on other sites

Like this  (as a temp fix - subtracting about 200 seems about right to align the menu again for the window sizes I'm using)

 

procedure TfrmTransactions.tvTransCellContextClick(ANode: TUniTreeNode; X,
  Y: Integer);
begin
  UniPopupMenu1.Popup(X, Y -190,tvtrans);
end;
 
Cheers
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...