Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Alignment of first column in ListView



  • Please log in to reply
4 replies to this topic
iPhilip
  • Members
  • 138 posts
  • Last active: Sep 12 2015 06:27 PM
  • Joined: 03 Jun 2010

I am not sure if what I am observing is a bug/issue or not but this simple script demonstrates strange behavior in the alignment of the contents of the first column in the ListView, i.e. the first column is different than the other two. My environment is Windows 7 Pro (64 bit) - AutoHotkey v1.1.09.04 (Unicode 32-bit).

Gui, Font, S10
Gui, Add, ListView, r3 w300 h300 Grid, A|A|A
LV_Add("", "A", "A", "A")
LV_Add("", "A", "A", "A")
LV_Add("", "A", "A", "A")
LV_ModifyCol(1, "50 Right")
LV_ModifyCol(2, "50 Right")
LV_ModifyCol(3, "50 Right")
Gui, Show
Return

If I missed something, please let me know. Thank you.

 


Windows 7 Pro (64 bit) - AutoHotkey v1.1+ (Unicode 32-bit)


Jackie Sztuk _Blackholyman
  • Spam Officer
  • 3757 posts
  • Last active: Apr 03 2016 08:47 PM
  • Joined: 28 Feb 2012
Works fine for me on my workstation Xp pro sp3 (U32) v1.1.08.1
Helping%20you%20learn%20autohotkey.jpg?d

[AHK] Version. 1.1+ [CLOUD] DropBox ; Copy [WEBSITE] Blog ; About

iPhilip
  • Members
  • 138 posts
  • Last active: Sep 12 2015 06:27 PM
  • Joined: 03 Jun 2010

This is what it looks like on my system - Windows 7 Pro (64 bit) - AutoHotkey v1.1.09.04 (Unicode 32-bit):

 

https://docs.google....dit?usp=sharing

 

 


Windows 7 Pro (64 bit) - AutoHotkey v1.1+ (Unicode 32-bit)


jballi
  • Members
  • 1029 posts
  • Last active:
  • Joined: 01 Oct 2005
Yes, I can duplicate this anomaly on my Windows XP SP3 machine. I suppose you can call it a bug but since it appears to occur across multiple OS versions, it is a consistent bug.  This is a OS bug, not an AutoHotkey bug.
 
Alignment of the first column (column 1) of a ListView control has always been a bit tricky.  In addition to text (developer-determined font and size), the first column can include a checkbox image (standard or custom) and an icon (developer-determined size).  Many times I'm just grateful that anything aligns at all. In your example, if I were to guess, the OS appears to be having trouble allocating the correct empty space for the text (right justified), icon, and checkbox.

iPhilip
  • Members
  • 138 posts
  • Last active: Sep 12 2015 06:27 PM
  • Joined: 03 Jun 2010
✓  Best Answer

Thank you for the feedback. I will keep this issue open for a few more days in case someone has suggestions/opinions. Meanwhile, my temporary solution (see below) is to hide the first column (zero width) and rely on the other columns for proper alignment.
 

Gui, Font, S10
Gui, Add, ListView, r3 w300 h300 Grid, |A|A|A
LV_Add("", "", "A", "A", "A")
LV_Add("", "", "A", "A", "A")
LV_Add("", "", "A", "A", "A")
LV_ModifyCol(1, 0)
LV_ModifyCol(2, "50 Right")
LV_ModifyCol(3, "50 Right")
LV_ModifyCol(4, "50 Right")
Gui, Show
Return

Windows 7 Pro (64 bit) - AutoHotkey v1.1+ (Unicode 32-bit)