{"id":13445727,"url":"https://github.com/Pulover/Class_LV_Rows","last_synced_at":"2025-03-21T05:31:06.145Z","repository":{"id":72306321,"uuid":"53980301","full_name":"Pulover/Class_LV_Rows","owner":"Pulover","description":"Additional functions for AHK ListView controls","archived":false,"fork":false,"pushed_at":"2020-12-28T23:51:06.000Z","size":46,"stargazers_count":16,"open_issues_count":0,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-28T09:50:51.553Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://autohotkey.com/boards/viewtopic.php?f=6\u0026t=137","language":"AutoHotkey","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Pulover.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-03-15T21:39:03.000Z","updated_at":"2024-04-22T15:14:57.000Z","dependencies_parsed_at":"2024-01-27T09:09:32.919Z","dependency_job_id":"3fa05d7a-1154-466e-b59e-d8b083a85e05","html_url":"https://github.com/Pulover/Class_LV_Rows","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pulover%2FClass_LV_Rows","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pulover%2FClass_LV_Rows/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pulover%2FClass_LV_Rows/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pulover%2FClass_LV_Rows/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pulover","download_url":"https://codeload.github.com/Pulover/Class_LV_Rows/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244745691,"owners_count":20503044,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T05:00:38.419Z","updated_at":"2025-03-21T05:31:05.837Z","avatar_url":"https://github.com/Pulover.png","language":"AutoHotkey","readme":"# Class LV_Rows\n\n## Additional functions for AHK ListView controls\n\nAHK version: 1.1.23.01\n\nThis class provides an easy way to add functionalities to ListViews that are not supported by AutoHotkey built-in functions such as Copy, Cut, Paste, Drag and more.\n\n### Credits\n[LV_EX functions](https://github.com/AHK-just-me/LV_EX) by just me\n\n## Edit Functions\n* Copy([CopyData])\n* Cut([CopyData])\n* Paste([Row, Multiline])\n* Duplicate()\n* Delete()\n* Move([Up])\n* Drag([DragButton, AutoScroll, ScrollDelay, LineThick, Color, Drop])\n\n## History Functions\n* Add([Data])\n* Undo()\n* Redo()\n* ClearHistory()\n\n## Group Functions\n* EnableGroups([Enable, FirstName, Collapsible, StartCollapsed])\n* InsertGroup([Row, GroupName])\n* RemoveGroup([Row])\n* InsertAtGroup([Count, Rows*])\n* RemoveAtGroup([Count, Rows*])\n* SetGroups(Groups)\n* GetGroups([AsObject])\n* SetGroupCollapisable([Collapsible])\n* RemoveAllGroups([FirstName])\n* CollapseAll([Collapse])\n* RefreshGroups([Collapsed])\n\n## Management Functions\n* InsertHwnd(Hwnd)\n* RemoveHwnd(Hwnd)\n* SetHwnd(Hwnd [, NewData])\n* GetData([Hwnd])\n* SetCallback(Func)\n\n- - -\n\n## Usage\nYou can call the function by preceding them with LV_Rows. For example:\nLV_Rows.Copy() \u003c-- Calls function on active ListView.\n\nOr with a handle initialized via New meta-function. For example:\nMyListHandle := New LV_Rows() \u003c-- Creates a new handle.\nMyListHandle.Add() \u003c-- Calls function for that Handle.\n\nLike AutoHotkey built-in functions, these functions operate on the default gui, and active ListView control. When usingle handles, SetHwnd will attempt to set the selected ListView as active, but it's recommend to call Gui, Listview on your script too.\n\nInitializing is required for History and Group functions and in case your ListView has icons to be moved during Drag().\nGui, Add, ListView, hwndhLV, Columns\nMyListHandle := New LV_Rows(hLV) \u003c-- Creates a new handle with Hwnd.\n\nGui, Add, ListView, hwndhLV1, Columns\nGui, Add, ListView, hwndhLV2, Columns\nMyListHandle := New LV_Rows(hLV1, hLV2)\n\nYou can also use the same handle for the Edit functions.\nYou can create more handles or pass the ListView's Hwnd to operate on different lists with the same handle.\n\n- - -\n\n## Management Functions\nSet, Insert and Remove ListView Hwnd's.\n\n## Handle.InsertHwnd()\nInserts one or more ListView Hwnd's to be managed.\n\n### Return\nNo return value.\n\n### Parameters\n* **Hwnd** - One or more ListView Hwnd's.\n\n## Handle.RemoveHwnd()\nRemoves a ListView Hwnd.\n\n### Return\nNo return value.\n\n### Parameters\n* **Hwnd** - Hwnd of the ListView to be removed.\n\n## Handle.SetHwnd()\nSelects a previously inserted ListView or adds it to the handle and selects it, optionally copying the data, history and groups from another Hwnd.\n\n### Return\nNo return value.\n\n### Parameters\n* **Hwnd** - Hwnd of a ListView to be selected. If the hwnd is not found, it will be added to the handle and selected.\n* **NewData** - Hwnd of a previously inserted ListView whose data, history and groups will be copied to the one being selected.\n\n## Handle.GetData()\nRetrieves the data, history and groups of a previously inserted ListView.\n\n### Return\nAn object with data, history and groups of a ListView.\n\n### Parameters\n* **Hwnd** - Hwnd of a previously inserted ListView. If left blank, the current active ListView will be returned.\n* **NewData** - Hwnd of a previously inserted ListView whose data, history and groups will be copied to the one being selected.\n\n## Handle.SetData()\nRetrieves the data, history and groups of a previously inserted ListView.\n\n### Return\nNo return value.\n\n### Parameters\n* **Hwnd** - Hwnd of a previously inserted ListView. If left blank, the current active ListView will be used.\n\n## LV_Rows.SetCallback()\nSets a callback function where the user can take actions based on the function being called called. The Callback function must return true for the operation to be completed.\n\n### Return\nNo return value.\n\n### Parameters\n* **Func** - Name of a user-defined function that should receive 2 parameters** - The name of the function being called and the Hwnd of the current set ListView.\n\n## Edit Functions\nEdit ListView rows.\n\n## LV_Rows.Copy()\nCopy selected rows to memory.\n\n### Return\nNumber of copied rows.\n\n### Parameters\n* **CopyData** - Optional output variable to store the copied data.\n\n## LV_Rows.Cut()\nCopy selected rows to memory and delete them.\n\n### Return\nNumber of copied rows.\n\n### Parameters\n* **CopyData** - Optional output variable to store the copied data.\n\n## LV_Rows.Paste()\nPaste copied rows at selected position.\n\n### Return\nTrue if memory contains data or false if not.\n\n### Parameters\n* **Row** - If non-zero pastes memory contents at the specified row.\n* **Multiline** - If true pastes the contents at every selected row.\n\n## LV_Rows.Duplicate()\nDuplicates selected rows.\n\n### Return\nNumber of duplicated rows.\n\n## LV_Rows.Delete()\nDelete selected rows.\n\n### Return\nNumber of removed rows.\n\n## LV_Rows.Move()\nMove selected rows down or up.\n\n### Return\nNumber of rows moved.\n\n### Parameters\n* **Up** - If false or omitted moves rows down. If true moves rows up.\n\n## LV_Rows.Drag()\nDrag-and-Drop selected rows showing a destination bar. Must be called in the ListView G-Label subroutine when A_GuiEvent returns \"D\" or \"d\".\n\n### Return\nThe destination row number.\n\n### Parameters\n* **DragButton** - If it is a lower case \"d\" it will be recognized as a Right-Click drag and won't actually move any row, only return the destination, otherwise it will be recognized as a Left-Click drag. You may pass A_GuiEvent as the parameter.\n* **AutoScroll** - If true or omitted the ListView will automatically scroll up or down when the cursor is above or below the control.\n* **ScrollDelay** - Delay in miliseconds for AutoScroll. Default is 100ms.\n* **LineThick** - Thickness of the destination bar in pixels. Default is 2px.\n* **Color** - Color of destination bar. Default is \"Black\".\n* **Drop** - Set to False to disable automatically dropping selected rows.\n\n## History Functions\nKeep a history of ListView changes and allow Undo and Redo. These functions operate on the currently selected ListView.\n\n## Handle.Add()\nAdds an entry on History. This function requires initializing: MyListHandle := New LV_Rows()\n\n### Return\nThe total number of entries in history.\n\n### Parameters\n* **Data** - An optional object containing an array of RowText Data. The object MUST be an array of objects retrieved using RowText().\n\n## Handle.Undo()\nReplaces ListView contents with previous entry state, if any.\n\n### Return\nNew entry position or false if it's already the first entry.\n\n## Handle.Redo()\nReplaces ListView contents with next entry state, if any.\n\n### Return\nNew entry position or false if it's already the last entry.\n\n## Handle.ClearHistory()\nRemoves all history entries from the ListView.\n\n### Return\nNew entry position or false if it's already the last entry.\n\n## Group Functions\nSet, add and remove Listview Groups. These functions are based on just me's [LV_EX library](http://autohotkey.com/boards/viewtopic.php?t=1256)\n\n## Handle.EnableGroups()\nEnables or disables Groups in the currently selected ListView initializing: MyListHandle := New LV_Rows()\n\n### Return\nNo return value.\n\n### Parameters\n* **Enable** - If TRUE enables GroupView in the selected ListView. If FALSE disables it.\n* **FirstName** - Name for the first (mandatory) group at row 1.\n* **Collapsible** - If TRUE makes the groups collapsible.\n* **StartCollapsed** - If TRUE starts all groups collapsed.\n\n## Handle.InsertGroup()\nInserts or renames a group on top of the specified row.\n\n### Return\nTRUE if Row is bigger than 0 or FALSE otherwise.\n\n### Parameters\n* **Row** - Number of the row for the group to be inserted. If left blank the first selected row will be used.\n* **GroupName** - Name of the new group or new name for an existing group.\n\n## Handle.RemoveGroup()\nRemoves the group the indicated row belongs to.\n\n### Return\nTRUE if Row is bigger than 0 or FALSE otherwise.\n\n### Parameters\n* **Row** - Number of a row the group belongs to. If left blank the first selected row will be used.\n\n## Handle.InsertAtGroup()\nInserts a row at indicated position, moving groups after it one row down.\n\n### Return\nNo return value.\n\n### Parameters\n* **Row** - Number of the row where to insert.\n\n## Handle.RemoveAtGroup()\nRemoves a row from indicated position, moving groups after it one row up.\n\n### Return\nNo return value.\n\n### Parameters\n* **Row** - Number of the row where to insert.\n\n## Handle.SetGroups()\nSets one or more groups in the selected ListView.\n\n### Return\nNo return value.\n\n### Parameters\n* **Groups** - A list of groups in the format \"GroupName:RowNumber\" separated by comma. You can use GetGroups() to save a valid String or Object to be used with this function.\n\n## Handle.GetGroups()\nReturns a string or object representing the current groups in the selected ListView.\n\n### Return\nNo return value.\n\n### Parameters\n* **AsObject** - If TRUE returns an object with the groups, otherwise an string. Both can be used with SetGroups().\n\n## Handle.SetGroupCollapisable()\nEnables or disables Groups Collapsible style.\n\n### Return\nNo return value.\n\n### Parameters\n* **Collapsible** - If TRUE enables Collapsible style in the selected ListView. If FALSE disables it.\n\n## Handle.RemoveAllGroups()\nRemoves all groups in the selected ListView.\n\n### Return\nNo return value.\n\n### Parameters\n* **FirstName** - Name for the first (mandatory) group at row 1.\n\n## Handle.CollapseAll()\nCollapses or expands all groups.\n\n### Return\nNo return value.\n\n### Parameters\n* **Collapse** - If TRUE collapses all groups in the selected ListView. If FALSE expands all groups in the selected ListView.\n\n## Handle.RefreshGroups()\nReloads the ListView to update groups. This function is called automatically in from other functions, usually it's not necessary to use it in your script.\n\n### Return\nNo return value.\n\n### Parameters\n* **Collapsed** - If TRUE collapses all groups in the selected ListView.\n\n","funding_links":[],"categories":["AutoHotkey","Libraries"],"sub_categories":["\u003ca name=\"libraries-gui\"\u003e\u003c/a\u003eGUI"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPulover%2FClass_LV_Rows","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPulover%2FClass_LV_Rows","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPulover%2FClass_LV_Rows/lists"}