Jump to content

_ArrayDisplay trouble


Jewtus
 Share

Recommended Posts

I'm having some issues with _ArrayDisplay and the $iFlags.

_ArrayDisplay($ViewParams,"Entered Values",Default,64+16,@TAB,"First|Middle|Last|Address|Full Name|SearchType")

Here is the syntax breakdown for that variable (I've underlined the two that I'm trying to get)

 

$iFlags [optional] Determine UDF options. Add required values together - default = 0
1 - Transposes the array
2 (right) or 4 (center) - Column text alignment (default = left)
8 - Verbose = display MsgBox on error and splash screens during processing of large arrays
16 - Only 'Copy' buttons displayed
32 - No buttons displayed
64 - No 'Row' column displayed

 

If I try 16 alone and 64 alone and they don't seem to work there either...

Anyone else have this issue?

Link to comment
Share on other sites

Not sure if this is your issue because you only supplied limited details, but the help file states

$sHeader [optional] Column names in header (string of names separated by current separator character - usually "|"). Default see Remarks.

so if you are going to use @Tab for $vUser_Separator, then it looks like you need to use it also instead of '|' in $sHeader.

Link to comment
Share on other sites

  • Moderators

Jewtus,

Works fine for me:

#include <Array.au3>

Global $ViewParams[5][6]

For $i = 0 To 4
    For $j = 0 To 5
        $ViewParams[$i][$j] = $i & " ----------- " & $j
    Next
Next

_ArrayDisplay($ViewParams, "Entered Values", Default, 64+16, @TAB, "First|Middle|Last|Address|Full Name|SearchType")
and I get:

post-38576-0-81754400-1413546909_thumb.p

No row column and only the copy buttons as expected. :)

Danp2,

As explained in the Help file, the $vUser_Separator parameter is only used when copying the content to the clipboard using the buttons - you need to use the currently set delimiter to separate the headers as you can see above. ;)

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

Jewtus,

Works fine for me:

#include <Array.au3>

Global $ViewParams[5][6]

For $i = 0 To 4
    For $j = 0 To 5
        $ViewParams[$i][$j] = $i & " ----------- " & $j
    Next
Next

_ArrayDisplay($ViewParams, "Entered Values", Default, 64+16, @TAB, "First|Middle|Last|Address|Full Name|SearchType")
and I get:

ArrayDisplay.png

No row column and only the copy buttons as expected. :)

Danp2,

As explained in the Help file, the $vUser_Separator parameter is only used when copying the content to the clipboard using the buttons - you need to use the currently set delimiter to separate the headers as you can see above. ;)

M23

 

M23, Can you send me your array include? I ran this on my machine and this was my result:

inesmf.png

Link to comment
Share on other sites

  • Moderators

Jewtus,

That code works for me in 3.3.12.0 and 3.3.13.19. What version of AutoIt are you running? :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

Jewtus,

That code works for me in 3.3.12.0 and 3.3.13.19. What version of AutoIt are you running? :huh:

M23

I use the portable version (3.3.10.2)

When I run my scripts this is what it write to the console:

+>12:58:10 Starting AutoIt3Wrapper v.2.2.0.0 SciTE v.3.4.1.0   Keyboard:00000409  OS:WIN_7/Service Pack 1  CPU:X64 OS:X86    Environment(Language:0409)

I've also noticed that this script (which worked a few days ago) no longer is showing up with the colors like it use to...

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

Opt( "MustDeclareVars", 1 )

Global $hGui, $hLV, $aHit[2] = [ -1, -1 ] ; $aHit contains row & col of marked cell

MainFunc()

Func MainFunc()

  $hGui = GUICreate( "Mark Cell in Listview", 250, 222 )

  Local $idLV = GUICtrlCreateListView( "Column 0|Column 1|Column 2", 2, 2, 250-4, 222-4 )
  $hLV = ControlGetHandle( $hGui, "", $idLV )
  For $i = 0 To 49
    GUICtrlCreateListViewItem( "Cell " & $i & ".0" & "|Cell " & $i & ".1" & "|Cell " & $i & ".2", $idLV )
  Next

  GUIRegisterMsg( $WM_NOTIFY, "WM_NOTIFY" )

  GUISetState()

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

EndFunc

Func WM_NOTIFY( $hWnd, $iMsg, $wParam, $lParam )
  #forceref $hWnd, $iMsg, $wParam
  Local $tNMHDR, $hWndFrom, $iCode
  $tNMHDR = DllStructCreate( $tagNMHDR, $lParam )
  $hWndFrom = HWnd( DllStructGetData( $tNMHDR, "hWndFrom" ) )
  $iCode = DllStructGetData( $tNMHDR, "Code" )

  Switch $hWndFrom

    Case $hLV

      Switch $iCode

        Case $LVN_ITEMCHANGED
          Local $tNMLISTVIEW, $iItem, $aInfo
          $tNMLISTVIEW = DllStructCreate( $tagNMLISTVIEW, $lParam )
          $iItem = DllStructGetData( $tNMLISTVIEW, "Item" )
          _GUICtrlListView_SetItemSelected( $hLV, $iItem, False )

          Local $aInfo = GUIGetCursorInfo( $hGui )
          If $aInfo[2] Then
            $aInfo = _GUICtrlListView_SubItemHitTest( $hLV, $aInfo[0]-2, $aInfo[1]-2 ) ; Upper left = ( 2, 2 )
            If $aInfo[0] > -1 And $aInfo[1] > -1 And $aInfo[0] = $iItem Then
              If $aHit[0] > -1 Then _
                _GUICtrlListView_RedrawItems( $hLV, $aHit[0], $aHit[0] )
              If $aHit[0] <> $aInfo[0] Or $aHit[1] <> $aInfo[1] Then
                $aHit[0] = $aInfo[0] ; Row
                $aHit[1] = $aInfo[1] ; Col
              Else
                $aHit[0] = -1 ; Row
                $aHit[1] = -1 ; Col
              EndIf
              _GUICtrlListView_RedrawItems( $hLV, $iItem, $iItem )
            EndIf
          EndIf

        Case $NM_CUSTOMDRAW
          Local $tNMLVCUSTOMDRAW = DllStructCreate( $tagNMLVCUSTOMDRAW, $lParam )
          Local $dwDrawStage = DllStructGetData( $tNMLVCUSTOMDRAW, "dwDrawStage" )

          Switch $dwDrawStage                               ; Holds a value that specifies the drawing stage

            Case $CDDS_PREPAINT                             ; Before the paint cycle begins
              Return $CDRF_NOTIFYITEMDRAW                   ; Notify the parent window of any ITEM-related drawing operations

            Case $CDDS_ITEMPREPAINT                         ; Before painting an item
              Return $CDRF_NOTIFYSUBITEMDRAW                ; Notify the parent window of any SUBITEM-related drawing operations

            Case BitOR( $CDDS_ITEMPREPAINT, $CDDS_SUBITEM ) ; Before painting a subitem
              Local $dwItemSpec = DllStructGetData( $tNMLVCUSTOMDRAW, "dwItemSpec" ) ; Item index
              Local $iSubItem   = DllStructGetData( $tNMLVCUSTOMDRAW, "iSubItem"   ) ; Subitem index
              Local $uItemState = DllStructGetData( $tNMLVCUSTOMDRAW, "uItemState" ) ; Item state
              If $dwItemSpec = $aHit[0] Then ; Marked row
                Switch $iSubItem
                  Case $aHit[1] ; Marked column
                    DllStructSetData( $tNMLVCUSTOMDRAW, "ClrText",   0xFFFFFF ) ; Forecolor white
                    DllStructSetData( $tNMLVCUSTOMDRAW, "clrTextBk", 0xCC6600 ) ; Backcolor dark blue, BGR
                  Case Else ; Other columns
                    DllStructSetData( $tNMLVCUSTOMDRAW, "ClrText",   0x000000 ) ; Forecolor black
                    DllStructSetData( $tNMLVCUSTOMDRAW, "ClrTextBk", 0xFFFFFF ) ; Backcolor white
                EndSwitch
              Else ; Other rows
                DllStructSetData( $tNMLVCUSTOMDRAW, "ClrText",   0x000000 )
                DllStructSetData( $tNMLVCUSTOMDRAW, "ClrTextBk", 0xFFFFFF )
              EndIf
              Return $CDRF_NEWFONT                          ; $CDRF_NEWFONT must be returned after changing font or colors

          EndSwitch

      EndSwitch

  EndSwitch

  Return $GUI_RUNDEFMSG
EndFunc

Should I try redownloading or would this be an issue with environment variables or something?

Edited by Jewtus
Link to comment
Share on other sites

  • Moderators

Jewtus,

The ArrayDisplay options you are trying to use were added after 3.3.10.2 - so little wonder you cannot get them to work. Why not update? ;)

M23

Edit: When you reply, please use the "Reply to this topic" button at the top of the thread or the "Reply to this topic" editor at the bottom rather than the "Quote" button - I know what I wrote and it just pads the thread unnecessarily. ;)

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

Ahhh ok. Work blocked the zip file download (which they did in the last few months) and I have unofficial admin access on my machine (I'm not supposed to but IT was sick of trying to help when the issues were over their head).

I'm waiting for them to "approve" the zip download URL.

That is what I needed to know though.

Link to comment
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
 Share

  • Recently Browsing   0 members

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