Jump to content

Recommended Posts

Posted

Viva,

You're completely right! :graduated:

The only thing I can do is ask my apologies for this inattention.

Your request will be honored only misjudged, it would not be a limitation of the UDF.

Thanks for the clarification

hug

  • Moderators
Posted

NunoBorges,

Nenhum problema! :graduated:

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

 

  • 8 months later...
Posted

Melba i need your help again. :/

It works great after some messing around ;)

Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam)
    #forceref $hWnd, $iMsg, $wParam
    ; Struct = $tagNMHDR and "int Item"
    Local $tStruct = DllStructCreate("hwnd;uint_ptr;int_ptr;int", $lParam)
    Local $hWndFrom, $iCode, $iIndex, $choice
    $iCode = DllStructGetData($tStruct, 3)
    Switch $iCode
        Case $NM_DBLCLK
            $hWndFrom = HWnd(DllStructGetData($tStruct, 1))
            $iIndex = DllStructGetData($tStruct, 4)
            Switch $hWndFrom
                Case $testlist
                    $choice = _GUICtrlListView_GetItemText($testlist, $iIndex)
     If $choice <> "" Then
                    _GUICtrlListView_AddItem($testselection, $choice, 0)
     EndIf
                    _GUICtrlListView_DeleteItem($testlist, $iIndex)
                Case $testselection
                    $choice = _GUICtrlListView_GetItemText($testselection, $iIndex)
     If $choice <> "" Then
                    _GUICtrlListView_AddItem($testlist, $choice, 0)
     EndIf
                    _GUICtrlListView_DeleteItem($testselection, $iIndex)
            EndSwitch
   Case $nm_click
   $hWndFrom = HWnd(DllStructGetData($tStruct, 1))
            $iIndex = DllStructGetData($tStruct, 4)
            Switch $hWndFrom
                Case $testlist
                 
                Case $testselection
                    $iLV_Right_Index = _GUIListViewEx_Init($testselection, $aIndex, 0, 0xFF0000)
      _GUIListViewEx_DragRegister()
            EndSwitch
  
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc   ; WM_NOTIFY

But can't do the double click thing after the drag & drop..with single click.

I think it stuck in this action and never leave by it selve.

  • Moderators
Posted

Spenhouet,

It works great after some messing around

Better to use the UDF properly and then there is no need to "mess around". :)

Take a look at this - you can drag the items within a listview and double click to transfer items from one to the other. I have commented the UDF lines so you can follow easily: :)

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

#include "GUIListViewEx.au3"

$Form1 = GUICreate("Tests", 426, 220, 352, 147)

$testlist = _GUICtrlListView_Create($Form1, "", 56, 15, 353, 70, BitOR($WS_HSCROLL, $WS_VSCROLL, $WS_BORDER, $LVS_REPORT, $LVS_NOCOLUMNHEADER), 0)
GUICtrlSetFont(-1, 12, 400, 0, "Arial Narrow")
_GUICtrlListView_AddColumn($testlist, "", 335)

;Initialise the listview with an empty array <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$itestlist_Index = _GUIListViewEx_Init($testlist, "", 1, 0, False, True)

; Use the UDF to add the items <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
_GUIListViewEx_Insert("Set up profile (no-account)")
_GUIListViewEx_Insert("Set up profile (only I)")
_GUIListViewEx_Insert("Adjust profile (add S)")
_GUIListViewEx_Insert("Set up profile (IS)")

$testselection = _GUICtrlListView_Create($Form1, "", 56, 125, 353, 50, BitOR($WS_HSCROLL, $WS_VSCROLL, $WS_BORDER, $LVS_REPORT, $LVS_NOCOLUMNHEADER), 0)
GUICtrlSetFont(-1, 12, 400, 0, "Arial Narrow")
_GUICtrlListView_AddColumn($testselection, "", 335)

; Initialise the listview with an empty array <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$itestselection_Index = _GUIListViewEx_Init($testselection, "", 1, 0, False, True)

$test = GUICtrlCreateButton("Test", 320, 175, 90, 30, 0)
GUICtrlSetFont(-1, 12, 400, 0, "Arial Narrow")
$manual = GUICtrlCreateButton("Manual", 216, 175, 90, 30, 0)
GUICtrlSetFont(-1, 12, 400, 0, "Arial Narrow")

GUISetState(@SW_SHOW)

; You register WM_NOTIFY <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
; So the UDF need only register WM_MOUSEMOVE and WM_LBUTTONUP - we call the WM_NOTIFY handler from within the existing handler <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
_GUIListViewEx_DragRegister(False, True, True)


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam)
    #forceref $hWnd, $iMsg, $wParam

    ; Struct = $tagNMHDR and "int Item"
    Local $tStruct = DllStructCreate("hwnd;uint_ptr;int_ptr;int", $lParam)

    Local $hWndFrom, $iCode, $iIndex, $sText
    $iCode = DllStructGetData($tStruct, 3)
    Switch $iCode
        Case $NM_DBLCLK
            $hWndFrom = HWnd(DllStructGetData($tStruct, 1))
            $iIndex = DllStructGetData($tStruct, 4)
            Switch $hWndFrom
                Case $testlist
                    $sText = _GUICtrlListView_GetItemText($testlist, $iIndex)
                    ; Here we use the UDF to delete and add the items <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                    _GUIListViewEx_Delete()
                    _GUIListViewEx_SetActive($itestselection_Index)
                    _GUIListViewEx_Insert($sText)
                Case $testselection
                    $sText = _GUICtrlListView_GetItemText($testselection, $iIndex)
                    _GUIListViewEx_Delete()
                    _GUIListViewEx_SetActive($itestlist_Index)
                    _GUIListViewEx_Insert($sText)
            EndSwitch
    EndSwitch

    ; And here we call the UDF WM_NOTIFY handler <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    _GUIListViewEx_WM_NOTIFY_Handler($hWnd, $iMsg, $wParam, $lParam)

    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_NOTIFY

Please ask if you have any questions. ;)

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

Spenhouet,

After drag & drop i can't move the Items from box to box...

What exactly are you "dragging and dropping"? The script allows you to "drag" items within a ListView to reorder their position - not "drag and drop" between them. ;)

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)

Spenhouet,

What exactly are you "dragging and dropping"? The script allows you to "drag" items within a ListView to reorder their position - not "drag and drop" between them. ;)

M23

Year i know :) This is exactly what it do.

But i do 2 actions.

1. Move Item in the other Box by double click.

2. In the second box -> sort by drag and drop.

But when i clicked in the second box to drag and drop... i no longer can use the double click action.

Here my Script for you :)

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <C:UsersuserDocumentsOutlook Plug-In Testhorizonincludeguidealtests.au3>
#include "GUIListViewEx.au3"
#include <Array.au3>

$Form1 = GUICreate("Tests", 390, 190, 352, 147)

$testlist = _GUICtrlListView_Create($Form1, "", 20, 15, 350, 75, BitOR($WS_HSCROLL, $WS_VSCROLL, $WS_BORDER, $LVS_REPORT, $LVS_NOCOLUMNHEADER), 0)
GUICtrlSetFont(-1, 12, 400, 0, "Arial Narrow")
_GUICtrlListView_AddColumn($testlist, "", 330)
$itestlist_Index = _GUIListViewEx_Init($testlist, "", 1, 0, False, True)
Global $aIndex = addtomenu()
_ArrayPush($aIndex, "")
local $k = 0
While $aIndex[$k] <> ""
   _GUIListViewEx_Insert($aIndex[$k])
   $k += 1
WEnd

$testselection = _GUICtrlListView_Create($Form1, "", 20, 95, 350, 50, BitOR( $WS_HSCROLL,$WS_VSCROLL, $WS_BORDER, $LVS_REPORT, $LVS_NOCOLUMNHEADER), 0)
GUICtrlSetFont(-1, 12, 400, 0, "Arial Narrow")
_GUICtrlListView_AddColumn($testselection, "", 330)
$itestselection_Index = _GUIListViewEx_Init($testselection, "", 1, 0, False, True)

$test = GUICtrlCreateButton("Test", 280, 150, 90, 30, 0)
GUICtrlSetFont(-1, 12, 400, 0, "Arial Narrow")

GUISetState(@SW_SHOW)
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
_GUIListViewEx_DragRegister(False, True, True)


While 1
   $nMsg = GUIGetMsg()
   Switch $nMsg
   Case $GUI_EVENT_CLOSE
   Exit
   Case $test
   
   EndSwitch
WEnd

Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam)
    #forceref $hWnd, $iMsg, $wParam
    Local $tStruct = DllStructCreate("hwnd;uint_ptr;int_ptr;int", $lParam)
    Local $hWndFrom, $iCode, $iIndex, $choice
    $iCode = DllStructGetData($tStruct, 3)
    Switch $iCode
        Case $NM_DBLCLK
            $hWndFrom = HWnd(DllStructGetData($tStruct, 1))
            $iIndex = DllStructGetData($tStruct, 4)
            Switch $hWndFrom
                Case $testlist
                    $sText = _GUICtrlListView_GetItemText($testlist, $iIndex)
    
      If $sText <> "" Then
                    _GUIListViewEx_Delete()
                    _GUIListViewEx_SetActive($itestselection_Index)
                    _GUIListViewEx_Insert($sText)
     EndIf
                Case $testselection
                    $sText = _GUICtrlListView_GetItemText($testselection, $iIndex)
    
                  
     If $sText <> "" Then
      _GUIListViewEx_Delete()
                    _GUIListViewEx_SetActive($itestlist_Index)
                    _GUIListViewEx_Insert($sText)
     EndIf
            EndSwitch
   Case $nm_click
   $hWndFrom = HWnd(DllStructGetData($tStruct, 1))
            $iIndex = DllStructGetData($tStruct, 4)
            Switch $hWndFrom
;~               Case $testlist
                
                Case $testselection
                    $iLV_Right_Index = _GUIListViewEx_Init($testselection, $aIndex, 0, 0xFF0000)
      _GUIListViewEx_DragRegister()
            EndSwitch
  
    EndSwitch
_GUIListViewEx_WM_NOTIFY_Handler($hWnd, $iMsg, $wParam, $lParam)
    Return $GUI_RUNDEFMSG
EndFunc   ; WM_NOTIFY
Edited by Spenhouet
  • Moderators
Posted

Spenhouet,

Just remove the $nm_click Case from the handler - there is no need to initialise and register the UDF a second time. ;)

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

 

  • 8 months later...
  • Moderators
Posted

[bUGFIX VERSION] - 23 Feb 13

Fixed: Error adding a delimited string to an originally empty multiple column ListView created with the native function. Thanks to Garp99HasSpoken for pointing it out. :thumbsup:

New script and zip in 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

 

  • Moderators
Posted

[FURTHER BUGFIX VERSION] - 23 Feb 13

Sorry, there was a further problem brought to light by fixing the earlier one - that is now fixed too. Please download again if you downloaded the version from earlier 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

 

  • 3 weeks later...
  • Moderators
Posted

[NEW VERSION] - 14 Mar 13

New: Items and subitems can now be edited directly within the ListView. The $fSort parameter has been replaced by $iAdded:

0 = No sort or edit

1 = Sort, no edit

2 = Edit, no sort

3 = Both edit and sort

To get the editing to work the new _GUIListViewEx_Edit function must be placed in the script idle loop and the _GUIListViewEx_WM_NOTIFY_Handler function either registered or placed in an existing handler. Editing is initiated by double-clicking an item - the user can define which columns are editable via the parameter of the _GUIListViewEx_Edit function. Any use of the mouse or actioning of any other controls on the GUI abandons the editing process - normally editing is actioned by ENTER key or cancelled by ESCAPE. This change is not script-breaking as the True/False value of $fSort is mirrored by the 0/1 values of $iAdded. Thanks to johnmcloud for the idea. :thumbsup:

Added: Just as with dragging, the _GUIListViewEx_Up/Down functions now work on multiple selections. Again thanks to johnmcloud for the push to get it working. ;)

New UDF, examples and zip in fiirst 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

 

  • 2 weeks later...
Posted

Melba, your timing is perfect! I need to update a script I wrote a few years ago... since there was no provision for editing I had to create some kludgy things to let the user edit a line (16 columns in my listview).

First, one thing I see from the example: If I doubleclick on an item to edit, I can't use the mouse to locate the cursor within the existing text, though I can arrow to the left.

Enter completes the edit... a great enhancement would be for tab to also complete the edit, and move to editing the next colum. This would make it a lot easier to edit multiple columns on a line.

Do I understand correctly that if I don't pass an array name to _GUIListViewEx_Init, it creates one from the ListView data? I ask because for what seemed a good reason at the time, I didn't use an array to fill the listview; the displayed data is slightly massaged from the original data array (I'm displaying hours and minutes as hh:mm, but the original data array just stores minutes). I could easily (if tediously) rewrite that portion to create another array with the actual listview data, but if I don't have to...

Finally, with _GUIListViewEx_Edit in the idle loop, I couldn't see any way to determine just which item (subitem) was edited? This is important because as I said above, the displayed text is hh:mm, and I need to convert that back to just minutes for both the master array and to calculate the totals.

But thanks, even if I have to rewrite my script to accomodate the UDF as I currently understand it, it will be a lot cleaner.

  • Moderators
Posted

Dana,

Glad you like the changes. :)

First reaction to the requests:

- 1. Use mouse in edit: Something I tried to do already - I will return to the fray and try again. :sweating:

- 2. Tab to next column: Should be doable (famous last words no doubt!). :D

- 3. Existing ListView data transformed into the "shadow" array: The UDF does not do this at present - you need to have the data in an existing array which you tell the UDF to use as its "shadow" array and which it then keeps matched to the ListView content. I will look into how using the existing data as the array might be incorporated for lazy coders - but this will be the lowest priority item. :P

- 4. Return details of item/subitem edited: At the moment the function returns the modified array, but I could easily add a further parameter to the function call to offer a choice. I envisage this return as a 2D array ([item][subitem]) to cater for the "multiple edits in the same call" request above. ;)

I will start work on this later today and post beta versions here for you (and others) to play with as I develop them. :)

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 (edited)

Dana,

I think I have managed to deal with items 1, 2, and 4 - here is a beta version to play with while I look into item 3. Let me know what you think of it so far:

The UDF - save as GUIListViewEx_Mod.au3 - and example:

< Code removed - see new Beta below >

And of course comments from anyone else reading are also welcome. :)

M23

Edited by Melba23
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)

Wow, thanks! #3 really isn't needed, though... it was less work than I thought to fill the listview from the array, I had some of the building blocks in place already. I'll play with the new version after lunch, with the example... I still can't get editing to work with my script, though.

I create the listview:

$hdatalist = GUICtrlCreateListView("||||||||||||||||", 10, 75, $w - 20, $h - 200, BitOR($LVS_SINGLESEL, $LVS_SHOWSELALWAYS, $LVS_NOSORTHEADER), BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT))

I then create $listarray and fill it with data from a file, and use it to fill the listview using GUICtrlCreateListViewItem and _GUICtrlListView_AddSubItem

I then have

$iLVIndex = _GUIListViewEx_Init($hdatalist, $listarray, 0, 0, 2, False)
_GUIListViewEx_SetActive($iLVIndex)

Then I set up scrollbars and some other code to adjust header and totals positions, and finally the main idle loop:

While 1 ; wait for button clicks or window adjustment
Sleep(100) ; keep the GUI from eating up all the CPU cycles

If _GUIListViewEx_Edit("1;2;3;4;5;6;7;8;9;10;11;12;13;14;15") Then
; put code to recalculate here
ConsoleWrite("edited" & @CRLF)
EndIf

; stuff related to scrolling and column resizing here

Wend

Anyway, after all this, doubleclicking or clicking twice on an item in the listview does absolutely nothing. I've tried removing the various listview styles, and took the GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") out (it led to my old edit routine).

I also tried using _GUIListViewEx_Edit() all by itself, no joy.

Am I missing something?

Edited by Dana
  • Moderators
Posted

Dana,

If you could post some runnable code then I will take a look at it - otherwise I am just guessing that you are somehow not calling the UDF WM_NOTIFY handler. ;)

Meanwhile I will continue work on item 3 - it does not seem too difficult to do now I have started on it. Looking forward to your comments on the posted beta and example once your appetite is dealt with - bon appetit. :)

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 (edited)

Dana,

Easier than I thought to get item 3 working - see new _GUIListViewEx_ReadToArray function. :)

New beta UDF and example:

< Code removed - see new Beta below >

I hope the example comments and function header are clear enough. :)

M23

Edited by Melba23
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

Dana,

If you could post some runnable code then I will take a look at it - otherwise I am just guessing that you are somehow not calling the UDF WM_NOTIFY handler. ;)

Over 2000 lines, hard to chop something meaningful out.

Looking good in the demo... still problematic in my script. I realize I have to have

_GUIListViewEx_DragRegister(True, False, True)
in my script... didn't realize it wasn't just for dragging (which I don't want). Now I can doubleclick and get an edit field, but the original text doesn't display and nothing I type appears. The array returned by
$editlist = _GUIListViewEx_Edit("1;2;3;4;5;6;7;8;9;10;11;12;13;14;15") ;
    _ArrayDisplay($editlist, @error)
always shows 0,0 no matter where in the listview I doubleclick, with @error = 0.

Could there be an issue because I'm using GUIOnEventMode instead of GUIGetMsg()?

Dana

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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