Harry Rogers Posted October 20, 2016 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 Quote
Sherzod Posted October 20, 2016 Posted October 20, 2016 Hi, Sorry, can you clarify again your issue?! Best regards. Quote
Administrators Farshad Mohajeri Posted October 20, 2016 Administrators Posted October 20, 2016 Use OnCellContextClick event instead. Quote
Harry Rogers Posted October 20, 2016 Author 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 Quote
Harry Rogers Posted October 20, 2016 Author Posted October 20, 2016 Thanks Farshad The vertical position of the popup seems offset using this approach ? Quote
Administrators Farshad Mohajeri Posted October 20, 2016 Administrators 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? Quote
Harry Rogers Posted October 20, 2016 Author 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.