Jump to content

Recommended Posts

  • Moderators
Posted

robertocm,

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

 

Posted

Is it possible to change the font and associated attributes for all items in a UDF List View? GUISetFont() doen'st do it, nor does GUICtrlSetFont(). Otherwise, the font is much to small for my needs.

Thank you.

 

  • Moderators
Posted

Jorge11,

Use GUICtrlSetFont when creating the ListView - look at line #22 in the Example_1 script in the download zip.

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

 

Posted (edited)

Hi, @Melba23 !  I'm getting an error return from one of the functions in your UDF which puzzles me. _GUIListViewEx_SetColour() is returning 4 ("Invalid row/col") when both row and col are zero, which since those paremeters are zero-based, should be acceptable.

Here's a working snippet of my code:

#include <Misc.au3>
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>

#include "GUIListViewEx.au3"    ; By Melba23 ; See: https://www.autoitscript.com/forum/topic/182492-guilistviewex-bugfix-version-26-apr-19/


Global Const $Gc_WhiteColorStr  = "0xFFFFFF"
Global Const $Gc_RedColorStr    = "0xFF0000"
Global Const $Gc_Title = "Test"
Global $G_CurrentVidCount = 2
Global $G_CurrentVidList[2][4] = [ ["One", 0, 0, 0], ["Two", 0, 0, 0] ]

Local $L_Stat, $L_Error, $L_LVExID, $L_ColorSet

Global $G_LViewID = GUICtrlCreateListView( "Name", 464,266,-1,-1, _
                    BitOr($LVS_ALIGNLEFT, $LVS_SHOWSELALWAYS, $LVS_SINGLESEL), _
                    BitOR($LVS_EX_DOUBLEBUFFER, $LVS_EX_GRIDLINES, $LVS_EX_FLATSB, $LVS_EX_TRACKSELECT) )
If $G_LViewID = 0 Then
    $L_Error = @error
    MsgBox($MB_OK, $Gc_Title, "GUICtrlCreateListView() - @error= " & $L_Error)
    Exit
EndIf

_GUICtrlListView_SetExtendedListViewStyle($G_LViewID, _
                        BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_DOUBLEBUFFER, $LVS_EX_GRIDLINES, $LVS_EX_FLATSB, $LVS_EX_TRACKSELECT) )

GUICtrlSetFont( $G_LViewID, 16, $FW_NORMAL, $GUI_FONTNORMAL, "Anonymous Pro", $PROOF_QUALITY )

$L_LVExID = _GUIListViewEx_Init( $G_LViewID, "", 0, Default, False, 32+64+256 )
$L_Stat = _GUIListViewEx_SetEditStatus( $L_LVExID, "*", 0 )             ; No editing

For $i = 0 To $G_CurrentVidCount -1

    $L_ItemID = _GUICtrlListView_AddItem( $G_LViewID, $G_CurrentVidList[$i][0], Default, 1000 )
    If $L_ItemID = -1 Then
        MsgBox($MB_OK, $Gc_Title, "_GUICtrlListView_AddItem(" & $i & ") Failed -- Aborting")
        Exit
    EndIf

    $L_ColorSet = $Gc_RedColorStr & ";" & $Gc_WhiteColorStr
    $L_Stat = _GUIListViewEx_SetColour( $L_LVExID, $L_ColorSet, $i, 0 )
    If $L_Stat <> 1 Then
        $L_Error = @error
        MsgBox($MB_OK, $Gc_Title, "_GUIListViewEx_SetColour(Red) - @error= " & $L_Error)
    EndIf
Next

Exit

The function fails on its first call. Would you mind helping me understand what I'm doing wrong, please?

 

PS: Regarding that other matter, I'm just about finished preparing a minimal snippet that illustrates the problem, and it doesn't require a second monitor.  Please expect it soon...

 

- - - - - - - - - - -

Never mind, Melba. @Subz very kindly helped me find a solution that doesn't require the coloring parts of your UDF.

Edited by Mbee
  • Moderators
Posted

Mbee,

Sorry for the delay in replying - family duties.

Glad you got the problem sorted - but here is my amended version of your (incomplete) script for future reference:

#include <Misc.au3>
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>

#include "GUIListViewEx.au3" ; By Melba23 ; See : https : / / www.autoitscript.com / forum / topic / 182492 - guilistviewex - bugfix - version - 26 - apr - 19 /


Global Const $Gc_WhiteColorStr = "0xFFFFFF"
Global Const $Gc_RedColorStr = "0xFF0000"
Global Const $Gc_Title = "Test"
Global $G_CurrentVidCount = 2
Global $G_CurrentVidList[2][4] = [["One", 0, 0, 0], ["Two", 0, 0, 0]]

Local $L_Stat, $L_Error, $L_LVExID, $L_ColorSet

$hGUI = GUICreate("Test", 500, 500) ; You need a GUI!!!! <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Global $G_LViewID = GUICtrlCreateListView("Name", 10, 10, -1, -1, BitOR($LVS_ALIGNLEFT, $LVS_SHOWSELALWAYS, $LVS_SINGLESEL))
If $G_LViewID = 0 Then
    $L_Error = @error
    MsgBox($MB_OK, $Gc_Title, "GUICtrlCreateListView() - @error= " & $L_Error)
    Exit
EndIf

_GUICtrlListView_SetExtendedListViewStyle($G_LViewID, _
        BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_DOUBLEBUFFER, $LVS_EX_GRIDLINES, $LVS_EX_FLATSB, $LVS_EX_TRACKSELECT))

GUICtrlSetFont($G_LViewID, 16, $FW_NORMAL, $GUI_FONTNORMAL, "Anonymous Pro", $PROOF_QUALITY)

$L_LVExID = _GUIListViewEx_Init($G_LViewID, "", 0, Default, False, 32)  ;+64+256 )
$L_Stat = _GUIListViewEx_SetEditStatus($L_LVExID, "*", 0)               ; No editing

_GUIListViewEx_MsgRegister() ; If you do not do this they UDF will not work at all <<<<<<<<<<<<<<<<<<<<<<<<<<<<<

GUISetState() ; And this must come AFTER the MsgRegister function if you have colours <<<<<<<<<<<<<<<<<<<

For $i = 0 To $G_CurrentVidCount -1

    ; You must add items to the ListView using the UDF functions or else the UDF does not know they exist <<<<<<<<<<<
    _GUIListViewEx_InsertSpec($L_LVExID, -1, $G_CurrentVidList[$i][0])
    If @error Then
        MsgBox($MB_OK, $Gc_Title, "_GUIListViewEx_InsertSpec(" & $i & ") Failed -- Aborting")
        Exit
    EndIf

    $L_ColorSet = $Gc_RedColorStr & ";" & $Gc_WhiteColorStr
    $L_Stat = _GUIListViewEx_SetColour( $L_LVExID, $L_ColorSet, $i, 0 )
    If $L_Stat <> 1 Then
        $L_Error = @error
        MsgBox($MB_OK, $Gc_Title, "_GUIListViewEx_SetColour(Red) - @error= " & $L_Error)
    EndIf

Next

; And you need an idle loop <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Exit

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

 

  • Moderators
Posted

x_bennY,

Please post a reproductor script which shows the issue - without that there is little I can do.

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

 

Posted

Hi Melba23,

After reading x_bennY's comment a couple of hours ago, I tested this possible issue, so here is what I did :
* Downloaded the whole package from page 1 and unzipped it
* Opened GLVEx_Example_6.au3 in Scite and ran it (Tools => Go)
* Clicked Ok in the 1st message box ("you can drag and reorder... ")
* Checked the "Col" radio button (as "Row" radio button was checked by default)
* Clicked on the "Ins" button (the one placed just under the "Ins/Del" label)

And the error appears immediately, here is a copy of what the Console shows :

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Temp4\GUIListViewEx\GLVEx_Example_6.au3"    
"C:\Temp4\GUIListViewEx\GUIListViewEx.au3" (3805) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
Local $iHdrResize = $aHdrData[3][$iCol]
Local $iHdrResize = ^ ERROR
>Exit code: 1    Time: 5.911

Then I added a line in GUIListViewEx.au3, to show the value of $iCol, just before the error appears :
ConsoleWrite("$iCol = " & $iCol & @CRLF) ; placed at line 3805 so the error will appear now at line 3806

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Temp4\GUIListViewEx\GLVEx_Example_6.au3"    
$iCol = 1
$iCol = 1
$iCol = 2
$iCol = 2
$iCol = 3
$iCol = 3
$iCol = 4
"C:\Temp4\GUIListViewEx\GUIListViewEx.au3" (3806) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
Local $iHdrResize = $aHdrData[3][$iCol]
Local $iHdrResize = ^ ERROR
>Exit code: 1    Time: 5.449

So It seems that the error appears when $iCol = 4 (?)

Also, I had an older version of GUIListViewEx.au3 (dated October 2, 2018) and the same error appears with this older version (at exactly the same line 3805, as the few changes done between the 2 versions are placed after line 4000)

1839402383_Melba23scomparisonof2versions.png.7a267cb0621976fc09d809d0a822badf.png

Hope it helps and good luck

  • Moderators
Posted (edited)

pixelsearch,

Thanks for that information. I see the same problem - working on it.

M23

I believe I have sorted the problem - can you please try this beta code:

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

 

Posted (edited)

@pixelsearch and @Melba23

you guys were faster than me! sorry for not giving more information, and thx for the bug fix.

now i'm getting this error after deleting the last column:
 

$aData_Colour_Ordered[0][0] = $aData_Colour[0][0]

 

is there a easier way to delete all items and columns of a listview?

Edited by x_bennY
  • Moderators
Posted (edited)

x_bennY,

Aaaah!!! This UDF is getting too complicated for its own good!

Try this version:

Quote

is there a easier way to delete all items and columns of a listview?

Dog eaten your Help file? _GUICtrlListView_DeleteAllItems  is what I would suggest - but make sure you read the "Closure and Reloading" section of the guide that comes with the UDF so that you get it all playing together nicely.

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

 

Posted (edited)
3 hours ago, Melba23 said:

x_bennY,

Aaaah!!! This UDF is getting too complicated for its own good!

Try this version: GUIListViewEx_Test.au3

Dog eaten your Help file? _GUICtrlListView_DeleteAllItems  is what I would suggest - but make sure you read the "Closure and Reloading" section of the guide that comes with the UDF so that you get it all playing together nicely.

M23

now it's working! thanks again

i was using that func, but i need to delete the columns, i know that your UDF has a function to delete it, but it don't delete all the columns, i will write one

Edited by x_bennY
Posted (edited)

Hi Melba & x_bennY

Just tried the very last version but got another reproductible issue, on rows this time.
* Run the script and click on Del button 6 times => all 6 visible rows disappear, no more rows in gui ok
* Just click again one time on Del button (7th click) and :

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Temp4\GUIListViewEx\GLVEx_Example_6.au3"    
"C:\Temp4\GUIListViewEx\GUIListViewEx.au3" (5401) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
$avArray[0][0] -= 1
^ ERROR
>Exit code: 1    Time: 6.95

Maybe when the precedent bug is fixed, then what follows won't happen :
* Run the script, click on Col button radio, click on Del 4 times to delete the 4 visible columns, then :
* Click on Row button radio, click one time on Ins (to insert a new row) and :

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Temp4\GUIListViewEx\GLVEx_Example_6.au3"
"C:\Temp4\GUIListViewEx\GUIListViewEx.au3" (1308) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
If $aGLVEx_SrcArray[0][0] = 0 Then $iRow = 0
If ^ ERROR
>Exit code: 1    Time: 8.295

Edited by pixelsearch
  • Moderators
Posted

pixelsearch,

The problem arises when the ListView is completely emptied and then a new item is added - the internal array which the UDF uses to do its magic does not get correctly resized. I can see the problem but finding the solution is going to take a while - please be patient.

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

 

Posted (edited)
On 7/21/2019 at 5:25 AM, Melba23 said:

Mbee,

Sorry for the delay in replying - family duties.

Glad you got the problem sorted - but here is my amended version of your (incomplete) script for future reference:

M23

Thank you, O Great Wise One! :sorcerer: I greatly appreciate your time and efforts, as always.

I hate to bother you again, but I need additional help, whenever higher priority issues grant you a short reprieve...  I want the ListView created with your UDF to have vertical and horizontal scroll bars. The dimensions of the list view will remain fixed, so at least I don't have to worry about resizing.

I see references to scroll bar dimensions in the private section of your UDF, which gave me the impression that your UDF might create and handle them internally, but that doesn't appear to be the case (or at least I couldn't figure out how to use them). So I looked at your ScrollBarEX UDF, which looks utterly awesome -- as usual -- but I couldn't find an example of using your Scroll bars for one of your List Views.

When you get a chance, might you provide a short snippet for me to adapt to my needs?  It needn't be runnable, just an example.

Thanks!

 

P.S: Regarding that other matter, as a temporary fix I simply declared the messed up variables as static, which dubiously :think:seems to work (at least well enough to continue coding and debugging). You have my eternal gratitude!

Edited by Mbee
  • Moderators
Posted

Mbee,

If you run _Example_1 from the UDF download you will see that both the ListViews in that script have scrollbars - so I have no idea why you feel that it cannot cope with them. Windows does all of the scrollbar stuff for ListViews internally (thank goodness) but the UDF can, and will, make allowances so that, for example, a cell being edited is scrolled to be fully visible if required - try double clicking one of the "Mary #" dells in the right-hand ListView to see what I mean.

As to the other matter, I share your doubts as to whether declaring the variables as Static is a "real" solution - you needed to determine just why the assignment was not taking place when the code was run. It seemed to me that your conditional statements were too restrictive and so there were many cases (2 out of 4 in the script you sent me) where the variable was never assigned a value and remained at its original declared empty state

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

 

Posted (edited)
9 hours ago, Melba23 said:

Mbee,

If you run _Example_1 from the UDF download you will see that both the ListViews in that script have scrollbars - so I have no idea why you feel that it cannot cope with them. Windows does all of the scrollbar stuff for ListViews internally (thank goodness) but the UDF can, and will, make allowances so that, for example, a cell being edited is scrolled to be fully visible if required - try double clicking one of the "Mary #" dells in the right-hand ListView to see what I mean.

I apologize for not expressing myself better. It's not that I can't "cope" with the scrollbar UDF, it's simply that I couldn't find an example that explicitly uses them. I did a file search of all of your UDF files and examples for the word "list" and other for the word "view", but none were found. I saw that your Example 1 shows something that looks like a listview, but I could find nowhere where you created a list view, either from your UDF or the built-in function calls. All I could see was labels and checkboxes and the like, but no list view calls.  That's what got me baffled.

At any rate, I've employed your scrollbar UDF in my code and it works perfectly. WOW! What an amazing UDF you delivered to us all. Powerful yet simple to use - wonderful!

Thanks again, Melba

Edited by Mbee
  • Moderators
Posted

Mbee,

Quote

I saw that your Example 1 shows something that looks like a listview, but I could find nowhere where you created a list view

You are joking, right? An example for a ListView based UDF and you say that there is only "something that looks like a listview" in it.

The ListViews in that example script are created in lines #16 (using the native AutoIt function):

$cListView_Left = GUICtrlCreateListView("Tom|Dick|Harry", 10, 40, 300, 300, $LVS_SHOWSELALWAYS)

and Line #49 (using the standard GuiListView library function):

$hListView_Right = _GUICtrlListView_Create($hGUI, "", 430, 40, 200, 300, BitOR($LVS_DEFAULT, $WS_BORDER))

So using my Scrollbars UDF in addition seems to be overcomplicating the matter greatly when Windows does all the scrollbar work automatically for ListViews - but if that is what you want to do.....

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

 

Posted

God, Melba, I'm so incredibly sorry that I annoyed and apparently angered you! Mea Culpa! Mea Culpa!  I understand and regret my mistakes.

I wrote above that I was unable to find the words "list" or "view" in the examples, but very, very stupidly I was searching the wrong example files!

I feel very ashamed...

Posted (edited)

Hi Melba23,

sorry to bother you

$TableList = GUICtrlCreateListView("1|2|3|4|5|6|7|8|9", 398, 36, 802, 248, $LVS_REPORT + $LVS_SINGLESEL + $LVS_NOSORTHEADER, $LVS_EX_FULLROWSELECT  + $WS_EX_CLIENTEDGE)

   If FileExists($ConfigPath & "\Table.txt") Then
      _FileReadToArray($ConfigPath & "\Table.txt", $TableArray, 1, @TAB)
      $TableLabel = GUICtrlCreateLabel("Status - " & $TableArray[0][0] - 1 & " ( A - B )", 404, 16, 260, 20, $SS_CENTERIMAGE)
      $TableUpdate = GUICtrlCreateLabel("Last Update - " & $TableArray[1][0], 1038, 16, 160, 20, $SS_CENTER + $SS_CENTERIMAGE)
      _ArrayDelete($TableArray, "0-1")
   Else
      $TableLabel = GUICtrlCreateLabel("Status - N/A ( A - B )", 404, 16, 260, 20, $SS_CENTERIMAGE)
      $TableUpdate = GUICtrlCreateLabel("Last Update - N/A", 1038, 16, 160, 20, $SS_CENTER + $SS_CENTERIMAGE)
   EndIf

   _GUICtrlListView_AddArray($TableList, $TableArray)
   $TableIndex = _GUIListViewEx_Init($TableList, $TableArray, 0, Default, False, 32 + 512)

    Sleep(3000)

   If FileExists($ConfigPath & "\Table.txt") Then
      _FileReadToArray($ConfigPath & "\Table.txt", $TableArray, 1, @TAB)
      $TableLabel = GUICtrlCreateLabel("Status - " & $TableArray[0][0] - 1 & " ( A - B )", 404, 16, 260, 20, $SS_CENTERIMAGE)
      $TableUpdate = GUICtrlCreateLabel("Last Update - " & $TableArray[1][0], 1038, 16, 160, 20, $SS_CENTER + $SS_CENTERIMAGE)
      _ArrayDelete($TableArray, "0-1")
   Else
      $TableLabel = GUICtrlCreateLabel("Status - N/A ( A - B )", 404, 16, 260, 20, $SS_CENTERIMAGE)
      $TableUpdate = GUICtrlCreateLabel("Last Update - N/A", 1038, 16, 160, 20, $SS_CENTER + $SS_CENTERIMAGE)
   EndIf

   _GUICtrlListView_DeleteAllItems($TableList)
   _GUICtrlListView_AddArray($TableList, $TableArray)

I load the Array text file, and after 3secs, the text file will add more than 2 lines data, but script will be error

"P:\Personal\ABC\AutoIt\Include\GUIListViewEx.au3" (3346) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
If StringInStr(($aGLVEx_Data[0][13])[$iItem + 1][$iSubItem], ";") Then
If StringInStr(($aGLVEx_Data[0][13]^ ERROR

seems index's rows number can't be update (more rows), even add the _Init to update the $TableIndex still crash

$TableIndex = _GUIListViewEx_Init($TableList, $TableArray, 0, Default, False, 32 + 512 + 1024)

sorry for bad English and hope you can understand what I say, Thanks !!!

example :

old file

 A1    A2    A3    A4    A5    A6    A7    A8    A9

new file 

A1    A2    A3    A4    A5    A6    A7    A8    A9
B1    B2    B3    B4    B5    B6    B7    B8   B9
C1    C2    C3    C4    C5    C6    C7    C8    C9

Edited by jimmy123j

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...