Modify

Opened 9 years ago

Closed 9 years ago

#3213 closed Feature Request (Rejected)

_Arraydisplay() (from Array.au3) may truncate headers since their max widths are unchecked

Reported by: Tippex Owned by:
Milestone: Component: Standard UDFs
Version: Severity: None
Keywords: _ArrayDisplay, Headers, Truncated Cc:

Description

_Arraydisplay() (from Array.au3) may truncate headers (if there are any that are larger that then max width of their columns) since their max widths are unchecked.

The fix I use (an amendment to Array.au3) is as follows:

#include "ListViewConstants.au3"
		; Check width of header if set
		If $sHeader <> "" Then
			GUICtrlSendMsg($idListView, $_ARRAYCONSTANT_LVM_SETCOLUMNWIDTH, $i, $LVSCW_AUTOSIZE_USEHEADER)
			Local $iColWidthHeader = GUICtrlSendMsg($idListView, $_ARRAYCONSTANT_LVM_GETCOLUMNWIDTH, $i, 0)
		EndIf
		; Set minimum if required
		If $iColWidth < $iMin_ColWidth And $iColWidthHeader < $iMin_ColWidth Then
			GUICtrlSendMsg($idListView, $_ARRAYCONSTANT_LVM_SETCOLUMNWIDTH, $i, $iMin_ColWidth)
			$iColWidth = $iMin_ColWidth
		ElseIf $iColWidthHeader < $iColWidth Then
			GUICtrlSendMsg($idListView, $_ARRAYCONSTANT_LVM_SETCOLUMNWIDTH, $i, $iColWidth)
		Else
			$iColWidth = $iColWidthHeader
		EndIf

to replace the following in Func _ArrayDisplay:

		; Set minimum if required
		If $iColWidth < $iMin_ColWidth Then
			GUICtrlSendMsg($idListView, $_ARRAYCONSTANT_LVM_SETCOLUMNWIDTH, $i, $iMin_ColWidth)
			$iColWidth = $iMin_ColWidth
		EndIf

Notes:
"ListViewConstants.au3" was included for $LVSCW_AUTOSIZE_USEHEADER
and the original authors & modifiers are:
; Author ........: randallc, Ultima
; Modified.......: Gary Frost (gafrost), Ultima, Zedna, jpm, Melba23, AZJIO, UEZ

Attachments (0)

Change History (4)

comment:1 Changed 9 years ago by Tippex

_Arraydisplay() (from Array.au3) may truncate headers (if there are any that are larger that then max width of their columns) since their max widths are unchecked.

The fix I use (an amendment to Array.au3) is as follows:

Added to the top section of Array.au3

#include "ListViewConstants.au3"

Then replace (in Func _ArrayDisplay)

From:

	; Set minimum if required
	If $iColWidth < $iMin_ColWidth Then
		GUICtrlSendMsg($idListView, $_ARRAYCONSTANT_LVM_SETCOLUMNWIDTH, $i, $iMin_ColWidth)
		$iColWidth = $iMin_ColWidth
	EndIf

To:

	; Check width of header if set
	If $sHeader <> "" Then
		GUICtrlSendMsg($idListView, $_ARRAYCONSTANT_LVM_SETCOLUMNWIDTH, $i, $LVSCW_AUTOSIZE_USEHEADER)
		Local $iColWidthHeader = GUICtrlSendMsg($idListView, $_ARRAYCONSTANT_LVM_GETCOLUMNWIDTH, $i, 0)
		; Set minimum if required
		If $iColWidth < $iMin_ColWidth And $iColWidthHeader < $iMin_ColWidth Then
			GUICtrlSendMsg($idListView, $_ARRAYCONSTANT_LVM_SETCOLUMNWIDTH, $i, $iMin_ColWidth)
			$iColWidth = $iMin_ColWidth
		ElseIf $iColWidthHeader < $iColWidth Then
			GUICtrlSendMsg($idListView, $_ARRAYCONSTANT_LVM_SETCOLUMNWIDTH, $i, $iColWidth)
		Else
			$iColWidth = $iColWidthHeader
		EndIf
	Else
		; Set minimum if required
		If $iColWidth < $iMin_ColWidth Then
			GUICtrlSendMsg($idListView, $_ARRAYCONSTANT_LVM_SETCOLUMNWIDTH, $i, $iMin_ColWidth)
			$iColWidth = $iMin_ColWidth
		EndIf
	Endif

Notes:
"ListViewConstants.au3" was included for $LVSCW_AUTOSIZE_USEHEADER
and the original authors & modifiers are:
; Author ........: randallc, Ultima
; Modified.......: Gary Frost (gafrost), Ultima, Zedna, jpm, Melba23, AZJIO, UEZ

comment:2 Changed 9 years ago by BrewManNH

What would be the benefit gained by this?

_ArrayDisplay is supposed to be a debugging function that, in my opinion, already has far too much added to it so I fail to see how this would add any functionality to debugging an array. You can easily adjust the width of the headers yourself after it has displayed the array.

Considering the function won't even display the full contents of a large array, it's usefulness for anything other than debugging is very limited, this adds nothing that I can see. But I will see how others view it.

comment:3 Changed 9 years ago by BrewManNH

  • Type changed from Bug to Feature Request
  • Version 3.3.14.0 deleted

BTW. I would not consider this a bug, I'm recategorizing this as a feature request as there's no bug here.

comment:4 Changed 9 years ago by Melba23

  • Resolution set to Rejected
  • Status changed from new to closed

The header lengths are determined by the user so it is up to the user to choose suitable header lengths. The UDF is primarily designed to display the array and it would be ridiculous to reduce the visible content just to display a header in full.

Rejected.

M23

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

Action
as closed The ticket will remain with no owner.
Author


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

 
Note: See TracTickets for help on using tickets.