Jump to content
Sign in to follow this  
pyscripter

Panning in Vcl Controls

Recommended Posts

You probably have noticed that when you press the middle mouse button in the Delphi IDE the editor goes into panning mode, that allows you to scroll by moving the mouse.   Many of the Vcl.Controls are panning enabled including the Memos, Grids, ContolLists, TabControls, Treeviews and others.   For a complete list just search for csPannable in the Delphi Vcl source code folder.   They use the exact same code that the IDE uses and behave in exactly the same way.  However, what you may not know (I did not), is that to enable panning you need to include in your project the Vcl.IMouse unit.  Vcl also makes it easy to add panning to your custom controls.  All it takes is to add the csPannable control style.  So SynEdit now has the same panning support as the Delphi IDE.

 

However, I have discovered two bugs related to Vcl panning:

 

Both are easy to fix, so hopefully Embarcadero will provide fixes soon enough!  In the meantime, it is easy to work around the memory leak and hopefully live with the second one, which also affects the Delphi IDE.

Edited by pyscripter
  • Like 1
  • Thanks 4

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×