ChrisS85 / CGUI

An object-oriented GUI library for AutoHotkey
22 stars 19 forks source link

ListView issues: LeftBorder #44

Open hoppfrosch opened 12 years ago

hoppfrosch commented 12 years ago

Following issue with ListView: I've got a single column Listview.

Class CBasicWindow Extends CGUI
{
   ;...
lvItems := this.AddControl("ListView", "lvItems", "", "TITLE:")
;...
__New(data)
{
;...
this.lvItems.ModifyCol(1,floor(this.lvItems.Width * 0.995),"")

this.lvItems.Items.Clear()
Loop, parse, data, `n 
{
   this.lvItems.Items.Add("",A_LoopField)
}
this.Show("")
;...
}

This results in following output Image

Issues are best illustrated, looking at the image:

Conclusion:

ChrisS85 commented 12 years ago

The extra space is due to the way icons are currently handled. I think the problem was that the listview objects need a value for the imagelist index even when no icons are shown so that they won't show an icon when an icon is added to another entry. Otherwise they would show the same icon all over.

ChrisS85 commented 12 years ago

You're also incorrectly using the ModifyCol() function. By using "" as third parameter you're clearing the title.

ChrisS85 commented 12 years ago

I don't think I'm doing anything special with column widths, they should behave like in AHK. That means that each column is as large as it needs to be to hold its title and the last one spans over the remaining width.

hoppfrosch commented 12 years ago

The extra space is due to the way icons are currently handled.

I see - but if I don't want to use the image list feature at all, I would expect that no space is shown on left side. Only if I use a image list (and even it's only for a single column) the place should be reserved ...

You're also incorrectly using the ModifyCol() function. By using "" as third parameter you're clearing the title.

Very plausible ...

ChrisS85 commented 12 years ago

Of course. I have not come up with a solution yet as I explained in the post above. I think it would require checking all list entries each time an icon is changed to fix this? Any ideas?