Jump to content

GUIListViewEx - New Version 21 May 22


Recommended Posts

Hi guys, :lmao:

2 Question for the boss:

Is it possible to make a different context menu for each row ? Or is the solution to create it, at each right click, for each row index ?

Same question for a column configured with a combo (by _GUIListViewEx_SetEditStatus). Is there a way to do this for each row or may i intercept doublclick and modify my combo data) :blink:

thanks for the advice/method.

Nicolas.

Link to post
Share on other sites
  • Replies 645
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

[NEW VERSION] - 21 May 22 Fixed: TheĀ _SelectItem function was not correctly clearing earlier selections when SingleSel style was used. And the selection made using the function was not reflected

Hi jimmy123j, I had the same issue with the dotted rectangle when the item is focused. @LarsJ provided a solution that worked fine for me and it seems to solve your problem too. 1) Running your

I've tested the header color example as 64 bit code on both Windows 7 and Windows 10. In both cases, it fails. There are no colors in the header. Then I've made a much smaller example that only c

Posted Images

  • Moderators

satanico64,

I have no idea about the context menus - each row of a ListView is a separate control so you should be able to do it but nothing in this UDF can help you do it.

The combo content is set forĀ a specificĀ column when defining the edit mode - there is no easy way I can see to allow for different contents for different rows. And given that the usual function of a ListView is to tabulate similar elements in eachĀ columnĀ I wonder why you even see the need for such a functionality?

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.pngĀ AnyĀ of myĀ own codeĀ posted anywhere on the forumĀ isĀ available for use by others without any restrictionĀ of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSortĀ ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- AĀ highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort,Ā edit and colourĀ ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

Ā 

Link to post
Share on other sites

thanks for your answer,Ā  so i'm going to dismember again your code :) to make this.

Ā 

my list manage materials from stock, from clients to stock and stock to clients, and materials remplacement. My combo indicate 'from client to stock' and "from stock to client" ( i'm simplifying)

It's populate from materials which is at the client site. I juste want to be impossible to select 'from stock to client' on an item which is at the client site.

something like that. :blink:

it make sense believe me :P (not sure i'm really clear)

thanks for your quickĀ  answer.

Nicolas.

Link to post
Share on other sites
  • Moderators

satanico64,

Quote

I juste want to be impossible to select 'from stock to client' on an item which is at the client site

I would suggest using the array returned by the _EventMonitor function after a successfulĀ edit to check if the selection was valid for that particular rowĀ - and if not use the _GUIListViewEx_ChangeItem function to reset the original value (also foundĀ in the returned array) and pop up a MsgBox to warn the user. That is why I added the ability to check the edited values to the UDF.

Let me know if a quick example would help understand how to do it.

M23

Ā 

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.pngĀ AnyĀ of myĀ own codeĀ posted anywhere on the forumĀ isĀ available for use by others without any restrictionĀ of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSortĀ ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- AĀ highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort,Ā edit and colourĀ ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

Ā 

Link to post
Share on other sites

i understand what you mean.

I thought it was better to block the possibility before, than check it just after.

So it certainly will be easier in your way.

Let's ask my lazy-meter.....Ā  ok i'll do your way... :)

Ā 

i'll try by myself before asking your example, thanks Melba :)

More than 27k posts ? are you a bot man ?Ā Ā  Have you passed the turing test ? :lmao:

Ā 

Link to post
Share on other sites
  • 1 month later...

Hello melba and guys, Someone can help me understand how to do it:

1. I want to know how to order the icon column correctly,I just ordered the columns with the text but the column with the icons do not coincide correctly.

2. How can I use this function to launch sorting when I click on the listview header

My code here, and filesĀ https://ufile.io/03x69 THX

Ā 

#include <ButtonConstants.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <GuiListView.au3>
#include <GDIPlus.au3>
#include <Array.au3>
#include <GuiImageList.au3>
#include <StaticConstants.au3>
#include <IE.au3>
#include <Misc.au3>
#include <EditConstants.au3>
#include <ListBoxConstants.au3>
#include <GuiListBox.au3>
#include <File.au3>
#include <FileConstants.au3>
#include <WinAPI.au3>
#include <WinAPITheme.au3>
#include <Color.au3>
#include <ColorConstants.au3>
#include <WinAPIConstants.au3>
#include "GUIListViewEx.au3"

#Region ### START Koda GUI section ### Form=

Global $IEControl,$tini = @ScriptDir&"\test.ini"
Global $ListView

$Form1 = GUICreate("Form1", 800, 600, 192, 124)
$ListView = GUICtrlCreateListView("",  10, 10, 780, 580, -1, BitOR($LVS_EX_FULLROWSELECT, 0x00010000))
_GUICtrlListView_SetExtendedListViewStyle($ListView, BitOR($LVS_AUTOARRANGE, $LVS_EX_FULLROWSELECT, $LVS_EX_DOUBLEBUFFER, $LVS_EX_SUBITEMIMAGES))
GUICtrlSetFont($ListView, 8, Default, Default, "Arial")
GUICtrlSetResizing($ListView,1); 102 + 2)
_GUICtrlListView_AddColumn($ListView, "Icon", 70)
_GUICtrlListView_AddColumn($ListView, "Name", 330)
_GUICtrlListView_AddColumn($ListView, "Country", 50)
_GUICtrlListView_AddColumn($ListView, "Path", 320)

_GUIListViewEx_MsgRegister()


read()

GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
GUISetState(@SW_SHOW)


#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        Case $ListView
    EndSwitch
WEnd

   GUIDelete()
Func read()
    Local $tot = 0
    If FileExists($tini) Then
        $hImage2 = _GUIImageList_Create(48, 48, 5, 1)
        _GDIPlus_Startup()

        $aArrays = IniReadSectionNames($tini)



        If Not @error Then
            For $i = 1 To UBound($aArrays) - 1

                $n = IniRead($tini, $aArrays[$i], "name", "")
                $z = IniRead($tini, $aArrays[$i], "ico", "")
                $r = IniRead($tini, $aArrays[$i], "region", "")
                ConsoleWrite($z&@CRLF)
                ;load icon and upscale the icon to 48x48 pixels
                $hBitmap2 = _GDIPlus_BitmapCreateFromFile($z)
                $hBitmap_scaled2 = _GDIPlus_ImageResize($hBitmap2, 48, 48)
                $hBitmap_GDI = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap_scaled2)
                _GDIPlus_BitmapDispose($hBitmap_scaled2)
                $ico = _GUIImageList_Add($hImage2, $hBitmap_GDI)
                _GUICtrlListView_SetImageList($ListView, $hImage2, 1)
                _GUICtrlListView_AddItem($ListView, "", $ico)
                _GUICtrlListView_AddSubItem($ListView, $i - 1, $n, 1)
                _GUICtrlListView_AddSubItem($ListView, $i - 1, $r, 2)
                _GUICtrlListView_AddSubItem($ListView, $i - 1, $aArrays[$i], 3)
                $tot += 1
            Next

                    $aLVArray = _GUIListViewEx_ReadToArray($ListView)

                    $iLV_Index = _GUIListViewEx_Init($ListView, $aLVArray, 0, 0, True, 0)

                    $sort = _GUIListViewEx_SortCol($iLV_Index,1);<-------------------------

                    ConsoleWrite("Satus " & $sort&@CRLF);<-------------------------
            _GDIPlus_Shutdown()
        EndIf
    EndIf
EndFunc   ;==>read


; ========================================================
; This thing is responcible for click events
; ========================================================
Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)

    Local $hWndFrom, $iCode, $tNMHDR, $hWndListView
    $hWndListView = $ListView
    If Not IsHWnd($ListView) Then $hWndListView = GUICtrlGetHandle($ListView)
    $tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
    $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
    $iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
    $iCode = DllStructGetData($tNMHDR, "Code")

    Switch $hWndFrom

        Case $hWndListView
            Switch $iCode

                Case $NM_CLICK
                    Local $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
                    $Index = DllStructGetData($tInfo, "Index")
                    If DllStructGetData($tInfo, "Index") = -1 Then
                        ConsoleWrite("no item" & @CRLF)
                    Else
                        Local $iItemTextCL = _GUICtrlListView_GetItemText($ListView, DllStructGetData($tInfo, "Index"), 1)
                        ConsoleWrite("Click item "&$iItemTextCL&@CRLF)
                    EndIf


                Case $LVN_KEYDOWN

                    $tInfo = DllStructCreate($tagNMLVKEYDOWN, $ilParam)
                    $iKey = DllStructGetData($tInfo, "VKey")
                    ; Get current selection
                    $aLastSel = StringSplit(_GUIListViewEx_GetLastSelectedItem(), "|")
                    Switch $iKey
                        Case 38
                            If _GUIListViewEx_GetLastSelectedItem() <> "" Then
                                ; Move up unless at top
                                $iCurrItem = $aLastSel[2] - 1
                                If $iCurrItem < 0 Then
                                    $iCurrItem = 0
                                EndIf
                                _GUICtrlListView_ClickItem($hWndFrom, $iCurrItem, "top", False, 1, 2)
                                $target = _GUICtrlListView_GetItemText($ListView, $iCurrItem, 1)
                                ConsoleWrite("up item " & $target & @CRLF)
                            Else
                                _GUICtrlListView_ClickItem($hWndFrom, 0, "top", False, 1, 2)
                            EndIf
                        Case 40
                            If _GUIListViewEx_GetLastSelectedItem() <> "" Then
                                ; Move down unless at bottom
                                $iCurrItem = $aLastSel[2] + 1
                                If $iCurrItem >= _GUICtrlListView_GetItemCount($hWndFrom) Then
                                    $iCurrItem = _GUICtrlListView_GetItemCount($hWndFrom) - 1
                                EndIf
                                _GUICtrlListView_ClickItem($hWndFrom, $iCurrItem, "down", False, 1, 2)
                                $targetb = _GUICtrlListView_GetItemText($ListView, $iCurrItem, 1)
                                ConsoleWrite("down item " & $targetb & @CRLF)
                            Else
                                _GUICtrlListView_ClickItem($hWndFrom, 0, "down", False, 1, 2)
                            EndIf
                    EndSwitch

                Case $NM_DBLCLK
                    Local $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
                    $Index = DllStructGetData($tInfo, "Index")
                    If DllStructGetData($tInfo, "Index") = -1 Then
                        ConsoleWrite("no item" & @CRLF)
                    Else
                        Local $iItemText = _GUICtrlListView_GetItemText($ListView, DllStructGetData($tInfo, "Index"), 1)
                        ConsoleWrite("Dbclick item " & $iItemText & @CRLF)
                    EndIf

                Case $NM_RCLICK
                    Local $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
                    $Index = DllStructGetData($tInfo, "Index")
                    If DllStructGetData($tInfo, "Index") = -1 Then
                        ConsoleWrite("no item" & @CRLF)
                    Else
                        Local $iItemTextr = _GUICtrlListView_GetItemText($ListView, DllStructGetData($tInfo, "Index"), 1)
                        ConsoleWrite("Nmclick item " & $iItemTextr & @CRLF)
                    EndIf

            EndSwitch
    EndSwitch
$iRet = _GUIListViewEx_WM_NOTIFY_Handler($hWnd, $iMsg, $iwParam, $ilParam)
    Return $iRet
    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_NOTIFY


Func _GUIListViewEx_GetLastSelectedItem($iLV_Index = 0)
    ; Check valid index
    Switch $iLV_Index
        Case 1 To $aGLVEx_Data[0][0]
    EndSwitch

    ; Read last selected item
    Local $iRow = $aGLVEx_Data[$iLV_Index][20]
    Local $iCol = $aGLVEx_Data[$iLV_Index][21]
    ; Check selection has been made
    If $iRow = -1 Or $iCol = -1 Then Return SetError(2, 0, "")
    ; Return selection details
    Return $iLV_Index & "|" & $iRow & "|" & $iCol

EndFunc   ;==>_GUIListViewEx_GetLastSelectedItem

Ā 

Edited by rootx
Link to post
Share on other sites
  • Moderators

rootx,

As I have explained many times, the UDF does not support sorting ListViews with icons as it only uses the SimpleSort function. The code is already complicated enough, so I have no intention of trying to add this functionality either - sorry.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.pngĀ AnyĀ of myĀ own codeĀ posted anywhere on the forumĀ isĀ available for use by others without any restrictionĀ of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSortĀ ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- AĀ highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort,Ā edit and colourĀ ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

Ā 

Link to post
Share on other sites
  • Moderators

rootx,

I have never tried, so why not do so yourself. Just make sure you do not set the UDF to sort columns as well.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.pngĀ AnyĀ of myĀ own codeĀ posted anywhere on the forumĀ isĀ available for use by others without any restrictionĀ of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSortĀ ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- AĀ highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort,Ā edit and colourĀ ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

Ā 

Link to post
Share on other sites
  • 4 weeks later...

I think I found issue inĀ GLVEx_Example_1.au3
Step to reproduce:

  1. Run
  2. Click and hold on "Tom 6"
  3. Drag "Tom 6" to line beetwen "Tom 0" and "Tom 1"

Symptoms: in many cases / tryies , "Tom 6" is moved beetwen Ā "Tom 1" and "Tom 2"

Regards,
mLipok

Ā 

Ā 

Edited by mLipok

Signature beginning:
*Ā Please remember: "AutoIt".....Ā *Ā Ā Wondering who uses AutoIt and what it can be used for ?Ā *Ā Forum RulesĀ *
*Ā ADO.au3 UDFĀ *Ā POP3.au3 UDFĀ *Ā XML.au3 UDFĀ *Ā IE on Windows 11 *Ā for other useful stuffĀ click the following button:

Spoiler

AnyĀ of myĀ own codeĀ posted anywhere on the forumĀ isĀ available for use by others without any restrictionĀ of any kind.Ā 

My contribution (my own projects):Ā *Ā Debenu Quick PDF Library - UDFĀ *Ā Debenu PDF Viewer SDK - UDFĀ *Ā Acrobat Reader - ActiveX ViewerĀ * UDF for PDFCreator v1.x.xĀ *Ā XZip - UDFĀ *Ā AppCompatFlagsĀ UDFĀ *Ā CrowdinAPIĀ UDFĀ *Ā _WinMergeCompare2Files()Ā *Ā _JavaExceptionAdd()Ā *Ā _IsBeta()Ā *Ā Writing DPI Awareness App - workaroundĀ *Ā _AutoIt_RequiredVersion()Ā * Chilkatsoft.au3 UDFĀ *Ā TeamViewer.au3 UDFĀ *Ā JavaManagement UDFĀ *Ā VIES over SOAPĀ * WinSCP UDFĀ * GHAPI UDF - modest begining - comunication with GitHub REST API *Ā ErrorLog.au3 UDF - A logging LibraryĀ *Ā Include Dependency Tree (Tool for analyzing script relations)Ā *

My contribution to others projects or UDF based on Ā others projects:Ā *Ā _sql.au3 UDFĀ Ā * POP3.au3 UDFĀ * Ā RTF Printer - UDFĀ * XML.au3 UDFĀ * ADO.au3 UDF *Ā SMTP Mailer UDFĀ *Ā Dual Monitor resolution detection * *Ā 2GUI on Dual Monitor System * _SciLexer.au3 UDFĀ *Ā SciTE - Lexer for console pane *Ā 

Useful links:Ā * Forum RulesĀ *Ā Forum etiquetteĀ *Ā  Forum Information and FAQsĀ *Ā How to post code on the forumĀ *Ā AutoIt Online DocumentationĀ *Ā AutoIt Online Beta DocumentationĀ *Ā SciTE4AutoIt3 getting startedĀ *Ā Convert text blocks to AutoIt codeĀ *Ā Games made in AutoitĀ *Ā Programming related sitesĀ *Ā Polish AutoIt TutorialĀ *Ā DllCall Code GeneratorĀ *Ā 

Wiki:Ā *Ā Expand your knowledge - AutoIt WikiĀ *Ā Collection of User Defined FunctionsĀ *Ā How to use HelpFileĀ *Ā Good coding practices in AutoItĀ *Ā 

OpenOffice/LibreOffice/XLS Related:Ā WriterDemo.au3Ā *Ā XLS/MDB from scratch with ADOX

IE Related:Ā Ā *Ā How to use IE.au3 Ā UDF with Ā AutoIt v3.3.14.xĀ *Ā Why isn't Autoit able to click a Javascript Dialog?Ā *Ā Clicking javascript button with no IDĀ *Ā IE document >> save as MHT fileĀ * IETab Switcher (by LarsJ )Ā *Ā HTML Entities * _IEquerySelectorAll() (by uncommon)Ā *Ā IE in TaskScheduler *Ā IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI)Ā *Ā PDFĀ Related: *Ā How to get reference to PDF object embeded in IE * IE on Windows 11 *Ā 

I encourage you to read:Ā * Global VarsĀ * Best Coding PracticesĀ *Ā Please explain code used in Help file for several File functionsĀ *Ā OOP-like approach in AutoItĀ * UDF-Spec QuestionsĀ *Ā  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMDĀ *

I also encourage you to check awesome @trancexxĀ code:Ā  *Ā Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff *Ā OnHungApp handler *Ā Avoid "AutoIt Error" message box in unknown errorsĀ Ā *Ā HTML editor *Ā 

winhttp.au3 related :Ā *Ā https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:Ā Ā :ranting:, beĀ Ā :)Ā and Ā  Ā  Ā  \\//_.

Anticipating ErrorsĀ :Ā Ā "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2022-03-07

Link to post
Share on other sites
  • Moderators

mLipok,

I have just tried multiple drag/drop steps as you describe and I get the row moved to the correct location each time. Are you waiting for the delimiter bar toĀ appear in the requiredĀ placeĀ before releasing the mouse button? I wonder if you are not releasing too soon.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.pngĀ AnyĀ of myĀ own codeĀ posted anywhere on the forumĀ isĀ available for use by others without any restrictionĀ of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSortĀ ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- AĀ highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort,Ā edit and colourĀ ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

Ā 

Link to post
Share on other sites
  • Moderators

Gambler71,

I believe that you will need to turn off the associated Windows sound effect - there is nothing that I know of which allows a script to do so independently.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.pngĀ AnyĀ of myĀ own codeĀ posted anywhere on the forumĀ isĀ available for use by others without any restrictionĀ of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSortĀ ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- AĀ highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort,Ā edit and colourĀ ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

Ā 

Link to post
Share on other sites
On 5.06.2017 at 8:52 AM, Melba23 said:

I have just tried multiple drag/drop steps as you describe and I get the row moved to the correct location each time. Are you waiting for the delimiter bar toĀ appear in the requiredĀ placeĀ before releasing the mouse button? I wonder if you are not releasing too soon.

I need to look more closely at this.

Signature beginning:
*Ā Please remember: "AutoIt".....Ā *Ā Ā Wondering who uses AutoIt and what it can be used for ?Ā *Ā Forum RulesĀ *
*Ā ADO.au3 UDFĀ *Ā POP3.au3 UDFĀ *Ā XML.au3 UDFĀ *Ā IE on Windows 11 *Ā for other useful stuffĀ click the following button:

Spoiler

AnyĀ of myĀ own codeĀ posted anywhere on the forumĀ isĀ available for use by others without any restrictionĀ of any kind.Ā 

My contribution (my own projects):Ā *Ā Debenu Quick PDF Library - UDFĀ *Ā Debenu PDF Viewer SDK - UDFĀ *Ā Acrobat Reader - ActiveX ViewerĀ * UDF for PDFCreator v1.x.xĀ *Ā XZip - UDFĀ *Ā AppCompatFlagsĀ UDFĀ *Ā CrowdinAPIĀ UDFĀ *Ā _WinMergeCompare2Files()Ā *Ā _JavaExceptionAdd()Ā *Ā _IsBeta()Ā *Ā Writing DPI Awareness App - workaroundĀ *Ā _AutoIt_RequiredVersion()Ā * Chilkatsoft.au3 UDFĀ *Ā TeamViewer.au3 UDFĀ *Ā JavaManagement UDFĀ *Ā VIES over SOAPĀ * WinSCP UDFĀ * GHAPI UDF - modest begining - comunication with GitHub REST API *Ā ErrorLog.au3 UDF - A logging LibraryĀ *Ā Include Dependency Tree (Tool for analyzing script relations)Ā *

My contribution to others projects or UDF based on Ā others projects:Ā *Ā _sql.au3 UDFĀ Ā * POP3.au3 UDFĀ * Ā RTF Printer - UDFĀ * XML.au3 UDFĀ * ADO.au3 UDF *Ā SMTP Mailer UDFĀ *Ā Dual Monitor resolution detection * *Ā 2GUI on Dual Monitor System * _SciLexer.au3 UDFĀ *Ā SciTE - Lexer for console pane *Ā 

Useful links:Ā * Forum RulesĀ *Ā Forum etiquetteĀ *Ā  Forum Information and FAQsĀ *Ā How to post code on the forumĀ *Ā AutoIt Online DocumentationĀ *Ā AutoIt Online Beta DocumentationĀ *Ā SciTE4AutoIt3 getting startedĀ *Ā Convert text blocks to AutoIt codeĀ *Ā Games made in AutoitĀ *Ā Programming related sitesĀ *Ā Polish AutoIt TutorialĀ *Ā DllCall Code GeneratorĀ *Ā 

Wiki:Ā *Ā Expand your knowledge - AutoIt WikiĀ *Ā Collection of User Defined FunctionsĀ *Ā How to use HelpFileĀ *Ā Good coding practices in AutoItĀ *Ā 

OpenOffice/LibreOffice/XLS Related:Ā WriterDemo.au3Ā *Ā XLS/MDB from scratch with ADOX

IE Related:Ā Ā *Ā How to use IE.au3 Ā UDF with Ā AutoIt v3.3.14.xĀ *Ā Why isn't Autoit able to click a Javascript Dialog?Ā *Ā Clicking javascript button with no IDĀ *Ā IE document >> save as MHT fileĀ * IETab Switcher (by LarsJ )Ā *Ā HTML Entities * _IEquerySelectorAll() (by uncommon)Ā *Ā IE in TaskScheduler *Ā IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI)Ā *Ā PDFĀ Related: *Ā How to get reference to PDF object embeded in IE * IE on Windows 11 *Ā 

I encourage you to read:Ā * Global VarsĀ * Best Coding PracticesĀ *Ā Please explain code used in Help file for several File functionsĀ *Ā OOP-like approach in AutoItĀ * UDF-Spec QuestionsĀ *Ā  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMDĀ *

I also encourage you to check awesome @trancexxĀ code:Ā  *Ā Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff *Ā OnHungApp handler *Ā Avoid "AutoIt Error" message box in unknown errorsĀ Ā *Ā HTML editor *Ā 

winhttp.au3 related :Ā *Ā https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:Ā Ā :ranting:, beĀ Ā :)Ā and Ā  Ā  Ā  \\//_.

Anticipating ErrorsĀ :Ā Ā "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2022-03-07

Link to post
Share on other sites
  • 2 weeks later...

Melba23,

very nice UDF! :)

I get an error if "MustDeclareVars" is placed before "#include GUIListViewEx.au3":

"D:\SUPERSONIC\_\AUTOIT\Include\Melba23\GUIListViewEx\20170216\_\GUIListViewEx.au3" (3753) : ==> Variable used without being declared.:
$iCol = DllStructGetData($tNMHEADER, "Item")
^ ERROR

Link to post
Share on other sites
  • Moderators

supersonic,

I do not get that error with my master copy of the UDFĀ - are you sure you have the latest version?

M23

Edit: Apologies, I can see where it might occur during execution but not be picked up by Au3Check - I will see how I can fix it.

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.pngĀ AnyĀ of myĀ own codeĀ posted anywhere on the forumĀ isĀ available for use by others without any restrictionĀ of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSortĀ ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- AĀ highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort,Ā edit and colourĀ ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

Ā 

Link to post
Share on other sites
  • 2 weeks later...

Hi Melba,

great work on this as always... I use old version of this UDF but I guess I will have to upgrade as I need some features from your new version.

To be more exact I need one column to have updown control.

And I struggle to figure out how to SetEditStatus so it has UpDown controls next to number and further to that how can I limit range(for example so it goes from 1 to 6).

Any help would be appreciated...

Thanks a lot

Jan

Link to post
Share on other sites
  • Moderators

JanZoudlik,

The _SetEditStatus function header explains how to get an UpDown control and how to set limitsĀ and even whether the controlĀ should wrap - but in trying to write you a shortĀ example I have just discovered that another later change to the UDF has broken that particular section!Ā So give me a moment to work out how to fix it and I will come back.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.pngĀ AnyĀ of myĀ own codeĀ posted anywhere on the forumĀ isĀ available for use by others without any restrictionĀ of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSortĀ ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- AĀ highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort,Ā edit and colourĀ ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

Ā 

Link to post
Share on other sites
  • Moderators

JanZoudlik,

There is no problem with the UDFĀ - I had mis-read my own instructions on how to do it!!!!! I really do feel that this UDF is now far too complicated for its own good, but people seem to like it.....

Here is an UpDown example which works with the latest version:

#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>

#include "GUIListViewEx.au3"

$hGUI = GUICreate("ListView UpDown Test", 500, 500)

$cLV = GUICtrlCreateListView("No UpDown|UpDown|Limit UpDown|Wrap UpDown", 10, 10, 420, 260, BitOR($LVS_SINGLESEL, $LVS_SHOWSELALWAYS))
_GUICtrlListView_SetExtendedListViewStyle($cLV, $LVS_EX_FULLROWSELECT)
For $i = 0 To 3
    _GUICtrlListView_SetColumnWidth($cLV, $i, 100)
Next

; Create array and fill listview
Global $aLVArray[6][4]
For $i = 0 To 5
    $sData = "Item " & $i & "-0"
    $aLVArray[$i][0] = $sData
    For $j = 1 To 3
        $sData &= "|SubItem " & $i & "-" & $j
        $aLVArray[$i][$j] = "SubItem " & $i & "-" & $j
    Next
    GUICtrlCreateListViewItem($sData, $cLV)
Next

; Initiate ListView
$iLVIndex = _GUIListViewEx_Init($cLV, $aLVArray)

; Set column edit status
_GUIListViewEx_SetEditStatus($iLVIndex, 0, 1)                   ; Default = standard text edit
_GUIListViewEx_SetEditStatus($iLVIndex, 1, 1, 1)                ; UpDown with no limit
_GUIListViewEx_SetEditStatus($iLVIndex, 2, 1, 1, "1|6|0")       ; UpDown with limit
_GUIListViewEx_SetEditStatus($iLVIndex, 3, 1, 1, "1|6|1")       ; UpDown with limit and wrap

_GUIListViewEx_MsgRegister()

GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch

    _GUIListViewEx_EventMonitor()

WEnd

M23

Ā 

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.pngĀ AnyĀ of myĀ own codeĀ posted anywhere on the forumĀ isĀ available for use by others without any restrictionĀ of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSortĀ ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- AĀ highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort,Ā edit and colourĀ ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

Ā 

Link to post
Share on other sites
  • 2 weeks later...

Melba23,

as reported in post #175 I have found anotherĀ missing variable declaration. I modified your UDF a bit and now I seems to work using "MustDeclareVars".

Please see attachment forĀ comparison.

Comparison.jpg

Edited by supersonic
Link to post
Share on other sites
  • Melba23 changed the title to GUIListViewEx - New Version 21 May 22

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...