Jump to content
bourny

help with firing functions when data is changed in a GUI list view

Recommended Posts

bourny,

Still no luck - I am operating off a very flaky connection in deepest Cornwall and it does not seem to like any uploading.  So we will try another way.

Add these functions to the Beta I posted at #13 above - just add them at the end of the current code:

; #FUNCTION# =========================================================================================================
; Name...........: _GUIListViewEx_ToolTipInit
; Description ...: Defines column(s) which will display a tooltip when clicked
; Syntax.........: _GUIListViewEx_ToolTipInit($iLV_Index, $vRange [, $iTime = 1000])
; Parameters ....: $iLV_Index - Index of ListView holding columns
;                  $vRange    - Range of columns - see remarks
;                  $iTime     - Time for tooltip to display (default = 1000)
; Requirement(s).: v3.3 +
; Return values .: Success: Returns 1
;                  Failure: Returns 0 and sets @error as follows:
;                      1 = Invalid index
;                      2 = Invalid range
;                      3 = Invalid time
; Author ........: Melba23
; Modified ......:
; Remarks .......: $vRange is a string containing the rows which are to be deleted.
;                  It can be a single number or a range separated by a hyphen (-).
;                  mMltiple items are separated by a semi-colon (;).
; Example........: Yes
;=====================================================================================================================
Func _GUIListViewEx_ToolTipInit($iLV_Index, $vRange, $iTime = 1000)

    ; Check valid parameters
    If $iLV_Index < 0 Or $iLV_Index > $aGLVEx_Data[0][0] Then Return SetError(1, 0, 0)
    If Not IsString($vRange) Then Return SetError(2, 0, 0)
    If Not IsInt($iTime) Then Return SetError(3, 0, 0)

    ; Expand range
    Local $iNumber, $aSplit_1, $aSplit_2
    $vRange = StringStripWS($vRange, 8)
    $aSplit_1 = StringSplit($vRange, ";")
    $vRange = ""
    For $i = 1 To $aSplit_1[0]
        ; Check for correct range syntax
        If Not StringRegExp($aSplit_1[$i], "^\d+(-\d+)?$") Then Return SetError(2, 0, 0)
        $aSplit_2 = StringSplit($aSplit_1[$i], "-")
        Switch $aSplit_2[0]
            Case 1
                $vRange &= $aSplit_2[1] & ";"
            Case 2
                If Number($aSplit_2[2]) >= Number($aSplit_2[1]) Then
                    $iNumber = $aSplit_2[1] - 1
                    Do
                        $iNumber += 1
                        $vRange &= $iNumber & ";"
                    Until $iNumber = $aSplit_2[2]
                EndIf
        EndSwitch
    Next
    $vRange = StringSplit(StringTrimRight($vRange, 1), ";")
    If $vRange[1] < 0 Or $vRange[$vRange[0]] > _GUICtrlListView_GetColumnCount($aGLVEx_Data[$iLV_Index][0]) Then Return SetError(2, 0, 0)
    ; Store column range and time
    $aGLVEx_Data[$iLV_Index][15] = $vRange
    $aGLVEx_Data[$iLV_Index][16] = $iTime

    Return 1

EndFunc

; #FUNCTION# =========================================================================================================
; Name...........: _GUIListViewEx_ToolTipShow
; Description ...: Show tooltips with item content when defined columns clicked
; Syntax.........: _GUIListViewEx_ToolTipShow()
; Parameters ....: None
; Requirement(s).: v3.3 +
; Return values .: None
; Author ........: Melba23
; Modified ......:
; Remarks .......: This function must be placed within the script idle loop.
; Example........: Yes
;=====================================================================================================================
Func _GUIListViewEx_ToolTipShow()

    Static Local $iItem = -1, $iCol = -1

    ; A new item clicked?
    If $aGLVEx_Data[0][4] <> $iItem Or $aGLVEx_Data[0][2] <> $iCol Then
        ; Does active ListView have a tooltip range set
        If IsArray($aGLVEx_Data[$aGLVEx_Data[0][1]][15]) Then
            Local $vRange = $aGLVEx_Data[$aGLVEx_Data[0][1]][15]
            For $i = 1 To $vRange[0]
                ; If initiated column
                If $aGLVEx_Data[0][2] = $vRange[$i] Then
                    ;Display tooltip
                    Local $aItemText = _GUICtrlListView_GetItemTextArray( $aGLVEx_Data[$aGLVEx_Data[0][1]][0])
                    ToolTip($aItemText[$vRange[$i] + 1])
                    AdlibRegister("_GUIListViewEx_ToolTipHide", $aGLVEx_Data[$aGLVEx_Data[0][1]][16])
                    ExitLoop
                EndIf
            Next
        EndIf
        $iItem = $aGLVEx_Data[0][4]
        $iCol= $aGLVEx_Data[0][2]
    EndIf

EndFunc

; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name...........: _GUIListViewEx_ToolTipHide
; Description ...: Called by Adlib to hide a tooltip displayed by _GUIListViewEx_ToolTipShow
; Author ........: Melba23
; Remarks .......:
; ===============================================================================================================================
Func _GUIListViewEx_ToolTipHide()
    AdlibUnRegister("_GUIListViewEx_ToolTipHide")
    ToolTip("")
EndFunc

And here is the modified example:

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

#include <StringSize.au3>

#include "GUIListViewEx_Mod.au3"

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

Opt("GUICloseOnESC", 0)

Global $iCount_Left = 20, $iCount_Right = 20, $vData, $sMsg, $aLV_List_Left, $aLV_List_Right, $aRet, $iEditMode = 0

Global $sSeparator = "-------------"

; Create GUI
$hGUI = GUICreate("LVEx Example 1", 640, 510)

; Create Left ListView
GUICtrlCreateLabel("Native ListView" & @CRLF & "Multiple selection - no count - sort && editable (0 && 2)", 10, 5, 300, 30)

$cListView_Left = GUICtrlCreateListView("Tom|Dick|Harry", 10, 40, 300, 300, $LVS_SHOWSELALWAYS)
_GUICtrlListView_SetExtendedListViewStyle($cListView_Left, $LVS_EX_FULLROWSELECT)
_GUICtrlListView_SetColumnWidth($cListView_Left, 0, 93)
_GUICtrlListView_SetColumnWidth($cListView_Left, 1, 93)
_GUICtrlListView_SetColumnWidth($cListView_Left, 2, 93)

GUICtrlSetBkColor($cListView_Left, $GUI_BKCOLOR_LV_ALTERNATE)

; Set font
GUICtrlSetFont($cListView_Left, 12, Default, Default, "Courier New") ; Note edit control will use same font

; Create array and fill Left listview
Global $aLV_List_Left[$iCount_Left]
For $i = 0 To UBound($aLV_List_Left) - 1
    If Mod($i, 5) Then
        $aLV_List_Left[$i] = "Tom " & $i & "|Dick " & $i & "|Harry " & $i
    Else
        $aLV_List_Left[$i] = "Tom " & $i & "||Harry longer " & $i
    EndIf
    GUICtrlCreateListViewItem($aLV_List_Left[$i], $cListView_Left)
    GUICtrlSetBkColor(-1, 0xCCFFCC)
Next

; Initiate LVEx - use filling array - no count parameter - default insert mark colour (black) - drag image - sort & editable - only cols 0 & 2 (plus headers) editable
$iLV_Left_Index = _GUIListViewEx_Init($cListView_Left, $aLV_List_Left, 0, 0, True, 1 + 2 + 8, "0;2")

; Create an array of combo data with separators
Local $aCombo_Data[100] = ["Very long item to test the dropped width code 0"]
For $i = 1 To 99
    If Mod($i, 10) Then
        $aCombo_Data[$i] = "Very long item to test the dropped width code " & $i
    Else
        $aCombo_Data[$i] = $sSeparator
    EndIf
Next

; Determine max width of the combo items
$iWidth = 0
For $i = 0 To 99
    $aSize = _StringSize($aCombo_Data[$i], 12, Default, Default, "Courier New")
    If $aSize[2] > $iWidth Then $iWidth = $aSize[2]
Next

; Use new parameter to set combo dropped width with allowance for slider width
_GUIListViewEx_ComboData($iLV_Left_Index, 2, $aCombo_Data, True, $iWidth + 20)

$cExit_Button = GUICtrlCreateButton("Exit", 430, 390, 200, 110)

GUISetState()

; Register for sorting, dragging and editing
_GUIListViewEx_MsgRegister()

; Show tooltips for column 2
_GUIListViewEx_ToolTipInit($iLV_Left_Index, "2", 2000) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

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

    $aRet = _GUIListViewEx_EditOnClick(0)
    ; Array only returned AFTER EditOnClick process - so check array exists
    If IsArray($aRet) Then
        ; Check if separator selected
        If $aRet[1][3] = $sSeparator Then
            ; Reset the previous value
            _GUIListViewEx_ChangeItem($iLV_Left_Index, $aRet[1][0], $aRet[1][1], $aRet[1][2])
        EndIf
    EndIf

    ; Display tooltips when initiated column clicked
    _GUIListViewEx_ToolTipShow() ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

WEnd

Now let us see if it will post this!

M23

Edit: Seems to have worked.

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

 

Share this post


Link to post
Share on other sites

Seems to bomb out with.  I have tried placing the new code at the end or the middle and same error.

$aGLVEx_Data[$iLV_Index][15] = $vRange
^ ERROR

 

Share this post


Link to post
Share on other sites

bourny,

Oops - resize the relevant array at the top of the UDF as follows:

; #GLOBAL VARIABLES# =================================================================================================
; Array to hold registered ListView data
Global $aGLVEx_Data[1][17] = [[0, 0, -1]] ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 17 not 15
; [0][0] = Count           [n][0]  = ListView handle
; [0][1] = Active Index    [n][1]  = Native ListView ControlID / 0
; [0][2] = Active Column   [n][2]  = Shadow array
; [0][3] = Item Depth      [n][3]  = Shadow array count element (0/1) & 2D return (+ 2)
; [0][4] = Item            [n][4]  = Sort status
;                          [n][5]  = Drag image flag
;                          [n][6]  = Checkbox array flag
;                          [n][7]  = Editable columns range
;                          [n][8]  = Editable header flag
;                          [n][9]  = Edit cursor active flag
;                          [n][10] = Item depth for scrolling
;                          [n][11] = Edit combo flag/data
;                          [n][12] = External dragdrop flag
;                          [n][13] = Header drag style flag
;                          [n][14] = Edit combo dropdown width
;                          [n][15] = ToolTip column range
;                          [n][16] = ToolTip display time

Sorry about that.

M23

Edit: Still cannot upload files - I will do so as soon as I get back to a decent connection.

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

 

Share this post


Link to post
Share on other sites

Great Thanks M23.

 

I have another problem if you are up to it.

your UDF is holding up under the strain of what I am doing so far.  I have added Icons to a column depending on the text in the column which works great however when I Re-Sort the column the icon stays exactly in the row I assigned it and does not move with the data.  all other text in all other columns move as expected its just the Icons.  

Am I missing something by not assigning the icons to a specific row in $iLV_Right_Index

here is my image placeholder

Global $IconList = _GUIImageList_Create(16, 16, 5, 1)
_GUIImageList_AddIcon( $IconList, "f:\MBIco\GreenTick.ico", 0 ) ;tick   0
_GUIImageList_AddIcon( $IconList, "f:\MBIco\RedCross.ico", 0 ) ;cross    1
_GUIImageList_AddIcon( $IconList, "f:\MBIco\FailToReport.ico", 0 ) ;broken paper   2
_GUIImageList_AddIcon( $IconList, "f:\MBIco\Running.ico", 0 ) ;running    3
_GUIImageList_AddIcon( $IconList, "f:\MBIco\Pause3.ico", 0 ) ;Pause   4

 

and here is the function I am assigning the images

 

Func PopulateListViewFromDailyResultsTable()

    $Counter_ROWposition = 0
    $Counter_CSVposition = 0

    $aCurrentSQLDailyResults = Get2DArrayFromTable($DailyDatabase, $DailyTableName)
    

    ; Load images
    _GUICtrlListView_SetImageList($hListView_Right,  $IconList, 1) ;setting last value to 2 allows cycling of images
    ;tick   0   ;cross    1 ;broken paper   2   ;Running   3    ;Pause  4

    Do

        If $aCurrentSQLDailyResults[$Counter_CSVposition][1] = "Server_Name" Then
            $Counter_CSVposition = $Counter_CSVposition + 1
            ContinueLoop
        EndIf


        _GUICtrlListView_AddItem($hListView_Right,  $aCurrentSQLDailyResults[$Counter_CSVposition][1], 20)            ;Adds in the first element into the next row at position 0 (Column 0 = position 0)
        _GUICtrlListView_AddSubItem($hListView_Right, $Counter_ROWposition, $aCurrentSQLDailyResults[$Counter_CSVposition][2], 1)        ;Adds in the second element into the same row at position 1 (Colulumn 1 = sub position 1)

        Select
            Case $aCurrentSQLDailyResults[$Counter_CSVposition][3] = "Successful"
                _GUICtrlListView_AddSubItem($hListView_Right, $Counter_ROWposition, " " & $aCurrentSQLDailyResults[$Counter_CSVposition][3], 3, 0)       ;Adds in the Third element into the same row at position 2 (Colulumn 2 = sub position 2)

            Case $aCurrentSQLDailyResults[$Counter_CSVposition][3] = "Failed"
                _GUICtrlListView_AddSubItem($hListView_Right, $Counter_ROWposition, " " & $aCurrentSQLDailyResults[$Counter_CSVposition][3], 3, 1)       ;Adds in the Third element into the same row at position 2 (Colulumn 2 = sub position 2)
        EndSelect


        ;Add in Role
        $RoletoADD = CheckforRole($aCurrentSQLDailyResults[$Counter_CSVposition][1])
        _GUICtrlListView_AddSubItem($hListView_Right, $Counter_ROWposition, $RoletoADD, 2)


        ;RE-SIZE Colimn Width to match new entries
        _GUICtrlListView_SetColumnWidth($hListView_Right, 0, $LVSCW_AUTOSIZE)
        _GUICtrlListView_SetColumnWidth($hListView_Right, 2, $LVSCW_AUTOSIZE)
    
        $Counter_CSVposition = $Counter_CSVposition + 1
        $Counter_ROWposition = $Counter_ROWposition + 1

    Until $Counter_CSVposition = ubound($aCurrentSQLDailyResults)


    Global $aLV_List_Right = _GUIListViewEx_ReadToArray($hListView_Right, 1)

    ; Initiate LVEx - use read content as array - count parameter set - red insert mark - drag image - editable - all cols editable by default (plus headers)
    Global $iLV_Right_Index = _GUIListViewEx_Init($hListView_Right, $aLV_List_Right, 1, 0xFF0000, False, 1 + 2 + 4 + 16, "2;3;4;5" )


    $aFailureReasons = GetFailureReasonsFromFile("c:\au3\FailureReasons.txt") ;Obtains failure reasons to be used in Column 3

    ;_GUIListViewEx_ComboData($iLV_Right_Index, 2, )
    _GUIListViewEx_ComboData($iLV_Right_Index, 4, "Yes|No")
    _GUIListViewEx_ComboData($iLV_Right_Index, 3, "Success|Fail|Running")
    _GUIListViewEx_ComboData($iLV_Right_Index, 4, $aFailureReasons)
    _GUIListViewEx_ComboData($iLV_Right_Index, 5, "Us|Them")

    
    GUISetState()

    ; Register for sorting, dragging and editing
    _GUIListViewEx_MsgRegister()

    ; Set the left ListView as active
    _GUIListViewEx_SetActive(1)


EndFunc

 

Share this post


Link to post
Share on other sites

bourny,

Glad you like the narrow column tooltip data expansion code - I was quite pleased with it myself.

As to your new request, I have looked into sorting ListViews with icons before and came to the conclusion that the code overhead would be just too much - you can probably find  the relevant posts somewhere in the UDF thread. I seem to remember that it involved yet another shadow array to track the icons and then rewriting them after the sort had taken place - which given the fact that the required functionality is hardly commonplace meant I was not prepared to invest a lot of time in developing it. So sorry, but this "feature request" is not one I will be accepting.

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

 

Share this post


Link to post
Share on other sites

That is fine M23.  I am working on extra code to implement this feature.  One thing you may be able to point me in the right direction of is how I detect a column sort event has taken place on your UDF.  I have tried various methods but they don't seem to work for Column sorting.  

Once i am able to detect the sort column I should be able to build the logic needed to refresh the icons.

Many Thanks for your help especially with the tooltip integration.

Share this post


Link to post
Share on other sites

bourny,

The column sort  is started when a $LVN_COLUMNCLICK message is received by the UDF - look inside the _GUIListViewEx_WM_NOTIFY_Handler function. You could always set a flag when this a sort is requested and then run your code from within the idle loop when the flagis detected in much the same manner as the tooltip code I developed earlier.

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

 

Share this post


Link to post
Share on other sites

Thanks M23  I will play around with that to get it to work

I have now increased my test Gui to reading in the full database table I am working with (1471 rows).  It keeps tripping out on 2 places and I managed to figure out why for one of them but not the other. 

I get

"C:\Program Files (x86)\AutoIt3\Include\GUIListViewEx_Mod.au3" (382) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
$aLVArray[$i + $iStart][$j - 1] = $aRow[$j]
^ ERROR

When the _GUIListViewEx_ReadToArray function is reading in the array.  I put some debug in your function and found for some reason one of the rows was returning  that it had 8 rows instead of the 7 that "Local $iCols = _GUICtrlListView_GetColumnCount($hLV)" had found for the new temp array.  Clearly as the temp array has been strictly defined as the number of columns it originally found the row that contains the pipe symbol seems to defy it by stating the row has more columns than it can handle

I fixed this by looking at my data at the column it was working on at the time and found I had place a pipe symbol into one of the rows which seemed to annoy the "$aLVArray[$i + $iStart][$j - 1] = $aRow[$j]" line.  So i removed the pipe symbol and made it a comma

Although I got past this I now get the same error when it gets to the last line in the row count.  I can see that this is possibly due to the fact my array I am using has no Ubound value or should I say my array position 0 contains data.

I have tried defining your $iStart value but same error occurs.  The only way I can work around this is by forcing an extra row onto your temp array by doing this in your code 

; Get ListView row count
    Local $iRows = _GUICtrlListView_GetItemCount($hLV) + 1 ;<<<<<<<<<Added the + 1

 

The only special thing about this is I am reading the data form a SQL table using the below code.  I am wondering if somehow the Array I am returning has a ghost row for what is the last NULL row value in the table that SqL automatically creates.  I have tested the array I derive from SQL and can see no evidence of an extra row so I am left with is this just an issue with me having data in the $array[0] [0] column

Here is the code i am using to get the array 2D array from the SQL table (uses EZmSQL udf)

Func Get2DArrayFromTable($DBname, $TableName)

    EstablishSQLConnection($DBname)

    $Qry = "SELECT * FROM " & $TableName

    $a2DRequestedTable = _EzMySql_GetTable2d($Qry)
    $error = @error
    If @Error Then

        ConsoleWrite("Error Getting Table : " & $TableName & " - " & @error & ": Error string: " & _EzMySql_ErrMsg() & @CRLF)
    Else
        ConsoleWrite("Success Getting Table to 2D Array: " & $TableName & @CRLF)
    EndIf

    Return $a2DRequestedTable

EndFunc

 

Share this post


Link to post
Share on other sites

bourny,

The first problem is understandable. The UDF has to make some assumptions and it counts columns in the first row - if you then have more columns in a subsequent row, it will fail.

As to the second, I can only suggest you try and write the array you get returned from your database to a file and let me see it. Obviously the code you use to get the array is of no use for debugging - I do not use the EZmSQL UDF nor do I have access to the data. So that is the only way I can see to let me test.

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

 

Share this post


Link to post
Share on other sites

I wouldn't spend any effort on it as it is something I have worked around and is clearly something in my values and arrays that are causing the issues.  Thanks for your feedback and assistance with it.

 

Very pleased with the tooltips functions you added.

 

Thanks again M23

Share this post


Link to post
Share on other sites

bourny,

My pleasure as always.

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

 

Share this post


Link to post
Share on other sites

Noticed a feature on the tooltip.  you have to click on a cell in a different column to get another tooltip to work.  

Share this post


Link to post
Share on other sites

bourny,

No, you just have to click on a different cell as the function looks for a change in either the row or column that has been clicked.  Would you like to have the ability to click the same item twice in succession? That should not be too difficult to arrange (famous last words!)

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

 

Share this post


Link to post
Share on other sites

bourny,

For once it was easy:  GLVEx_Mod.zip

And now I am on my home ISP I can upload again!

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

 

Share this post


Link to post
Share on other sites

bourny,

I have been rethinking you request for the combo edit to be as wide as the dropdown and I can see some merit in allowing any usable edit (manual or combo) to be wider than the column. So I have changed the way you set the "edit width" for each column - you now use the new _GUIListViewEx_SetEditWidth function to pass an array holding the required widths (so the parameter I added to _GUIListViewEx_ComboData is no longer required). The value passed in the array is used to set the width of the edit, except for read-only combos where I felt that as the edit cannot be used there was little point. But in order to forestall complaints, if you set a negative value as the width, even read-only combos will expand. Could you please test the attached code and let me know if it works for you (you owe me some Beta testing time!):  GLVEx_Mod.zip

Of course, comments from anyone else also welcomed.

M23

 

Edited by Melba23
Beta code removed

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

 

Share this post


Link to post
Share on other sites

Will do M23.  ( I do owe you you are correct. :-))    

I also managed to embed some code into your UDF to allow me to do funky things on clicking of a column. This will allow me to do what I need to redraw the contents of a specific column and add the icons back in if someone resorts it.  Just working out now how I go about doing it but I will get there.

I found on the tooltips that I could not simply get the tooltip of the next entry under the same column unless I clicked on a cell in a different column completely and then navigated back to that column.  Seemed to happen the same way on the example you posted me. not really worried about it as I will simply educate on the feature

Will come back on the results of your new mod

 

Share this post


Link to post
Share on other sites

bourny,

Thanks.

I found on the tooltips that I could not simply get the tooltip of the next entry under the same column unless I clicked on a cell in a different column completely and then navigated back to that column

Not what I see at all - clicking the next entry always brings up that tooltip immediately (which is what should happen). I am tempted to say that you have mucked up the code with some of your personal changes, but as I always assume people are innocent unless proven otherwise... Actually, I have changed the tooltip code slightly in the above beta - do you still see the same thing?

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

 

Share this post


Link to post
Share on other sites

Looks like your example works fine with the new mod.  Bad news is I have somehow stopped mine working with both old and new mod.  Refuses to give me an extended combo.  Troubleshooting my code.  seems like everything is the same and rollback to previous code still the same.  Only windows updates last night applied so will come back as soon as i have fixed it.

 

Share this post


Link to post
Share on other sites

bourny,

Thanks for the report - I will look to release a new version incorporating the "bourny" changes this weekend.

If you want to post the lines you use to invoke the extended combo in both cases I can take a look and see if I can spot anything amiss.  Otherwise I hope you have a good backup system - good luck.

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

 

Share this post


Link to post
Share on other sites

M23.

Managed to fix my drop down not showing full length using the first modified code not your latest.  Thought I would start here to get back to where it was working and find out when it broke.  I found that if I remove all the other "_GUIListViewEx_ComboData" entries for other columns that have no need to have a resized width and just rely on the column header to specify the size it results in breaking the column that has the "_GUIListViewEx_ComboData($iLV_Right_Index, 4, $aFailureReasons, True, $iWidth + 20)" applied to it.

If I apply the ",True,$iWidth" to any other of the combodata enties if fixes the original column so I can see the long data but results in all the other small columns popping up with the same length field as the long combodata.  If I add more combo to your example it behaves as expected not like my script telling me there is something about my code that is caising this

I tried the latest code and this seems to do nothing for me.  Not sure why when I test your example it works perfectly with the same mod.  

So this leaves me with only 2 possibilities.

1. My code has something in it which is causing this

2. My use of _GUICtrlListView_SetColumnWidth, _GUICtrlListView_AddSubItem, _GUICtrlListView_AddItem, and _GUICtrlListView_Create is different from your example where you use GUICtrlCreateListView

I wonder if GUICtrlCreateListView causes it to behave differently than _GUICtrlListView_Create.  I will need to disassemble my lengthy program to put it into some isolated smaller tests to work out why mine does not behave as your example does.

For the moment I can put up with the long combo drop downs on the small columns until I work out the issue.

 

 

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

×
×
  • Create New...