Jump to content
Melba23

GUIListViewEx - New Version 22 Feb 18

Recommended Posts

Melba23

232showtime,

Certainly - here is the example reduced to just the save/load code (you will need the Beta UDF in the post above yours):

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#include "GUIListViewEx.au3"

$hGUI = GUICreate("Save/Load Example", 1000, 510)

; Create ListView
$cLV_1 = GUICtrlCreateListView("Zero Column|One Column|Two Column|Three Column", 10, 30, 480, 260, BitOR($LVS_SINGLESEL, $LVS_SHOWSELALWAYS))
_GUICtrlListView_SetExtendedListViewStyle($cLV_1, $LVS_EX_FULLROWSELECT)
For $i = 0 To 3
    _GUICtrlListView_SetColumnWidth($cLV_1, $i, 100)
Next

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

; Initiate ListView
$iLVIndex_1 = _GUIListViewEx_Init($cLV_1, $aLVArray_1)

; Set all column editable
_GUIListViewEx_SetEditStatus($iLVIndex_1, "*")

; Create empty UDF ListView
$cLV_2 = _GUICtrlListView_Create($hGUI, "", 510, 30, 480, 260, BitOr($LVS_REPORT, $LVS_SINGLESEL, $LVS_SHOWSELALWAYS, $WS_BORDER))
_GUICtrlListView_SetExtendedListViewStyle($cLV_2, $LVS_EX_FULLROWSELECT)
; Initiate to get index - empty array passed
$iLVIndex_2 = _GUIListViewEx_Init($cLV_2, "")
; Create additional buttons
$cSave = GUICtrlCreateButton("Save LH ListView", 340, 470, 150, 30)
$cLoad = GUICtrlCreateButton("Load RH ListView", 510, 470, 150, 30)
GUICtrlSetState($cLoad, $GUI_DISABLE)
$cExit = GUICtrlCreateButton("Exit", 880, 470, 110, 30)

_GUIListViewEx_MsgRegister()

GUISetState()

While 1

    $iMsg = GUIGetMsg()
    Switch $iMsg
        Case $GUI_EVENT_CLOSE, $cExit
            Exit

        Case $cSave
            _GUIListViewEx_SaveListView($iLVIndex_1, "Save.lvs")
            GUICtrlSetState($cLoad, $GUI_ENABLE)
        Case $cLoad
            _GUIListViewEx_LoadListView($iLVIndex_2, "Save.lvs") ; But return now forced to 2D
    EndSwitch

    ; Allow edit on double click
    $aRet = _GUIListViewEx_EditOnClick()

WEnd

All the items are editable so you can check that any changed file is saved and loaded correctly.

M23

  • Like 1

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
232showtime

@Melba23,

hi I dont know what im missing in _GUIListViewEx_SaveListView and _GUIListViewEx_LoadListView

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include "GUIListViewEx.au3"
#include <Array.au3>

Global $List1, $sString, $hButton0

gui1()

Func gui1()
    $hGUI1 = GUICreate("Gui 1", 400, 400, 200, 200)
    $hButton0 = GUICtrlCreateButton("Load", 100, 10, 80, 30)
    $hButton1 = GUICtrlCreateButton("Clear 1", 10, 10, 80, 30)
    $hButton2 = GUICtrlCreateButton("Edit", 10, 60, 80, 30)
    $List1 = GUICtrlCreateListView("", 10, 100, 180, 80, BitOR(0x0200, 0x008), BitOR(0x00000020, 0x00000001))

    _GUICtrlListView_AddColumn($List1, "1", 150, 2)
    _GUICtrlListView_AddColumn($List1, "2", 500, 2)
    _GUICtrlListView_AddColumn($List1, "3", 50, 2)
    _GUICtrlListView_Scroll($List1, 10, 100)

    GUISetState()

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $hButton1
                MsgBox("", "MsgBox 1", "Clear???")
                _GUICtrlListView_DeleteAllItems($List1)
            Case $hButton2
                ; Disable the first GUI
                GUISetState(@SW_DISABLE, $hGUI1)
                gui2()
                ; Re-enable the first GUI
                GUISetState(@SW_ENABLE, $hGUI1)

            Case $hButton0
                _GUIListViewEx_LoadListView($List1, "Save.lvs")

        EndSwitch
    WEnd
EndFunc   ;==>gui1

Func gui2()
    $hGUI2 = GUICreate("Gui 2", 200, 200, 350, 350)
    $sString = GUICtrlCreateEdit("", 50, 50, 100, 100, $ES_WANTRETURN)
    $hButton3 = GUICtrlCreateButton("Save", 10, 10, 80, 30)


    GUISetState()

    While 1


        ; We can only get messages from the second GUI
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                GUIDelete($hGUI2)
                ExitLoop
            Case $hButton3
                $sRead1 = GUICtrlRead($sString)
                _GUICtrlListView_AddItem($List1, $sRead1) ; Row 1 Col 1
                _GUIListViewEx_SaveListView($List1, "Save.lvs")
                GUICtrlSetState($hButton0, $GUI_ENABLE)
                GUISetState(@SW_HIDE, $hGUI2)
                ExitLoop

;~              _GUIListViewEx_SaveListView($List1, "Save.lvs")
;~          Case $cLoad
;~              _GUIListViewEx_LoadListView($iLVIndex_2, "Save.lvs") ; But return now forced to 2D


        EndSwitch
    WEnd
EndFunc   ;==>gui2

Please I need  help what am I missing???


ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

Share this post


Link to post
Share on other sites
Melba23

232showtime,

Try this:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include "GUIListViewEx.au3"
#include <Array.au3>

Global $List1, $sString, $hButton0, $iLV_Index

gui1()

Func gui1()
    $hGUI1 = GUICreate("Gui 1", 400, 400, 200, 200)
    $hButton0 = GUICtrlCreateButton("Load", 100, 10, 80, 30)
    $hButton1 = GUICtrlCreateButton("Clear 1", 10, 10, 80, 30)
    $hButton2 = GUICtrlCreateButton("Edit", 10, 60, 80, 30)
    $List1 = GUICtrlCreateListView("", 10, 100, 180, 80, BitOR(0x0200, 0x008), BitOR(0x00000020, 0x00000001))

    _GUICtrlListView_AddColumn($List1, "1", 150, 2)
    _GUICtrlListView_AddColumn($List1, "2", 500, 2)
    _GUICtrlListView_AddColumn($List1, "3", 50, 2)
    _GUICtrlListView_Scroll($List1, 10, 100)

    ; Initiate ListView within UDF
    $iLV_Index = _GUIListViewEx_Init($List1, "")

    GUISetState()

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $hButton1
                MsgBox("", "MsgBox 1", "Clear???")
                _GUICtrlListView_DeleteAllItems($List1)
            Case $hButton2
                ; Disable the first GUI
                GUISetState(@SW_DISABLE, $hGUI1)
                gui2()
                ; Re-enable the first GUI
                GUISetState(@SW_ENABLE, $hGUI1)

            Case $hButton0
                _GUIListViewEx_LoadListView($iLV_Index, "Save.lvs")
                ; Reset column alignment
                _GUICtrlListView_JustifyColumn($List1, 0, 2)
                _GUICtrlListView_JustifyColumn($List1, 1, 2)
                _GUICtrlListView_JustifyColumn($List1, 2, 2)
                _WinAPI_RedrawWindow(GUICtrlGetHandle($List1))

        EndSwitch
    WEnd
EndFunc   ;==>gui1

Func gui2()
    $hGUI2 = GUICreate("Gui 2", 200, 200, 350, 350)
    $sString = GUICtrlCreateEdit("", 50, 50, 100, 100, $ES_WANTRETURN)
    $hButton3 = GUICtrlCreateButton("Save", 10, 10, 80, 30)


    GUISetState()

    While 1


        ; We can only get messages from the second GUI
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $hButton3
                $sRead1 = GUICtrlRead($sString)

                _GUIListViewEx_Insert($sRead1 & "||") ; Add item to ListView uaing UDF

                _GUIListViewEx_SaveListView($iLV_Index, "Save.lvs")
                GUICtrlSetState($hButton0, $GUI_ENABLE)
                ExitLoop

        EndSwitch
    WEnd

    GUIDelete($hGUI2)

EndFunc   ;==>gui2

M23

  • Like 1

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
dmob

Hi Melba, a small (hopefully)  feature request - an updown control for the edit control, using the unused

$vParam1 perhaps, as with the auto-drop down combo?

I am always looking for ways to expedite data entry and/or minimise keyboard use for my users...

Edited by dmob
Additional info

Share this post


Link to post
Share on other sites
Melba23

dmob,

Please let me know what you think of this implementation. Example (look at line #30):

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>

#include "GUIListViewEx_UpDown.au3"

#include <Array.au3> ; Just for display in example

Global $aRet, $iEditMode = 0

; Create GUI
$hGUI = GUICreate("LVEx Beta Example", 500, 360)

; Create ListView
$cListView = GUICtrlCreateListView("Tom|Dick|Harry", 10, 10, 480, 300, $LVS_SHOWSELALWAYS)
_GUICtrlListView_SetExtendedListViewStyle($cListView,$LVS_EX_FULLROWSELECT )
_GUICtrlListView_SetColumnWidth($cListView, 0, 150)
_GUICtrlListView_SetColumnWidth($cListView, 1, 150)
_GUICtrlListView_SetColumnWidth($cListView, 2, 150)

; Create array and fill Left listview
Global $aLV_List[15]
For $i = 0 To 14
    $aLV_List[$i] = $i & "|Dick " & $i & "|Harry " & $i
    GUICtrlCreateListViewItem($i & "|Dick " & $i & "|Harry " & $i, $cListView)
Next

; Initiate LVEx - use filling array - no count parameter - default insert mark colour (black) - drag image - sortable + not select all text
$iLV_Index = _GUIListViewEx_Init($cListView, $aLV_List, 0, Default, Default, 4)

_GUIListViewEx_SetEditStatus($iLV_Index, "0", 1, 1, "0|9|1") ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
_GUIListViewEx_SetEditStatus($iLV_Index, "1", 2, "1|2|3", 1)
_GUIListViewEx_SetEditStatus($iLV_Index, "2", 2, "1|2|3", 3)

$cDisplay_Button = GUICtrlCreateButton("Show content", 10, 320, 230, 30)
$cExit_Button = GUICtrlCreateButton("Exit", 260, 320, 230, 30)

; Register for sorting, dragging and editing
_GUIListViewEx_MsgRegister()

GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE, $cExit_Button
            Exit

        Case $cDisplay_Button

            $aLV_List = _GUIListViewEx_ReturnArray($iLV_Index)
            If Not @error Then
                _ArrayDisplay($aLV_List, "Returned Left")
            Else
                MsgBox(0, "Left", "Empty Array")
            EndIf

    EndSwitch

    ; This function must be in the idle loop to enable editing of any kind
    $vRet = _GUIListViewEx_EditOnClick(33)
    If IsArray($vRet) Then
        ; Uncomment to see returned array
        ;ConsoleWrite("Edits performed: " & $vRet[0][0] & @CRLF)
        ;_ArrayDisplay($vRet, @error)
        $avRet = ""
    EndIf

WEnd

And the UDF to use with it:

Read the _GUIListViewEx_SetEditStatus function header to see how the syntax works - I hope it is reasonably intuitive.

M23

Edited by Melba23
Beta code removed
  • Like 1

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
dmob

Yes, yes, yes!!! :dance:

Perfect, better than I expected and your response quicker than I expected! :hyper:

Thank you so much Melba.

Share this post


Link to post
Share on other sites
Melba23

dmob,

Delighted to hear that you like it - I aim to please.....!!!!!!

M23

  • Like 1

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
dmob

@Melba

I was tinkering around with an auto-drop date picker, and "discovered" this works great:

Local $btnDate = GUICtrlCreateDate("...", 153, 60, 17, 21, BitOR($DTS_SHORTDATEFORMAT, $DTS_RIGHTALIGN))
_SendMessage(GUICtrlGetHandle($btnDate), 0x0201, 1, 1) ; WM_LBUTTONDOWN

However, I tried hacking your UDF and failed miserably...

I added $iMode = 4 to _GUIListViewEx_SetEditStatus, identical to $iMode = 3  and added this to __GUIListViewEx_EditProcess:

;~          Case 3 ; DTP
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Added this <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
            Case 3, 4 ; DTP
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Added this <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                $fDTP = True
                Local $sDTP_Default = $aEditable[1][$aLocation[1]]
                If $sDTP_Default = Default Then
                    $sDTP_Default = @YEAR & "/" & @MON & "/" & @MDAY
                EndIf
                Local $sDTP_Format = $aEditable[2][$aLocation[1]]
                If $sDTP_Format = Default Then
                    $sDTP_Format = ""
                EndIf
        EndSwitch

        ; Read current text of clicked item
        Local $sItemOrgText = _GUICtrlListView_GetItemText($hGLVEx_Editing, $aLocation[0], $aLocation[1])
        ; Ensure item is visible and get required edit coords

        .
        .
        .
        .
        .
            Case 3 ; DTP
                ; Create temp date picker
                $cGLVEx_EditID = GUICtrlCreateDate($sDTP_Default, $aEdit_Pos[0], $aEdit_Pos[1], $aEdit_Pos[2], $aEdit_Pos[3])
                $hTemp_Edit = GUICtrlGetHandle($cGLVEx_EditID)
                ; Set format if required
                If $sDTP_Format Then
                    GUICtrlSendMsg($cGLVEx_EditID, 0x1032, 0, $sDTP_Format) ; $DTM_SETFORMATW
                EndIf
            Case 4 ; DTP - auto drop
                ; Create temp date picker
                $cGLVEx_EditID = GUICtrlCreateDate($sDTP_Default, $aEdit_Pos[0], $aEdit_Pos[1], $aEdit_Pos[2], $aEdit_Pos[3])
                $hTemp_Edit = GUICtrlGetHandle($cGLVEx_EditID)
                ; Set format if required
                If $sDTP_Format Then
                    GUICtrlSendMsg($cGLVEx_EditID, 0x1032, 0, $sDTP_Format) ; $DTM_SETFORMATW
                EndIf
                
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Added this <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                ;_SendMessage($cGLVEx_EditID, 0x0201, 1, 1) ; WM_LBUTTONDOWN
                GUICtrlSendMsg($cGLVEx_EditID, 0x0201, 1, 1) ; WM_LBUTTONDOWN
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Added this <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
        EndSwitch

        ; Set font
        GUICtrlSetFont($cGLVEx_EditID, $aLV_FontDetails[0], Default, Default, $aLV_FontDetails[1])

... and broke the UDF :doh:

What am I doing wrong?

Edit: Tried this unsuccessfully too:

Case 3, 4 ; DTP
                $fDTP = True
                Local $sDTP_Default = $aEditable[1][$aLocation[1]]
                If $sDTP_Default = Default Then
                    $sDTP_Default = @YEAR & "/" & @MON & "/" & @MDAY
                EndIf
                Local $sDTP_Format = $aEditable[2][$aLocation[1]]
                If $sDTP_Format = Default Then
                    $sDTP_Format = ""
                EndIf
        EndSwitch
        .
        .
        .
        .
        Case 3, 4 ; DTP
                ; Create temp date picker
                $cGLVEx_EditID = GUICtrlCreateDate($sDTP_Default, $aEdit_Pos[0], $aEdit_Pos[1], $aEdit_Pos[2], $aEdit_Pos[3])
                $hTemp_Edit = GUICtrlGetHandle($cGLVEx_EditID)
                ; Set format if required
                If $sDTP_Format Then
                    GUICtrlSendMsg($cGLVEx_EditID, 0x1032, 0, $sDTP_Format) ; $DTM_SETFORMATW
                EndIf
        EndSwitch
        .
        .
        .
        
        ; Check for auto "drop-down" combo
        If $fAuto_Drop Then
            _SendMessage($hCombo, 0x14F, True) ; $$CB_SHOWDROPDOWN
        EndIf

;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Added this <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
        If $iEditType = 4 Then
            ;_SendMessage($cGLVEx_EditID, 0x0201, 1, 1) ; WM_LBUTTONDOWN
            GUICtrlSendMsg($cGLVEx_EditID, 0x0201, 1, 1) ; WM_LBUTTONDOWN
        EndIf
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Added this <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

 

Edited by dmob

Share this post


Link to post
Share on other sites
Melba23

dmob,

The final parameter of the WM_LBUTTONDOWN message needs to be coded to determine the offset within the control where the action is to occur - some Googling shows that the formula is as follows:

x = DTP_Width - 10
y = DTP_Height / 2
Param = x + ( y * 0x00010000 )

It works in the original snippet as the "open" button is to the left of the visible control and so the 1 pixel is over the button - within a ListView that is unlikely to be the case and so we have to define the X-coordinate required, which is not hard as we set the width of the control when we draw it (experimentation shows that we can apparently ignore the Y-coordinate):

_SendMessage($hTemp_Edit, 0x0201, 1, $aEdit_Pos[2] - 10) ; WM_LBUTTONDOWN

Try changing the _GUIListViewEx_SetEditStatus lines in the example I posted above to this:

_GUIListViewEx_SetEditStatus($iLV_Index, "0", 3)                    ; No dropdown
_GUIListViewEx_SetEditStatus($iLV_Index, "1", 3, "#")               ; Dropdown with default date
_GUIListViewEx_SetEditStatus($iLV_Index, "2", 3, "2000/01/01#")     ; Dropdown with defined date

and run it with this version of the UDF:

The syntax is pretty easy - a trailing "#" in $vParam1 forces the DTP to open on edit. Does that meet your requirements?

M23

Edited by Melba23
Beta code removed
  • Like 1

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
dmob

Yes it does and works great!! Thanks for the research.

:dance: yet again :D

I particularly like the simple (and brilliant) implementation. Big up to you :graduated:

Edited by dmob

Share this post


Link to post
Share on other sites
Melba23

dmob,

Fine - any other requests?

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
dmob

:D I'll let you know...

I must say your UDF makes my app professional and intuitive although I've yet to use all the features. I have

had to tweak a bit for my exact requirements coz I do use a LOT of listviews, and will have to revisit some of my 

code to exploit the UDF fully.

 

 

Share this post


Link to post
Share on other sites
232showtime

@Melba23,

Good day,
Im having trouble with my script, it works perfectly on my Office Desktop, but

then I Installed full autoit installation software and a Customized Scite Editor in my laptop.

I ran the same script on my office desktop and laptop..

I got this error after running my script on laptop..

Please note I already download the the latest UDF - GUIListViewEx.au3

>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "D:\Script\SavebyMelba2.au3" /UserParams    
+>11:05:25 Starting AutoIt3Wrapper v.16.612.1119.0 SciTE v.3.6.6.0   Keyboard:00000410  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64  Environment(Language:0409)  CodePage:0  utf8.auto.check:4
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\user\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\user\AppData\Local\AutoIt v3\SciTE 
>Running AU3Check (3.3.12.0)  from:C:\Program Files (x86)\AutoIt3  input:D:\Script\SavebyMelba2.au3
+>11:05:25 AU3Check ended.rc:0
>Running:(3.3.12.0):C:\Program Files (x86)\AutoIt3\autoit3.exe "D:\Script\SavebyMelba2.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
"C:\Program Files (x86)\AutoIt3\Include\GUIListViewEx.au3" (5285) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
$aRetArray[$i - 1][$j - 1] = $aItems[$j]
^ ERROR
->11:05:38 AutoIt3.exe ended.rc:1
+>11:05:38 AutoIt3Wrapper Finished.
>Exit code: 1    Time: 13.99

this is the same script I ran on laptop and office desktop see below:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include "GUIListViewEx.au3"
#include <Array.au3>

Global $List1, $sString, $hButton0, $iLV_Index

gui1()

Func gui1()
    $hGUI1 = GUICreate("Gui 1", 400, 400, 200, 200)
    $hButton0 = GUICtrlCreateButton("Load", 100, 10, 80, 30)
    $hButton1 = GUICtrlCreateButton("Clear 1", 10, 10, 80, 30)
    $hButton2 = GUICtrlCreateButton("Edit", 10, 60, 80, 30)
    $List1 = GUICtrlCreateListView("", 10, 100, 180, 80, BitOR(0x0200, 0x008), BitOR(0x00000020, 0x00000001))

    _GUICtrlListView_AddColumn($List1, "1", 150, 2)
    _GUICtrlListView_AddColumn($List1, "2", 500, 2)
    _GUICtrlListView_AddColumn($List1, "3", 50, 2)
    _GUICtrlListView_Scroll($List1, 10, 100)

    ; Initiate ListView within UDF
    $iLV_Index = _GUIListViewEx_Init($List1, "")

    GUISetState()

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $hButton1
                MsgBox("", "MsgBox 1", "Clear???")
                _GUICtrlListView_DeleteAllItems($List1)
            Case $hButton2
                ; Disable the first GUI
                GUISetState(@SW_DISABLE, $hGUI1)
                gui2()
                ; Re-enable the first GUI
                GUISetState(@SW_ENABLE, $hGUI1)

            Case $hButton0
                _GUIListViewEx_LoadListView($iLV_Index, "Save.lvs")
                ; Reset column alignment
                _GUICtrlListView_JustifyColumn($List1, 0, 2)
                _GUICtrlListView_JustifyColumn($List1, 1, 2)
                _GUICtrlListView_JustifyColumn($List1, 2, 2)
                _WinAPI_RedrawWindow(GUICtrlGetHandle($List1))

        EndSwitch
    WEnd
EndFunc   ;==>gui1

Func gui2()
    $hGUI2 = GUICreate("Gui 2", 200, 200, 350, 350)
    $sString = GUICtrlCreateEdit("", 50, 50, 100, 100, $ES_WANTRETURN)
    $hButton3 = GUICtrlCreateButton("Save", 10, 10, 80, 30)


    GUISetState()

    While 1


        ; We can only get messages from the second GUI
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $hButton3
                $sRead1 = GUICtrlRead($sString)

                _GUIListViewEx_Insert($sRead1 & "||") ; Add item to ListView uaing UDF

                _GUIListViewEx_SaveListView($iLV_Index, "Save.lvs")
                GUICtrlSetState($hButton0, $GUI_ENABLE)
                ExitLoop

        EndSwitch
    WEnd

    GUIDelete($hGUI2)

EndFunc   ;==>gui2

Desktop OS:

Win7 Pro 64 bit Service Pack 1

Laptop OS:

Win7 Pro 64 bit Service Pack 1

Edited by 232showtime

ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

Share this post


Link to post
Share on other sites
Melba23

232showtime,

Any saved file from earlier versions of the UDF could well fail when loaded using the latest Beta versions - I added some more items to the stored data and so the internal format is not quite the same. Is that what you tried to do?

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
232showtime

@Melba23,

Hi, yes. I've downloaded your UDF from the 3rd page of this post, above my post.. I copy and paste your latest GUIListViewEx.au3 to include folder of AutoIT then I ran the script above your post using my laptop and I got error. I switched back to my desktop and ran the script it worked no issues.

right now my laptop battery is at 1% forgot the charger, dont know what is the problem, after work Ill reinstall autoit in my laptop.


ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

Share this post


Link to post
Share on other sites
Melba23

232showtime,

I rather doubt it is the AutoIt installation. The line that produced the error is only called when loading a saved ListView - so I repeat my earlier question: were you trying to load a previously saved file when the error occurred?

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
232showtime

yes error only occurs when I tried to press load and script crashes..


ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

Share this post


Link to post
Share on other sites
Melba23

232showtime,

And was this a file you had saved previously using the same script? If you attach the file in question I can perhaps take a look and see if I can see anything wrong.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
232showtime

yes everything is same,

Save.lvs

SavebyMelba2.au3


ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

Share this post


Link to post
Share on other sites
Melba23

232showtime,

I have found a problem with the loading code - so thanks for the report. I am now working on how to fix it.

M23

  • Like 1

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

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

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.