Jump to content

Truncated listview items


 Share

Recommended Posts

Re this thread:

http://www.autoitscript.com/forum/index.php?showtopic=9159

it seems to me that increasing the overall listview width is not the answer. Even when MUCH wider than the sum total of any displayed items, all of the items are still truncated.

A VB forum suggest that a property exists for the listview-column width, but the method used in VB is clearly not applicable here.

I need to solve this one because the data I'm displaying consists of directory trees in which the first part is always identical. Thus, the truncated listing is meaningless. OK, so the user can get it into some sort of readable format by dragging the headers but it looks a hell of a mess, and this has to be done every time the data is presented, since a GUI redraw will re-truncate the columns.

Example:

$lv=GUICtrlCreateListView (" Profile Image Path | User Account ",10,10,800,600)

$lv1=GUICtrlCreateListViewItem("C:\Documents and Settings\UserOne.Domain | MyData",$lv)

$lv2=GUICtrlCreateListViewItem("C:\Documents and Settings\UserTwo.Local | YourData",$lv)

Displays:

Profile Image Path |User Account

C:\Documents and Setting... MyData {Large whitespace}

C:\Documents and Setting... YourData {Large whitespace}

BTW, tried increasing the header widths, or padding the header with tabs. Then they got truncated too. :P

-any ideas?

Tested on XP SP3, Autoit 3.2.12.0

Link to comment
Share on other sites

#include <ListViewConstants.au3>

$lv=GUICtrlCreateListView (" Profile Image Path | User Account ",10,10,800,600)
$lv1=GUICtrlCreateListViewItem("C:\Documents and Settings\UserOne.Domain | MyData",$lv)
$lv2=GUICtrlCreateListViewItem("C:\Documents and Settings\UserTwo.Local | YourData",$lv)
GUICtrlSendMsg($lv, $LVM_SETCOLUMNWIDTH, 0, $LVSCW_AUTOSIZE)

Edited by Zedna
Link to comment
Share on other sites

Thanks, this makes a significant improvement, data is now readable.

The remaining problem is that the column headers are also being truncated, seemingly for no reason. For example even the word 'Host' is truncated when the hostnames are shorter than 5-6 letters. Any ideas how to solve this one? (tried $LVSCW_AUTOSIZE_USEHEADER)

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...