Opened 14 years ago

Closed 14 years ago

#1338 closed Bug (Fixed)

_arrayDisplay() GUI position error

Reported by: Bowmore Owned by: Jpm
Milestone: Component: Standard UDFs
Version: Severity: None
Keywords: arrayDisplay Cc:


The _arrayDisplay() function calculates a very poor GUI location when displaying large arrays.
Bug Report Environment
AutoIt: (Os:WIN_XP/X86/Service Pack 3 Language:0409 Keyboard:00000809 Cpu:X64)

When diplaying arrays with long rows and many columns of data, using _arrayDisplay(), the GUI X position is calculated as a large negative value that positions the GUI off the visible screen. To see the displayed array you have to right clisk on the taskbar button and select maximize which fits the GUI to the monitor display

#include <array.au3>
#include <string.au3>

Global $g_aTestArray[5][240]

AdlibRegister("_DisplayWindowSize", 1000)


_ArrayDisplay($g_aTestArray, "Display Array With Longish Rows")


Func _PopulateArray(ByRef $aTestArray)
  Local $fPopulate = True

  ;Generate some data for the array
  For $i = 0 To 4
    For $j = 0 To 239
      $fPopulate = Random(0, 1, 1)
      If $fPopulate Then
        $aTestArray[$i][$j] = _StringRepeat(Chr(Random(48, 90, 1)), Random(10, 40, 1))
EndFunc   ;==>_PopulateArray

Func _DisplayWindowSize()
  Local $aPos = 0

  $aPos = WinGetPos("Display Array With Longish Rows")
  If Not @error Then
    MsgBox(0, "_ArrayDisplay Window Size", "X = " & $aPos[0] & @CRLF & "Y = " & $aPos[1] & @CRLF & "W = " & $aPos[2] & @CRLF & "H = " & $aPos[3] & @CRLF)
EndFunc   ;==>_DisplayWindowSize

Attachments (0)

Change History (2)

comment:1 Changed 14 years ago by Bowmore

I've had a closer look at the code for the _arrayDisplay() function and offer the line indicated below as a possible fix.

  ; adjust window width
  $iWidth = 0
  For $i = 0 To $iSubMax + 1
    $iWidth += GUICtrlSendMsg($hListView, $_ARRAYCONSTANT_LVM_GETCOLUMNWIDTH, $i, 0)
  If $iWidth < 250 Then $iWidth = 230
  $iWidth += 20
  If $iWidth > @DesktopWidth Then $iWidth = @DesktopWidth ;<====== Add this line to fix
  WinMove($hGUI, "", (@DesktopWidth - $iWidth)/2, Default, $iWidth)

comment:2 Changed 14 years ago by Jpm

  • Milestone set to
  • Owner changed from Gary to Jpm
  • Resolution set to Fixed
  • Status changed from new to closed

Fixed by revision [5465] in version:

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as closed The owner will remain Jpm.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.