Harry Rogers Posted October 20, 2016 Share Posted October 20, 2016 Hi Using MouseDown in a TreeView to get a right click menu. This stops the scroll bars working. Is there a way round this ? Thanks Link to comment Share on other sites More sharing options...
Sherzod Posted October 20, 2016 Share Posted October 20, 2016 Hi, Sorry, can you clarify again your issue?! Best regards. Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted October 20, 2016 Administrators Share Posted October 20, 2016 Use OnCellContextClick event instead. Link to comment Share on other sites More sharing options...
Harry Rogers Posted October 20, 2016 Author Share Posted October 20, 2016 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 More sharing options...
Harry Rogers Posted October 20, 2016 Author Share Posted October 20, 2016 Thanks Farshad The vertical position of the popup seems offset using this approach ? Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted October 20, 2016 Administrators Share Posted October 20, 2016 offset.PNGThanks Farshad The vertical position of the popup seems offset using this approach ? How did you call PopUp.Pop method? Link to comment Share on other sites More sharing options...
Harry Rogers Posted October 20, 2016 Author Share Posted October 20, 2016 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 More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now