
PowerJack
Members-
Posts
9 -
Joined
-
Last visited
Everything posted by PowerJack
-
@Melba23, works like a charm. Thank your for your help. I might come back as my current Au3 project grows. Btw, have you ever thought about a _GUICtrlListView_FindText() equivalent in Ex that can return row as well as column, similar to _GUIListViewEx_GetLastSelItem()? I have done this as a user function but it is certainly not so elegant like your stuff.
-
Thank you for the update @Melba23. The -1 in the _SelectItem function is really helpful. Now to your challenge ("Try to break it!")... 😉 Top 1: _GUIListViewEx_GetLastSelItem() This function is totally ignorant regarding your latest changes. You can verify this by running my new example below, press the move button several times and have a look at the status line at the bottom. If you click into the cell directly then the function _GetLastSelItem() delivers the right result. Top 2: Still getting multiple selections in some cases This is a strange one and I think it has something to do with my "Reload" scenario. Please try to reproduce it by... Run my example (cell A1 is selected). Click into the C3 cell and then press the Reload button. Sometimes it happens at the first time, sometime I have to click C3+Reload several times The problem is that at one point in time I end up having A1 and C3 selected. #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include "GUIListViewEx_Mod.au3" ; Create GUI Local $hGUI = GUICreate("My Example", 340, 190) ; Create LV Local $sLV = "A|B|C" Local $cLV = _GUICtrlListView_Create($hGUI, $sLV, 8, 8, 320, 100, BitOR($LVS_REPORT, $LVS_SINGLESEL)) _GUICtrlListView_SetExtendedListViewStyle($cLV, $LVS_EX_FULLROWSELECT) _GUICtrlListView_SetColumnWidth($cLV, 0, 100) _GUICtrlListView_SetColumnWidth($cLV, 1, 100) _GUICtrlListView_SetColumnWidth($cLV, 2, 100) ; Create Buttons Local $idButMove = GUICtrlCreateButton("Move", 30, 115, 80, 40) Local $idButClear = GUICtrlCreateButton("Clear", 120, 115, 80, 40) Local $idButReload = GUICtrlCreateButton("Reload", 210, 115, 80, 40) Local $idLabel = GUICtrlCreateLabel("Selection: ", 8, 165, 180, 20) ; Fill LV Local $aLV[3][3] = [["A1","B1","C1"],["A2","B2","C2"],["A3","B3","C3"]] _GUICtrlListView_AddArray($cLV, $aLV) _GUIListViewEx_Init($cLV, $aLV, 0, 0, False, 64+128+256+512+1024) ; + 64 - No external drag ; + 128 - No external drop ; + 256 - No delete on external drag/drop ; + 512 - No internal drag/drop ; + 1024 - Single cell highlight (forces single row selection) _GUIListViewEx_MsgRegister() ; Register GUIListViewEx GUISetState(@SW_SHOW, $hGUI) ; Select first cell Local $iRow=0, $iCol=0 _GUIListViewEx_SelectItem($iRow, $iCol) ;=== Gui loop While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idButMove ; select next cell $iCol = Mod($iCol+1,3) If $iCol=0 Then $iRow = Mod($iRow+1,3) _GUIListViewEx_SelectItem($iRow, $iCol) ; Select cell Case $idButClear _GUIListViewEx_SelectItem(-1) ; Unselect all cells $iRow = 0 $iCol = 0 Case $idButReload ; reload LV _GUICtrlListView_DeleteAllItems($cLV) _GUIListViewEx_Close() _GUICtrlListView_AddArray($cLV, $aLV) _GUIListViewEx_Init($cLV, $aLV, 0, 0, False, 64+128+256+512+1024) $iRow = 0 $iCol = 0 _GUIListViewEx_SelectItem($iRow, $iCol) ; Select first cell EndSwitch ; GUIGetMsg GUICtrlSetData($idLabel, "Selected: " & _GUIListViewEx_GetLastSelItem()) ; ==> Delimited string ListViewIndex|Row|Col ;$vRet = _GUIListViewEx_EventMonitor() WEnd ; Gui loop GUIDelete($hGUI) Exit
-
@Melba23, Problem of unwanted multiple selections solved. Thank your for your fast response and fix. I am still looking for a proper solution to remove any selection in the ListView (the idea of the "Clear" command in my example). My not very elegant solution would be to remove the complete ListView and create it new.
-
In my latest project I thought I needed your "GUIListViewEx.au3" because of the single cell selection capability (not complete row). It started out quite nice, but then I struggled with what you call “Programmatically select row - and item if single selection available” (Func _GUIListViewEx_SelectItem). I boiled my problem down to the example code below. What I want to have is a ListView that has always only one cell selected. It works fine when I just click into the ListView cells. But when I try to select the cell via Func _GUIListViewEx_SelectItem() then I end up with multiple cells selected. I had a brief look into your Func _GUIListViewEx_SelectItem() and, without understanding all of it, I suspect that the instruction _GUICtrlListView_SetItemSelected($hLVHandle, -1, False) doesn’t do what it is supposed to do in single cell selection mode. Any ideas from this forum how I could possible sail around this problem would be highly welcome. #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include "GUIListViewEx.au3" #include <Array.au3> ; Just for display in example ; Create GUI Local $hGUI = GUICreate("My Example", 340, 160) ; Create LV Local $sLV = "A|B|C" Local $cLV = _GUICtrlListView_Create($hGUI, $sLV, 8, 8, 320, 100, BitOR($LVS_REPORT, $LVS_SINGLESEL)) _GUICtrlListView_SetExtendedListViewStyle($cLV, $LVS_EX_FULLROWSELECT) _GUICtrlListView_SetColumnWidth($cLV, 0, 100) _GUICtrlListView_SetColumnWidth($cLV, 1, 100) _GUICtrlListView_SetColumnWidth($cLV, 2, 100) ; Create Button Local $idButton = GUICtrlCreateButton("A1", 130, 115, 80, 40) ; Fill LV Local $aLV[3][3] = [["A1","B1","C1"],["A2","B2","C2"],["A3","B3","C3"]] _GUICtrlListView_AddArray($cLV, $aLV) _GUIListViewEx_Init($cLV, $aLV, 0, 0, False, 64+128+256+512+1024) ; + 64 - No external drag ; + 128 - No external drop ; + 256 - No delete on external drag/drop ; + 512 - No internal drag/drop ; + 1024 - Single cell highlight (forces single row selection) _GUIListViewEx_MsgRegister() ; Register GUIListViewEx GUISetState(@SW_SHOW, $hGUI) ;=== Gui loop While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idButton Switch GUICtrlRead($idButton) Case "A1" _GUIListViewEx_SelectItem(0, 0) ; Select cell "A1" GUICtrlSetData($idButton, "C3") ; next command Case "C3" ; Unfortunately, this selects cell "C3" ADDITIONALLY to "A1" ; Because of a bug in Func _GUIListViewEx_SelectItem() ??? _GUIListViewEx_SelectItem(2, 2) ; Select cell "C3" GUICtrlSetData($idButton, "Clear") ; next command Case "Clear" ; Remove all current highlighting ; This is an instruction out of Func _GUIListViewEx_SelectItem() ; According to AutoIt Help it wont work: ; "If the listview is using the control style $LVS_SINGLESEL, ; setting $iIndex to -1 will not select all of the items." _GUICtrlListView_SetItemSelected($cLV, -1, False) GUICtrlSetData($idButton, "Exit") ; next command Case "Exit" ExitLoop EndSwitch ; button EndSwitch ; GUIGetMsg ;$vRet = _GUIListViewEx_EventMonitor() WEnd ; Gui loop ; Exit GUIDelete($hGUI) Exit
-
Virtual Desktop Manager under Windows 10
PowerJack replied to Nine's topic in AutoIt Example Scripts
Thank you @Nine. My Windows doesn’t support it either. My idea was to catch a VDT switch done by the user and then set a new wallpaper (for all DT). But the more I think about It the more it feels like overkill. I think your code example comes in handy as soon as Microsoft have done their homework on my PC or when I upgrade to Win11. -
Virtual Desktop Manager under Windows 10
PowerJack replied to Nine's topic in AutoIt Example Scripts
Up to now I am not really using Virtual Desktops, but this library made me think about it. I tried a wallpaper changer found in this forum to set individual desktops, but the new wallpaper is set for all VDT, just as if I do it via Windows desktop settings. So a static approach does not seem to work. I wonder if a dynamic approach would work. Could I use this library to react on a VDT switch (Ctrl+Win+Arrow) and set the wallpaper individually for the new VDT? -
Start MS Edge in new window with own icon?
PowerJack replied to PowerJack's topic in AutoIt General Help and Support
SOLVED. (Silly me!) Finally I found out that MS Edge has already exactly the functionality I described in my first post. No workarounds with .lnk files, user profiles or even AutoIt programming necessary. Functionality is called "Turn a Website Into an App" and is available directly unter the Edge "..." icon as "Apps". A really nice functionality for devices with own web pages. And most of us have several of them: DSL/Wifi router, network printer, NAS stations, ... -
Start MS Edge in new window with own icon?
PowerJack replied to PowerJack's topic in AutoIt General Help and Support
Thank you Subz for the guidance. Edge opens in a different window the moment you launch it with a different profile in the command line parameters. 😀 -
After quite some search I guess I need to ask the Windows gurus among you for a short guidance. As more and more Devices (printers, etc.) come with their own web interface I find it quite cumbersome to have this web interface as one tab among many in my Edge browser. First improvement I was already successful to find a way to start a web interface (URL) in a new Edge window. When I move my mouse pointer to the Edge icon in my task bar I can click on that new window. That already provides a faster navigation compared to finding the right tab in the main Edge window. My question The ideal situation for me would be to have this window as a separate icon in my task bar, so that it looks like a separate application. There is certainly a way to set the icon of an application with AutoIt. But currently I think that this might not be feasible because it is still one and the same msedge.exe program?