Updated 27-08-2013: Added Multiline-Paste option; Added support Duplicate function.
Updated 12-09-2013: Fixed wrong line width on systems with a non-standard DPI setting.
This class is a collection of functions to allow additional functionalities in ListViews that are not supported by AutoHotkey built-in functions.
It provides an easy way to add the commands Copy, Cut, Paste, Duplicate, Delete, Move, Drag, Undo and Redo.
Features:
- Edit functions: Copy, Cut, Paste, Duplicate, Delete, Move and Drag-and-Drop.
- History functions: Add, Undo and Redo.
- Copy, cut and paste between different ListViews.
- Keep history of individual ListViews to be used with Undo and Redo.
- Drag-and-Drop shows a destination bar to indicate where selected rows will be moved to.
- Auto-Scrolls ListViews when dragging above or below them.
- Supports Right-Click drag.
- Supports Checked ListViews.
- Supports ListViews with Icons.
- Customize Auto-Scroll delay, thickness and color of destination bar.
Class_LV_Rows.ahk
Notes:
- They all operate on the active ListView control, like AHK built-in functions.
- Edit functions can be called directly as easy as
^c::LV_Rows.Copy()
. - History functions must be initialized via
Handle := New LV_Rows()
. - To keep original icons you must initialize it passing the ListView's HWND, i.e.
Handle := New LV_Rows(Hwnd)
. - The Drag function must be called from the LV G-Label when the Drag event occurs.
- You can keep individual Copy & Paste data by using different handles.
LV_Rows_Demo.ahk:
LV_Rows_IconsDemo.ahk:
I've originally written this class to use with my Macro Creator. Suggestions of improvements are welcome.
Special thanks to Micahs for the base code for the Drag function.