Know_Fear Posted June 22, 2018 Share Posted June 22, 2018 (edited) So, I have this nicely working script that operates on a ListView - cut / past / copy / delete all work fine. List View is created with: $LV_List = GUICtrlCreateListView("", 5, 45, 602, 400, BitOR($LVS_SHOWSELALWAYS, $LVS_REPORT)) _GUICtrlListView_SetExtendedListViewStyle($LV_List, BitOR($LVS_EX_GRIDLINES, $LVS_EX_DOUBLEBUFFER)) ;;;;;;;;;;;;; , $LVS_EX_FULLROWSELECT)) My ListView has 3 columns, the first is a narrow column in which I put the row number, and the other 2 columns contain the data I want to look at and act upon. This all works, and I can select and act upon single or multiple rows. But here's the ISSUE ===> When I use the normal Click-Hold-Drag mouse-rectangle to select the rows I want, ONLY the selected items in Column 1 are "sensitive" to the mouse-rectangle, and only they turn the Selected-Blue-Color. (However, everything works as I intend, and my cut / copy / delete stuff acts upon all of the rows that I have selected.) What I WOULD LIKE ===> To have either all items in the rows, or perhaps just the items in Column 2 (instead of the default Column 1) sensitive to the normal Click-Hold-Drag mouse-rectangle and to turn Selected-Blue-Color. This would look and feel more "normal", much like how one selects items in MSWindows' "Detailed" file view windows. (As you can see above, I tried using $LVS_EX_FULLROWSELECT. As advertised, the entire row turns the Selected-Blue-Color. The PROBLEM with this is that there is nowhere to start drawing the Mouse Rectangle from. As soon as one clicks in order to start drawing the rectangle, then ONLY that single row is selected, and no rectangle is drawn. When using $LVS_EX_FULLROWSELECT, it seems that multiple rows can ONLY be selected by using the keyboard in conjunction with the mouse ... ) This isn't a HUGE issue, since the user gets used to using the mouse to select rows based on drawing the rectangle around the item count numbers in Column 1. But it would be more uniform with most other behaviors that use the mouse to select multiple items if I were able to get a ListView to behave as described above. - Thanks! Edited June 22, 2018 by Know_Fear Link to comment Share on other sites More sharing options...
Know_Fear Posted June 22, 2018 Author Share Posted June 22, 2018 uhg... I edited the above, as I had written "rows" instead of "columns".... Hope my question makes more sense now. Link to comment Share on other sites More sharing options...
Know_Fear Posted June 28, 2018 Author Share Posted June 28, 2018 (edited) To illustrate the issue - With this extended style... $My_List = GUICtrlCreateListView("", 5, 45, 602, $Media_Window_Height-50, BitOR($LVS_SHOWSELALWAYS, $LVS_REPORT)) _GUICtrlListView_SetExtendedListViewStyle($My_List, ($LVS_EX_GRIDLINES)) ;_GUICtrlListView_SetExtendedListViewStyle($My_List, BITOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT)) ....here is screenshot of what I get when using the mouse to draw the normal select-rectangle - note that only column 1 (items 5 through 11) change color - And with FullRowSelect extended style..... $My_List = GUICtrlCreateListView("", 5, 45, 602, $Media_Window_Height-50, BitOR($LVS_SHOWSELALWAYS, $LVS_REPORT)) ;_GUICtrlListView_SetExtendedListViewStyle($My_List, ($LVS_EX_GRIDLINES)) _GUICtrlListView_SetExtendedListViewStyle($My_List, BITOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT)) ....here is screenshot of what I get - note that there is NO way to draw a select-rectangle since as soon as one clicks, then one-and-only-one row (row 8 Fountainhead) is selected (multiple items can only be selected using the keyboard and some mouse clicks ) - As said above, everything works functionaly.........., but I would like to be able to use the mouse select-rectangle more intuitively and have it select the Titles in column 2 instead of the Item Numbers in column 1.... Edited June 28, 2018 by Know_Fear Link to comment Share on other sites More sharing options...
AutoBert Posted June 28, 2018 Share Posted June 28, 2018 Can you select multiple filles in explorer only with mouse? Link to comment Share on other sites More sharing options...
Know_Fear Posted June 29, 2018 Author Share Posted June 29, 2018 (edited) Not sure what yo mean AB - do you mean Windows Explorer? If so, then yes! That is the behavior I am wanting to duplicate for my ListView above - it looks like this (Win7 Windows Explorer...) - Edited June 29, 2018 by Know_Fear Link to comment Share on other sites More sharing options...
Know_Fear Posted July 14, 2018 Author Share Posted July 14, 2018 Anyone? Link to comment Share on other sites More sharing options...
careca Posted July 15, 2018 Share Posted July 15, 2018 (edited) expandcollapse popup#include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> #include <ListViewConstants.au3> Example() Func Example() GUICreate("listview items", 220, 250, 100, 200, -1, $WS_EX_ACCEPTFILES) GUISetBkColor(0x00E0FFFF) ; will change background color Local $idListview = GUICtrlCreateListView("col1 |col2|col3 ", 10, 10, 200, 150,BitOR($LVS_SHOWSELALWAYS, $LVS_REPORT)) Local $idButton = GUICtrlCreateButton("Value?", 75, 170, 70, 20) Local $idItem1 = GUICtrlCreateListViewItem("item2|col22|col23", $idListview) Local $idItem2 = GUICtrlCreateListViewItem("item1|col12|col13", $idListview) Local $idItem3 = GUICtrlCreateListViewItem("item3|col32|col33", $idListview) Local $idItem3 = GUICtrlCreateListViewItem("item23|col632|col3433", $idListview) Local $idItem3 = GUICtrlCreateListViewItem("items3|col332|col7533", $idListview) GUICtrlCreateInput("", 20, 200, 150) GUICtrlSetState(-1, $GUI_DROPACCEPTED) ; to allow drag and dropping GUISetState(@SW_SHOW) GUICtrlSetData($idItem2, "ITEM1") GUICtrlSetData($idItem3, "||COL33") GUICtrlDelete($idItem1) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idButton MsgBox($MB_SYSTEMMODAL, "listview item", GUICtrlRead(GUICtrlRead($idListview)), 2) Case $idListview MsgBox($MB_SYSTEMMODAL, "listview", "clicked=" & GUICtrlGetState($idListview), 2) EndSwitch WEnd EndFunc ;==>Example Straight from the help file example with just 1 modification. Edited July 15, 2018 by careca FrancescoDiMuro 1 Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
Know_Fear Posted July 15, 2018 Author Share Posted July 15, 2018 (edited) ??? Not sure what Question you are addressing careca, but it's not mine Or ?? perhaps there is some difference in the version you are running?? (I am running the most recent autoit version...) In any case, the posted example directly above also displays the issue I am trying to get around - i.e., one can NOT use the mouse-click-drag rectangle to select multiple items in the list (unless one starts the click-drag-rectangle in the white space below the last list row -- which is obviously NOT a solution for lists that are longer than the display area). As stated above, I'd like my list-view to behave as standard Windows file select windows - where one starts the mouse-click-drag-rectangle off to the side white space (between the vertical slider bar and the file list), and one can select any number of contiguous items in the file list. Ideas? Edited July 15, 2018 by Know_Fear Link to comment Share on other sites More sharing options...
careca Posted July 16, 2018 Share Posted July 16, 2018 (edited) exactly, did you try the code i posted? Im also in last version and in win 10. I see that you tried the code and got the same result.. dunno why Edited July 16, 2018 by careca I read your post again Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted July 16, 2018 Share Posted July 16, 2018 @Know_Fear I just tried the code that @careca posted ( nice job buddy! ), and it has the mouse "drag select" items ( every column, not just the columns in your mouse drag ). Is this what you were trying to do? Best Regards. Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Know_Fear Posted July 16, 2018 Author Share Posted July 16, 2018 (edited) Where are y'all starting the "drag select" rectangle in the posted example? In the list itself??? .... Or in the white space below??? Try starting the rectangle IN the list (or generate a longer list that is larger than the display window). Are you still able to use mouse "drag select" to select more than 1 item? As said, if we have a full list that is larger than the window, then there is no white space to start the rectangle in. And only the single item gets selected This is on my Windows 7 and XP machines... Edited July 16, 2018 by Know_Fear Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted July 16, 2018 Share Posted July 16, 2018 2 minutes ago, Know_Fear said: In the list itself??? Right here! Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
careca Posted July 17, 2018 Share Posted July 17, 2018 Either in or off the list, it's the same. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
Know_Fear Posted July 17, 2018 Author Share Posted July 17, 2018 (edited) Thanks careca - I very much appreciate the replies. I need to figure out what problem I am trying to solve, either an autoit behavior, or a quirk in my win7 and xp systems.........On the code posted below, Is anyone else out there seeing the same behavior as ether careca (can "drag select" MULTIPLE lines anywhere in a listview)........ or the behavior I see (can only select 1 item with the mouse) ??? expandcollapse popup#include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> #include <ListViewConstants.au3> Example() Func Example() GUICreate("listview items", 220, 250, 100, 200, -1, $WS_EX_ACCEPTFILES) GUISetBkColor(0x00E0FFFF) ; will change background color Local $idListview = GUICtrlCreateListView("col1 |col2|col3 ", 10, 10, 200, 150,BitOR($LVS_SHOWSELALWAYS, $LVS_REPORT)) Local $idButton = GUICtrlCreateButton("Value?", 75, 170, 70, 20) Local $idItem1 = GUICtrlCreateListViewItem("item2|col22|col23", $idListview) Local $idItem2 = GUICtrlCreateListViewItem("item1|col12|col13", $idListview) Local $idItem3 = GUICtrlCreateListViewItem("item3|col32|col33", $idListview) Local $idItem4 = GUICtrlCreateListViewItem("item23|col632|col3433", $idListview) Local $idItem5 = GUICtrlCreateListViewItem("items3|col332|col7533", $idListview) Local $idItem6 = GUICtrlCreateListViewItem("item2|col22|col23", $idListview) Local $idItem7 = GUICtrlCreateListViewItem("item1|col12|col13", $idListview) Local $idItem8 = GUICtrlCreateListViewItem("item3|col32|col33", $idListview) Local $idItem9 = GUICtrlCreateListViewItem("item23|col632|col3433", $idListview) Local $idItem10 = GUICtrlCreateListViewItem("items3|col332|col7533", $idListview) GUICtrlCreateInput("", 20, 200, 150) GUICtrlSetState(-1, $GUI_DROPACCEPTED) ; to allow drag and dropping GUISetState(@SW_SHOW) GUICtrlSetData($idItem2, "ITEM1") GUICtrlSetData($idItem3, "||COL33") GUICtrlDelete($idItem1) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idButton MsgBox($MB_SYSTEMMODAL, "listview item", GUICtrlRead(GUICtrlRead($idListview)), 2) Case $idListview MsgBox($MB_SYSTEMMODAL, "listview", "clicked=" & GUICtrlGetState($idListview), 2) EndSwitch WEnd EndFunc ;==>Example Edited July 17, 2018 by Know_Fear Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted July 17, 2018 Share Posted July 17, 2018 @Know_Fear I can select multiple items with mouse drag and drop Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Know_Fear Posted July 17, 2018 Author Share Posted July 17, 2018 I'm sorry Franscesco - I can't tell what it is you're trying to say. Can you help me out with a more straightforward answer regarding selection of multiple items with mouse "drag-select" in a full listview? Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted July 17, 2018 Share Posted July 17, 2018 Is this what are you trying to do? Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Know_Fear Posted July 17, 2018 Author Share Posted July 17, 2018 Well no.... That's the effect I want, and sorry if I am not being exactly clear, but you are starting your rectangle in the white space to the right of col 3. My listview in posts 3 and 4 above are too wide to have whitespace on the right, and too long to have whitepace on the bottom. As said, there is NO place to start one's "drag-select" rectangle.... Try this one, and tell me if you can select more than 1 line with mouse "drag-select": expandcollapse popup#include <GUIConstantsEx.au3> ;#include <MsgBoxConstants.au3> #include <WindowsConstants.au3> #include <ListViewConstants.au3> Example() Func Example() GUICreate("listview items", 220, 250, 100, 200, -1, $WS_EX_ACCEPTFILES) GUISetBkColor(0x00E0FFFF) ; will change background color Local $idListview = GUICtrlCreateListView("col1|col2|col3|col4|co5|col6|col7", 10, 10, 200, 150,BitOR($LVS_SHOWSELALWAYS, $LVS_REPORT)) Local $idButton = GUICtrlCreateButton("Value?", 75, 170, 70, 20) Local $idItem1 = GUICtrlCreateListViewItem("item2|col22|col23|col22|col23|col22|col23", $idListview) Local $idItem2 = GUICtrlCreateListViewItem("item1|col12|col13|col22|col23|col22|col23", $idListview) Local $idItem3 = GUICtrlCreateListViewItem("item3|col32|col33|col22|col23|col22|col23", $idListview) Local $idItem4 = GUICtrlCreateListViewItem("item23|col632|col3433|col22|col23|col22|col23", $idListview) Local $idItem5 = GUICtrlCreateListViewItem("items3|col332|col7533|col22|col23|col22|col23", $idListview) Local $idItem6 = GUICtrlCreateListViewItem("item2|col22|col23|col22|col23|col22|col23", $idListview) Local $idItem7 = GUICtrlCreateListViewItem("item1|col12|col13|col22|col23|col22|col23", $idListview) Local $idItem8 = GUICtrlCreateListViewItem("item3|col32|col33|col22|col23|col22|col23", $idListview) Local $idItem9 = GUICtrlCreateListViewItem("item23|col632|col3433|col22|col23|col22|col23", $idListview) Local $idItem10 = GUICtrlCreateListViewItem("items3|col332|col7533|col22|col23|col22|col23", $idListview) GUICtrlCreateInput("", 20, 200, 150) GUICtrlSetState(-1, $GUI_DROPACCEPTED) ; to allow drag and dropping GUISetState(@SW_SHOW) GUICtrlSetData($idItem2, "ITEM1") GUICtrlSetData($idItem3, "||COL33") GUICtrlDelete($idItem1) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idButton MsgBox($MB_SYSTEMMODAL, "listview item", GUICtrlRead(GUICtrlRead($idListview)), 2) Case $idListview MsgBox($MB_SYSTEMMODAL, "listview", "clicked=" & GUICtrlGetState($idListview), 2) EndSwitch WEnd EndFunc ;==>Example Link to comment Share on other sites More sharing options...
LarsJ Posted July 17, 2018 Share Posted July 17, 2018 Know_Fear, It's a Windows 8 or 10 feature that does not work on previous Windows versions. It does not work on your Windows 7 or XP PCs. I see exactly the same behaviour on my Windows 7 PC as you do. Earthshine 1 Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
careca Posted July 17, 2018 Share Posted July 17, 2018 @Know_Fear: Either with the code you posted, or the one i posted, the only way i can drag-select multiple rows, is if i start from the bottom of the list, or the side if possible, in the part that doesn't have any item, anywhere else, it tries to drag the item itself. I could swear it worked in items themselves before.. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now