Jump to content
Melba23

GUIListViewEx - New Version 22 Feb 18

Recommended Posts

Biatu

Just for aesthetics, one of my UI concepts for an updater had a Listview with with available updates, and I wanted to put a button in a right most column to view the update notes. Another one was a Todo list with 3 buttons for task specific actions. Personally I think this would be better than needing to click on an item then on a button off on the edge of the ListView


What is what? What is what.

Share this post


Link to post
Share on other sites
BigDaddyO

I just tried to run one of my existing scripts in the new version of AutoIT and I got an error as part of the _GUIListViewEx_EditOnClick() function.

error: _WinAPI_GetAsyncKeyState(): undefined function

 

Adding #include <WinAPISys.au3> to the top of the GUIListViewEx.au3 resolved the problem.


Share this post


Link to post
Share on other sites
Melba23

BigDaddyO,

jpm strikes again with his repackaging of the more obscure WinAPI functions - sorry about that. I think I will just add a suitable "internal use only" function ( all 4 lines of it!) to the UDF rather then add a 1500+ line include file. Look out for a new release in the UDF thread shortly.

In future, could you post any problems with my UDFs in the associated thread because it is much easier to notice them then as opposed to a post somewhere in GH&S

M23

Edit; There are actually another couple of WinAPI functions in the UDF the locations of which jpm has rearranged - just checking again.

Edited by Melba23

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

Spoiler

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

 

Share this post


Link to post
Share on other sites
BigDaddyO

I have been using these so much, I forgot they were UDF's and not normal Functions.

Great UDF's by the way!


Share this post


Link to post
Share on other sites
Melba23

BigDaddyO,

It got too complicated to add all the WinAPI functions internally, so I will go with the simple added include file that you suggested and hope jpm does not fiddle with the locations again in the near future! Thanks for the report - and delighted you like my UDFs.

M23

P.S. I will merge this thread into the main UDF one when I have released the new version later today.


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

Spoiler

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

 

Share this post


Link to post
Share on other sites
Melba23

[NEW VERSION] - 22 Feb 18

Changed:

Added an include file to cater for a rearrangement of the WinAPI functions in v3.3.14.3.

New UDF in the first post.

M23


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

Spoiler

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

 

Share this post


Link to post
Share on other sites
x_bennY

Hey @Melba23

I'm using your UDF and i have one doubt. When i drag and drop an item it resizes the columns and i don't want it! How could i disable this?

Edited by x_bennY

Share this post


Link to post
Share on other sites
Melba23

x_bennY,

Please provide me with a small reproducer script and a set of instructions so that I can see just what you are doing.

M23

  • Like 1

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

Spoiler

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

 

Share this post


Link to post
Share on other sites
x_bennY

Hi @Melba23

Sorry for not being clear. Here is the script:

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

#include "GUIListViewEx.au3"

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

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

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

; Create Left ListView
GUICtrlCreateLabel("Native ListView", 10, 5, 300, 30)

$cListView_Left = GUICtrlCreateListView("Tom|Dick|Harry", 10, 40, 300, 300)
_GUICtrlListView_SetExtendedListViewStyle($cListView_Left, $LVS_EX_FULLROWSELECT)
; 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 " & $i
    EndIf
    GUICtrlCreateListViewItem($aLV_List_Left[$i], $cListView_Left)
Next

; Initiate LVEx - use filling array - no count parameter - default insert mark colour (black) - drag image - sortable + not select all text + editable headers
$iLV_Left_Index = _GUIListViewEx_Init($cListView_Left, $aLV_List_Left, 0, 0, True, 1 + 2 + 8)


_GUIListViewEx_MsgRegister()

GUISetState()

; Set the left ListView as active
_GUIListViewEx_SetActive(1)

_GUICtrlListView_SetColumnWidth($cListView_Left, 0, 50)
_GUICtrlListView_SetColumnWidth($cListView_Left, 1, 50)
_GUICtrlListView_SetColumnWidth($cListView_Left, 2, 50)

msgbox(0,0, "Drag n drop one of the itemns to see what happens...")

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSe
            Exit

    endswitch
    $vRet = _GUIListViewEx_EventMonitor($iEditMode) ; Use combos to change EditMode
    If @error Then
        MsgBox($MB_SYSTEMMODAL, "Error", "Event error: " & @error)
    EndIf
    Switch @extended
        Case 4
            msgbox(0,0, "The columns width changes.")
    EndSwitch
WEnd

 

Edited by x_bennY

Share this post


Link to post
Share on other sites
Melba23

x_bennY,

That is an unfortunate "feature" of the ListView control - it tries to display the full width of all items when they are inserted - and nothing to do with my UDF as such.

I added an optional parameter for inserting elements which automatically reset the column widths - you can do something similar in the short term:

<snip>

I will take a look and see if I can get the UDF to do this automatically for drag/drop by using an optional parameter somewhere.

M23

Edit:

Actually a pretty easy fix to get the UDF to do this - I am assuming that all column widths will remain constant when drag/drop is used. Try this Beta version and let me know what you think:  GUIListViewEx_Test.au3

Edited by Melba23
Added beta code
  • Like 1

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

Spoiler

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

 

Share this post


Link to post
Share on other sites
x_bennY

@Melba23

Wow! excellent as always!  this is exactly what i was talking about.

Don't know how to thank....

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

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