[NEW VERSION] - 6 Feb 16 ------------------------ Added: • ListView contents can now be saved to and reloaded from file - the new functions _GUIListViewEx_Save/LoadListView allow you save the content, the column headers, any checkbox states and (see below) any user colour settings. • The current _GUIListViewEx_Insert/Delete functions act on the selected items within the active ListView (activaton being either by clicking or programatically) - 2 new functions _GUIListViewEx_Insert/DeleteSpec allow the user to programatically specify the ListView and row/col to add/remove. • In the same manner as the functions above add/remove rows, 4 new functions (_GUIListViewEx_Insert/DeleteCol & _GUIListViewEx_Insert/DeleteColSpec) allow the user to add/remove columns. • If the containing GUI was closed using the titlebar [X] while item editing was taking place, it sometimes took more then one click to get a response. A new handler _GUIListViewEx_WM_SYSCOMMAND_Handler has been added to intercept the closure message and act more quickly. This handler only manages this specific task and is not involved for any other UDF functionality • And now the most exciting part of this update - colour! • Users can now colour individual items with in the ListView using the _GUIListViewEx_SetColour function. The text and background can be coloured individually or together and can be reset to the default colours if required. The ListView can also be created with coloured elements by creating a suitable array and using the _GUIListViewEx_LoadColour function. Note that if colours are set, using the load/save functions mentioned above will also save/load the colours. • The UDF now logs the row and column of the last right-click so that a context menu can be used to trigger actions - the index of the last right-clicked ListView and the specific row/column can be obtained via the _GUIListViewEx_ContextPos function. Changed: • All "Internal Use Only" functions now have a leading double-underscore. [NEW VERSION] - 24 Oct 15 ------------------------ Added: _GUIListViewEx_ChangeItem now waits for the "end edit" key ({ENTER} or {ESC}) to be released before returning to prevent problems when used in a loop. The function also now returns True in @?extended if the {ENTER} key was used to end the edit and False in all other cases to allow for post-edit decision-making. [NEW VERSION] - 10 Aug 15 ------------------------ Added: A new function _GUIListViewEx_EditWidth to set the width of the edit/combo control when editing. In particular, this allows combo items to be wider than the ListView column. Added: As items can now be wider then columns, the user can specify that a tooltip appear when a column is clicked to display the full item content. The new functions are _GUIListViewEx_ToolTipInit which defines the column(s) to display a tooltip when clicked and _GUIListViewEx_ToolTipShow which when placed in the idle loop displays the tooltips themselves. [NEW VERSION] - 10 Jul 15 ------------------------ Added: A new function _GUIListViewEx_DragEvent - this allows the detection of items being dragged by the mouse so that any recalculations of the ListView values can take place.. [BUGFIX VERSION] - 30 Mar 15 ------------------------ Fixed: A bug in the _GUIListViewEx_EditItem function. [NEW VERSION] - 13 Mar 15 ------------------------ Added: UDF can now cope with reordered columns when the $LVS_EX_HEADERDRAGDROP style is applied to the ListView. There is no time penalty if the style is not applied and the UDF automatically detects and deals with a changed column order. See Example 4 for a demonstration. Fixed: A small problem with defining the editable columns if there were more than 9. [NEW VERSION] - 9 Feb 15 ------------------------ Changed: Previous changes led to unwanted behaviour when dropping to the empty space below existing items in other ListViews. Now dropping items into the empty space will automatically place the item at the end of the list. [NEW VERSION] - 7 Jan 15 ------------------------ Added: New function (_GUIListViewEx_ChangeItem) to allow ListView items to be changed programmatically. Changed: - No requirement to initialise combos when editing - using _GUIListViewEx_ComboData forces the defined column to use combos. - Return arrays after item or header edit now contain both original and new content to allow for checking and possible replacement (using the new function wink.png) Fixed: UDF will now run correctly regardless of whatever MouseCoordMode is set. [BUGFIX VERSION] - 24 Dec 14 ---------------------------- Fixed: Bottom item no longer moves to top if dragged into empty space below in the ListView. [BUGFIX VERSION] - 19 Nov 14 ---------------------------- Fixed: Multiple item drag/drop was not working as the result of previous change. [NEW VERSION] - 13 Oct 14 ------------------------- Added: You can now decide whether to delete or retain the items dragged to another ListView. So that the user can prevent items being dragged back into the ListView if they were not deleted and so creating multiple entries, this change has also forced the change in behaviour below. Changed: The ability to prevent external drag and drop operations has now been split into separate drag/drop parameters. This is script-breaking if you had previously blocked ListViews from external drag/drop operations - but as it only involves adding another value to the $iAdded parameter it is not difficult to fix. [NEW VERSION] - 9 Oct 14 ------------------------ Added: The UDF now reads the current delimiter/separator character and uses that in place of using a default "|". If you do not change the default character then you need do nothing - but if you do change the character then you must do so using Opt("GUIDataSeparatorChar", ) before you include the UDF file so that it is correctly set. [BUGFIX VERSION] - 2 Oct 14 --------------------------- Fixed: A second bug introduced by the last update - the lesson is not to code when you have influenza! [BUGFIX VERSION] - 30 Sep 14 ---------------------------- Fixed: A nasty little bug introduced by the last update [BUGFIX VERSION] - 29 Sep 14 ---------------------------- Fixed: When using a combo for editing an item the control was not correctly deleted when the edit was interrupted by clicking elsewhere. Added: The combo edit now scrolls to allow longer strings to be manually inserted. [NEW VERSION] - 22 Sep 14 ------------------------- Changed: - 1. New parameter in GUIListViewEx_Insert. If adding a 1D array this will determine if the elements to be added as columns (default) or rows. Also added ability to insert 2D arrays. Main advantage is in execution speed as ListView is not rewritten after each row is inserted. Note: If you use the $fRetainWidth parameter in the function this change is script-breaking as that parameter is now 3rd and not 2nd. - 2. GUIListViewEx_Delete will now accept a "range" parameter to programmatically delete ListView rows - if no parameter is passed then the selected rows are deleted as before [NEW VERSION] - 16 Jul 14 ------------------------- Changed: User input is no longer limited to the size of the input - it now scrolls. [NEW VERSION] - 20 May 14 ------------------------- Added: - 1. Native-created ListViews will expand their columns to fit the inserted text - see example scripts here. There is now an additional parameter to the _GUIListViewEx_Insert function which can be set to restore the original width if required. - 2. There is a new flag for the $iAdded parameter in _GUIListViewEx_Init to prevent external drag/drop to/from other initialised ListViews. The default is for all initialised ListViews to be able to drag/drop with all others - setting this flag makes it impossible to change the content of a ListView via drag/drop, although internal dragging is still possible. [BUGFIX VERSION] - 4 Jan 14 --------------------------- Fixed: If you were editing an item and clicked outside the GUI the UDF crashed. Thanks to dickjones007 for finding the problem [BUGFIX VERSION] - 11 Dec 13 ---------------------------- Fixed: If you dragged items between ListViews and dropped them on blank space the transfer could fail. Thanks to OldCodger for finding the problem. [NEW VERSION] - 10 Jun 13 ------------------------- Added: Elements can now be edited using combo or input controls - add + 32 to the $iAdded parameter of _GUIListViewEx_Init to use combos. The combo data is set and can be reset at any time using a new function _GUIListViewEx_ComboData - the user can use this function to determine if the combo is read-only or not. Each column requires its own data set, although all columns can be set to the same data if they all require it. [BUGFIX VERSION] - 14 Jun 13 ---------------------------- Fixed: An array was being ReDimed to the wrong size causing a crash after using _GUIListViewEx_Close. Sorry about that. [NEW VERSION] - 10 Jun 13 ------------------------- Changed: Until now you could not use the left/right cursor keys when editing - they would either move to the adjacent item or end the edit process depending on the EditMode setting. But now you can choode when initialising the ListView whether the cursor can be used within the edit. Add + 16 to the $iAdded parameter of _GUIListViewEx_Init and the cursor within the edit becomes active - you must use Ctrl-Left/Right to move to (the adjacent item or end the edit process. This change is NOT script-breaking - the default action is unchanged from previous releases. Thanks to dragan who asked for this small change. [BUGFIX VERSION] - 28 May 13 ---------------------------- Fixed: ListViewItems were not being deleted from native-created ListViews during UDF actions which could have meant hitting the 62k control limit if the ListViews held large numbers of items and were often manipulated. Sorry about that. Thanks to JeromeB whose question led me to discover the problem. [NEW VERSION] - 23 May 13 ------------------------- Added: You can now edit the text in the headers of an initialised ListView. This can be done programatically by using the new _GUIListViewEx_EditHeader function (which will act on any header) or by clicking the header of an editable column while holding the Ctrl key. ListView headers do not respond to double-clicks so I chose Ctrl-Click as an action event, which has the advantage of not sorting the column when clicked if that option was selected. ;) Thanks to incepator for the push to do this. [NEW VERSION] - 30 Apr 13 ------------------------- Added: You can now drag items bewteen ListViews as long as they have the same number of columns and neither have checkboxes. Thanks to mesale0077 for suggesting it and GreenCan for all the testing. Changed: Much of the internal UDF code has been rewritten as a result of the above. Warning: There were major script-breaking changes in the release of 19 Apr 13 from previous versions of the UDF!!! Please read the change list for that release in the spoiler below if you have not already done so. [BUGFIX VERSION] - 22 Apr 13 ---------------------------- Changed: _GUIListViewEx_ReadToArray returned an incorrect count when reading the content of exisiting ListViews. Sorry about that. Warning: Major script-breaking changes in the major release of 19 Apr 13 from previous versions of the UDF!!! Please read the change list for that release in the spoiler below. [NEW VERSION] - 19 Apr 13 ------------------------- Warning: Major script-breaking changes to previous release versions of the UDF!!! New: - The _GUIListViewEx_EditItem function allows for programatic selection of an item to be edited. The item does not have to be in one of the columns editable on double-clicking (see below). - When using the _GUIListViewEx_EditItem function or after a double-click on an editable item, the user can choose to limit the edit to that single item/subitem (default) or for the {TAB} and cursor arrow keys to move the edit location around the ListView, scrolling the items into view if necessary. In the latter case, the user can choose: - The action to take when the edit location reaches the edge of the ListView - terminate the edit process, remain at that point, or loop to the opposite edge of the ListView. The action to take can be set independently for each axis of movement. - The action taken when {ESC} is pressed - either abandon just the current edit leaving previous edits in place or reset all edits made in the current editing session. - The GUIListViewEx_ReadToArray function reads the current content of a ListView into an array which can then be used as a parameter in the GUIListViewEx_Init function. Changed: - The _GUIListViewEx_Init function has several changes: - The function now takes an additional parameter to define the columns which are editable - the default setting is "all columns". The zero-based column numbers can be entered singly or as ranges e.g. "0;2;4-6;8-10;12". All ListView rows are permanently editable. - The order of the $fImage and $iAdded parameters in the _GUIListViewEx_Init function has changed to keep the various parameters arranged in logical groups (dragging - sorting & editing). - The $iAdded parameter has an additional option - if the ListView is editable then this option enables you to move the edit control within the same ListView by triple-clicking (a single-click to close the current edit and then a double-click to relocate it). It is always possible to swap the edit process to another ListView by double-clicking within it. - The function to register various Windows messages has been renamed to _GUIListViewEx_MsgRegister as its previous name (_DragRegister) suggested it was only required to activate item dragging. In fact the WM_NOTIFY message needs to be registered for sorting and editing as well as dragging - the other other messages need only be registered if dragging is required. - The function placed in the idle loop to action the edit process on a double-click has been renamed to _GUIListViewEx_EditOnClick and has lost the parameter to set the editable columns - but gained a parameter which determines the edit process and {ESC} key behaviour (see the explanation above). - The _GUIListViewEx_ReturnArray function has lost an underscore from its name to match the format of the other function names. - Several new "Internal Use Only" functions have been added and many minor code changes have been made throughout the UDF. Sorry about the scriptbreaking changes - I hope you feel that the added functionality to the UDF is worth the trouble of changing your scripts. Thanks to Dana for the prods to get me to do most of what he wanted. [NEW VERSION] - 14 Mar 13 ------------------------- New: Items and subitems can now be edited directly within the ListView. The $fSort parameter has been replaced by $iAdded: 0 = No sort or edit 1 = Sort, no edit 2 = Edit, no sort 3 = Both edit and sort To get the editing to work the new _GUIListViewEx_Edit function must be placed in the script idle loop and the _GUIListViewEx_WM_NOTIFY_Handler function either registered or placed in an existing handler. Editing is initiated by double-clicking an item - the user can define which columns are editable via the parameter of the _GUIListViewEx_Edit function. Any use of the mouse or actioning of any other controls on the GUI abandons the editing process - normally editing is actioned by ENTER key or cancelled by ESCAPE. This change is not script-breaking as the True/False value of $fSort is mirrored by the 0/1 values of $iAdded. Thanks to johnmcloud for the idea. Added: Just as with dragging, the _GUIListViewEx_Up/Down functions now work on multiple selections. Again thanks to johnmcloud for the push to get it working. [BUGFIX VERSION] - 23 Feb 13 ---------------------------- Fixed: Error adding a delimited string to an originally empty multiple column ListView created with the native function. Thanks to Garp99HasSpoken for pointing it out. [NEW VERSION] - 26 Aug 11 ------------------------- New: Now works with ListViews with checkboxes. Added a parameter to _GUIListViewEx_Return_Array to return either the text or the checkbox state of the ListView. Default is to return the text as at present, so this is not script-breaking. Fixed: Now works correctly with native ListViews with null values in the columns. Thanks to NunoBorges for the prods to get it working as he wanted! [BUGFIX RELEASE] - 13 Jun 11 ---------------------------- Fixed: Sort only worked in ascending order (thanks AutoitNewbie2011) - full explanation [post=901285]here[/post] [EX TYPO FIX RELEASE] - 25 May 11 --------------------------------- Fixed: A couple of typos in the examples (thanks Protocoder). It seems I did not update all of them after the last update. [NEW VERSION] - 5 Feb 11 ------------------------ Improvements: New parameter for _GUIListViewEx_Init to allow simple sorting of ListView on clicking the column header BugFix: Added a missing line to one of the message handlers. Thanks WeMartiansAreFriendly. [NEW VERSION] - 3 Feb 11 ------------------------ Improvements: - Now x64 compatible (thanks Ascend4nt) - Now drags blocks of selected items and deletes all selected items (you can thank czardas for that as he asked for it)