Sign in to follow this  
Followers 0
AndiDomiK

Listview/ Create new Item on double clicking last row,edit Cols separately

4 posts in this topic

#1 ·  Posted (edited)

Hi Guys,

Heres the Script:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
$i = 0
Example()
Func Example()
    Local $listview, $button, $item1, $item2, $item3, $msg
Local $itemArray[50][3]
    GUICreate("listview items", 220, 250, 100, 200, -1, $WS_EX_ACCEPTFILES)
    GUISetBkColor(0x00E0FFFF) ; will change background color
    $listview = GUICtrlCreateListView("col1  |col2|col3  ", 10, 10, 200, 150);,$LVS_SORTDESCENDING)
    $button = GUICtrlCreateButton("Value?", 75, 170, 70, 20)
$itemArray[0][0] = GUICtrlCreateListViewItem("...  |  |  ", $listview)

    GUICtrlCreateInput("", 20, 200, 150)
    GUICtrlSetState(-1, $GUI_DROPACCEPTED) ; to allow drag and dropping
    GUISetState()

    Do
        $msg = GUIGetMsg()
        Select
            Case $msg = $button
                MsgBox(0, "listview item", GUICtrlRead(GUICtrlRead($listview)), 2)
            Case $msg = $listview
                MsgBox(0, "listview", "clicked=" & GUICtrlGetState($listview), 2)
   Case $msg = $itemArray[$i][0]  ;Get it to only do the case on doubleclicking///This Case should change to $msg = $item5 when done, after that $item6, etc
    GUICtrlSetData($itemArray[$i][0],"insert on click|insert on click|insert on click")
    $itemArray[$i+1][0] = GUICtrlCreateListViewItem("...  |  |  ", $listview)
    $i=$i+1
    ;$item5 = GUICtrlCreateListViewItem("...  |  |  ", $listview)
        EndSelect
    Until $msg = $GUI_EVENT_CLOSE
_ArrayDisplay($itemArray)
EndFunc   ;==>Example

And here are my problems :oops: :

1. Not quite sure how to only create new array dimension== new row on double clicking.

2. How can i change the entry of each col/dimension square by clicking on it once?

Edited by AndiDomiK

Share this post


Link to post
Share on other sites



AndiDomiK,

This thread shows how to fill an array in a loop without declaring its size beforehand. :oops:

This thread shows how to edit the different items within a listview - you will need to get rid of quite a lot of stuff you do not need, but the basic code you do require is in there. :bye:

M23

1 person likes this

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

Awesome, thank you very much, google only showed me outdated, not working examples when I searched.

This is exactly what i need :oops:

Share this post


Link to post
Share on other sites

AndiDomiK,

Glad I could help. :oops:

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

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
Sign in to follow this  
Followers 0