Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ListView issues: LeftBorder #44

Open
hoppfrosch opened this issue Jan 26, 2012 · 5 comments
Open

ListView issues: LeftBorder #44

hoppfrosch opened this issue Jan 26, 2012 · 5 comments

Comments

@hoppfrosch
Copy link

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:

  • The border on the left side of my listview items seems to big in my personal opinion (green line in my image): the items should start right on the left border of the listview ...
  • Unless I've explicitly given a title for the column (lvItems := this.AddControl("ListView", "lvItems", "", "TITLE:")), the title is not shown! Omitting this.lvItems.ModifyCol(1,floor(this.lvItems.Width * 0.995),"") the title is shown, but the column takes only a part of the width of the complete Listview. Modifying the column with a certain width brings the column to the desired width, but the title does not show up anymore ....

Conclusion:

  • First column should start right on the left border of listview
  • Title should show up correctly after modifying the Column width
  • The initial column width of all columns should spawn the complete width of the ListView (for example with two columns each column should initially take 50% of the complete width (and not a fixed width - as it probably does now ...))
@ChrisS85
Copy link
Owner

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
Copy link
Owner

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

@ChrisS85
Copy link
Owner

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.

@ChrisS85 ChrisS85 reopened this Feb 11, 2012
@hoppfrosch
Copy link
Author

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
Copy link
Owner

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants