Jump to content

GUIListViewEx - Deprecated Version


Melba23
 Share

Recommended Posts

M23 please sorry for my explaining.

try this:

I

1) run this script:

#include <Array.au3>
#include <File.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#Include <ListViewConstants.au3>
#Include <WinAPI.au3>
#include <StructureConstants.au3>

#include "GUIListViewEx.au3"
$Debug_LV = False ; Check ClassName being passed to ListView functions, set to True and use a handle to another control to see it work

Global $hForm, $hListView, $iEditMode = 0
Global $iCount = 50
Global $hListView1

Global $aSubItemSet[1][5] = [[-1]]
Global $hFont, $defColLV = 0x000000, $defBkColLV = 0xFFFFFF
Global $inBkCol = '0x3DF8FF'
Global $inCol = '0xFF0000'
Global $iLV_Index

_Main()

Func _Main()
    $hForm = GUICreate("ListView set width", 400, 300, -1, -1, $WS_OVERLAPPEDWINDOW, $WS_EX_ACCEPTFILES)
    $hListView = GUICtrlCreateListView("column 1", 2, 2, 390, 260, $GUI_DROPACCEPTED)
    GUICtrlSetState(-1, $GUI_DROPACCEPTED)
    $hListView1 = GUICtrlGetHandle($hListView)

    Global $aLV_List[$iCount + 1]
    For $i = 0 To UBound($aLV_List) - 1
        GUICtrlCreateListViewItem('Item ' & $i, $hListView)
    Next


    $iLV_Index = _GUIListViewEx_Init($hListView, $aLV_List, 0, 0x0000FF, False)
    _GUIListViewEx_MsgRegister()
    GUISetState(@SW_SHOW)

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                Exit
            Case $GUI_EVENT_DROPPED
                Drag()
        EndSwitch
    WEnd
EndFunc   ;==>_Main

Func Drag()
    Local $arr = StringSplit(FileRead(@GUI_DRAGFILE), '|', 2)
    _GUIListViewEx_Insert($arr, True)
    ;For $i = 1 To UBound($arr) - 1
    ;    _GUIListViewEx_Insert($arr[$i])
    ;Next
EndFunc

2) drop file.txt: (it can contain any size of items, in example - 10)

1|2|3|4|5|6|7|8|9|0

3) and it will normally adds to end of list.

 

II

1) run this script.

2) select №6 item for this example (1-6 crashes; 7-50 not) i'm trying to drop file with 150 items it crashes on 1-49 items; 50 - not.

3) drop file and it will crash on line №2640 of UDF.

br d2k8

Edited by damien2008
Link to comment
Share on other sites

  • Moderators

damien2008,

I see the problem - and I know where to look to fix it. Standby.... :)

M23

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

Open spoiler to see my UDFs:

Spoiler

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

 

Link to comment
Share on other sites

  • Moderators

damien2008,

Found it. A silly bounds error when copying the moved lines. Try this version: :blush:

<snip>

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

 

Link to comment
Share on other sites

  • Moderators

damien2008,

Good. :thumbsup:

All,

Fixed version now in the first post zip - if you downloaded earlier today, please do so 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

 

Link to comment
Share on other sites

While minding my own script I've encountered quite a bit of flickering when redrawing multiple ListViewEx's (and I've got 6 of them, depening on the choice of an item in the main one, other 5 are refilled with info).

An update in _GUIListViewEx_ReWriteLV fixes this minor problem:

Local $aLV_FillArray = $aLV_Array
_ArrayDelete($aLV_FillArray, 0)

; Delete all items from ListView
_GUICtrlListView_DeleteAllItems ($cLV_CID)
; Add items from array
_GUICtrlListView_AddArray($cLV_CID, $aLV_FillArray)

And, of course, $CBS_AUTOHSCROLL added to the combo control would be nice too, otherwise caret stops at the edge.

Link to comment
Share on other sites

  • Moderators

mjolnirmarkiv,

I added the AUTOHSCROLL to the edit, but I forgot about the combo - now done. :)

And I have rewritten the _GUIListViewEx_ReWriteLV function along the lines you suggested - it was written the way it was because the old _GUICtrlListView_DeleteAllItems function did not work. As I rewrote the function I should have remembered to amend my UDF as well! I blame advancing age. :D

Try this version and see if it works more to your liking:

<snip>

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

 

Link to comment
Share on other sites

Thank you!

I've removed these extra _ArrayDisplay's for you :)

Plus I've replaced _GUICtrlListView_GetItemTextArray with _GUICtrlListView_GetItemText, otherwise I'm getting a crash on trying _GUIListViewEx_ReadToArray with entered separator chars into one of the cells. Among other minor things it worth noting that regular tab doesn't take focus, which makes $hTemp_Edit teleport to another tab during edit, unless you use $TCS_FOCUSONBUTTONDOWN.

GuiListViewEx.au3

Link to comment
Share on other sites

  • Moderators

mjolnirmarkiv,

I am glad you like the changes - and the additional debugging code. ;)

As to reading the array - it is my opinion that if the user wants to use the globalal AutoIt default delimiter character (|) as a character inside the ListView it is up to them to change the global default character using Opt("GUIDataSeparatorChar", "#") at the top of their script, just as I do in the _ArrayDisplay code. Not doing this is likely to cause all sorts of problems with many other AutoIt functions that use the default delimiter and so altering just this UDF to cope with the problem would, I feel, only mask problems elsewhere. So thanks for the suggestion, but I am not incorporating it. ;)

Can you explain in more detail what you say is a focus problem - I do not follow what you are trying to tell me. Perhaps a list of actions to take to induce it? :huh:

M23

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

Open spoiler to see my UDFs:

Spoiler

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

 

Link to comment
Share on other sites

1) On the left: initiating edit by double clicking combo, but do not drop down the list; 2) on the right: and this's what happens when you click on another tab during edit, while ideally it should cancel the edit process.

2wqemib.jpg

I believe this is becase it waits for focus change in _GUIListViewEx_EditProcess, while focus stays the same with tabs unless you change that setting with $TCS_FOCUSONBUTTONDOWN.

If _WinAPI_GetFocus() <> $hTemp_Edit Then
    ExitLoop
EndIf
Link to comment
Share on other sites

  • Moderators

mjolnirmarkiv,

Please post the code you to create that GUI - anything I code is very unlikely to resemble your script, even if I was prepared to do it in the first place. ;)

The problem as I see it is that the UDF-created edit/combo will appear on all tabs - AutoIt only deals automatically with items created inside the tab structure of native-created ListViews. I will take a look to see what I can do to deal with this, but I think it might well be outside the scope of the UDF to deal with tab controls. :(>

M23

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

Open spoiler to see my UDFs:

Spoiler

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

 

Link to comment
Share on other sites

  • Moderators

mjolnirmarkiv,

I found the problem - the code I had written to cancel the edit process when clicking outside an edit control did not work when applied to a combo, even though I had been looking for the combo's edit handle. I have rewritten the relevant code section so that it works for both and it works fine when I run it on my examples. Now I have your code I can test it further and I should be able to post a Beta for you to try tomorrow. Tonight I am in front of the TV watching Europe retain the Ryder Cup! :party:

M23

Edit: Too many custom includes, errors and warnings for me to bother to correct them. If you want help you need to post code that can be run "out of the box" - very few people will spend hours getting a script to run to search for the small detail that lead to errors. So I suppose I will have to write my own script after all. :(>

Edited by Melba23

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

Open spoiler to see my UDFs:

Spoiler

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

 

Link to comment
Share on other sites

mjolnirmarkiv,

I found the problem - the code I had written to cancel the edit process when clicking outside an edit control did not work when applied to a combo, even though I had been looking for the combo's edit handle. I have rewritten the relevant code section so that it works for both and it works fine when I run it on my examples. Now I have your code I can test it further and I should be able to post a Beta for you to try tomorrow. Tonight I am in front of the TV watching Europe retain the Ryder Cup! :party:

Hmm, now when you said that I see that edit cancel indeed works differently for edits and combos, and I thought no edit cancel until another control received focus is by design. Do post updated UDF, please.

Indeed my script is in the middle of major rewrite so it's buggy as it is and on top of all I've disabled few functions previously, that didn't add stability. Here's a new one, which I hope should work without a problem -- I does practically nothing exept creates GUI with listviews with added functionality and resizes it on its own.

MyApp.au3

Edited by mjolnirmarkiv
Link to comment
Share on other sites

  • Moderators

mjolnirmarkiv,

Thanks for that - much easier to use. My new version of the UDF seems to work fine with that script - over to you for more testing: :)

<snip>

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

 

Link to comment
Share on other sites

  • Moderators

mjolnirmarkiv,

Great. I will release a new version later today. :)

M23

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

Open spoiler to see my UDFs:

Spoiler

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

 

Link to comment
Share on other sites

  • Moderators

[bUGFIX VERSION] - 29 Sep 14

Fixed: When using a combo for editing an item the control was not correctly deleted when the edit was interrupted by clicking elsewhere.

Added: The combo edit now scrolls to allow longer strings to be manually inserted.

Thanks to mjolnirmarkiv for the report.

New UDF in the first post. :)

M23

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

Open spoiler to see my UDFs:

Spoiler

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

 

Link to comment
Share on other sites

  • Moderators

[bUGFIX VERSION] - 30 Sep 14

Fixed: A nasty little bug introduced by the last update - sorry about that. :blush:

New UDF in the first post. :)

M23

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

Open spoiler to see my UDFs:

Spoiler

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

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...