Sign in to follow this  
Followers 0
drbothen

Help with arraydisplay

4 posts in this topic

I have been searching for several days and have not found anything that works the way it needs to. I believe a mod needs to be done to the array.au3 file in the arraydisplay section. Basically i need to feed in a CSV into an array ( i have that figured out ) and then display it. I need to be able to copy a single selected or multiple selected cells from the resulting table that is created with arraydisplay. I am at a lost. Thanks in advance.

Share this post


Link to post
Share on other sites



You can only select one or multiple lines and copy them to the clipboard.

If you need more, you'll have it to code yourself.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

background on on my script. I work in the IA field and have created several scripts that automate over 300 checks and spits out a report thats a CSV the seperator is a comma. I then use Autoit for serveral other tools as well as creating a nice gui for a polished look. then line of code i need help on is the following

$aArray = _CSV2Array("Reports\"&@Computername&"_IE8CHECKS_GoldDisk_Version.txt", ",")
    _ArrayDisplay($aArray, "IE8 Checks", -1, 0, "", "", "#|Check Number|Status|Comment|Date & Time")

I beleive the following needs to be modded to allow for selecting single cells and copying the data from that single selected cell

GUISetState(@SW_SHOW, $hGUI)

    While 1
        Switch GUIGetMsg()
            Case $_ARRAYCONSTANT_GUI_EVENT_CLOSE
                ExitLoop

            Case $hCopy
                Local $sClip = ""

                ; Get selected indices [ _GUICtrlListView_GetSelectedIndices($hListView, True) ]
                Local $aiCurItems[1] = [0]
                For $i = 0 To GUICtrlSendMsg($hListView, $_ARRAYCONSTANT_LVM_GETITEMCOUNT, 0, 0)
                    If GUICtrlSendMsg($hListView, $_ARRAYCONSTANT_LVM_GETITEMSTATE, $i, 0x2) Then
                        $aiCurItems[0] += 1
                        ReDim $aiCurItems[$aiCurItems[0] + 1]
                        $aiCurItems[$aiCurItems[0]] = $i
                    EndIf
                Next

                ; Generate clipboard text
                If Not $aiCurItems[0] Then
                    For $sItem In $avArrayText
                        $sClip &= $sItem & @CRLF
                    Next
                Else
                    For $i = 1 To UBound($aiCurItems) - 1
                        $sClip &= $avArrayText[$aiCurItems[$i]] & @CRLF
                    Next
                EndIf
                ClipPut($sClip)
        EndSwitch
    WEnd
    GUIDelete($hGUI)

    Opt("GUIOnEventMode", $iOnEventMode)
    Opt("GUIDataSeparatorChar", $sDataSeparatorChar)

    Return 1
EndFunc   ;==>_ArrayDisplay

I found this that allows for single cell selection kind of but i need to use arraydisplay so this does not work and im not sure how to moddify array display to alow single cell section and data copy

#include <GuiMenu.au3>
#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>

$hGUI = GUICreate('Read ListView Item', 400, 300)
$hListView = _GUICtrlListView_Create($hGUI, "", 2, 2, 394, 268)
_GUICtrlListView_SetExtendedListViewStyle($hListView, BitOr($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT))
;_GUICtrlListView_SetExtendedListViewStyle($hListView, $LVS_EX_GRIDLINES)
GUISetState()

GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")

; Add columns
_GUICtrlListView_InsertColumn($hListView, 0, "Column 1", 100)
_GUICtrlListView_InsertColumn($hListView, 1, "Column 2", 100)
_GUICtrlListView_InsertColumn($hListView, 2, "Column 3", 100)

; Add items
_GUICtrlListView_AddItem($hListView, "Row 1: Col 1", 0)
_GUICtrlListView_AddSubItem($hListView, 0, "Row 1: Col 2", 1)
_GUICtrlListView_AddSubItem($hListView, 0, "Row 1: Col 3", 2)
_GUICtrlListView_AddItem($hListView, "Row 2: Col 1", 1)
_GUICtrlListView_AddSubItem($hListView, 1, "Row 2: Col 2", 1)
_GUICtrlListView_AddItem($hListView, "Row 3: Col 1", 2)

GUISetState()

; Loop until user exits
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE

Func ListView_Click()

    
EndFunc   ;==>ListView_Click


Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
    
    Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo
    $hWndListView = $hListView
    If Not IsHWnd($hListView) Then $hWndListView = GUICtrlGetHandle($hListView)

    $tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
    $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
    ;$iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
    $iCode = DllStructGetData($tNMHDR, "Code")
    Switch $hWndFrom
        Case $hWndListView
            Switch $iCode
                Case $NM_CLICK ; Sent by a list-view control when the user clicks an item with the left mouse button
                    Local $aHit = _GUICtrlListView_SubItemHitTest($hListView) ; Get id of clicked item
                    If $aHit[0] <> -1 Then ; Check it was an item
                        Local $sText = _GUICtrlListView_GetItemText($hListView, $aHit[0], $aHit[1]); Read the item text
                        ConsoleWrite($sText & @CRLF) ; Display it
                    EndIf
                    Return 0
            EndSwitch
    EndSwitch
        
    Return $GUI_RUNDEFMSG
    
EndFunc   ;==>WM_NOTIFY

any and all help is apriciated

Share this post


Link to post
Share on other sites

I an not at my PC at the moment - I will reply with more detail later. Search for the table udf - this might do what you need.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

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