The “Extra” White Column in the ListBox is back !

Do you happen to have your coloumn count at 7? Sorry if I didn’t help, I’m trying to though.

// I agree with Markus Winter, this seems to be a code error but there’s no way to tell; maybe try posting your code?

I’ve … umm … damn … I forgot :stuck_out_tongue:

Here is a window to add in a project with a sample text file to load once you run the project:

The case of the strange white column

Hi,

you asked for it yesterday, you’ve got it today !

I put two files in a zip archive (The case of the strange white column.zip):
ICON - It’s a Hoot 01 to 53.txt
Window1.xojo_binary_window

The first one is an example of a text file (note that the URLs in the file are fakes URLs, but Hoot and the issue numbers are U.K. comic magazine names and issues).

To verify my claim:
• import the window in a brand new project,
• add a FileType (FT.Text) of type text,
• Run the IDE,
• Open the provided text file,
• enlarge the window,
• resize down (shrink) the columns until a white column appears.

Note: if you want to load a file without re run the project, click in the window (not in the ListBox).

About the code:
I used the Language Reference provided code to get what you want.

About the window and ListBox design properties;
The ListBox uses:
a five columns preset ListBox
a fixed column widths, (160,100,100,100,100 to fit to the ListBox default width)
a five columns text file
an horizontal ScrollBar,
a bi-color background (using a based LR code)
and some other properties to copy the one I use in my project.

BTW: this is not a crashing bug.

And… I recall I fall into that trick as the Conversation subject (title) says and, yes, I forgot its end.

PS: remember to add a filetype (named FT in the code: FT.Text; the original filetype have other defined types thus the .Text).

i just try your application is this is what i see…

Thank you Richard for trying.

You have to change the column widths ‘by hand’ (mouse), enlarge the window, resize down the columns and you will see the white “filler” at the ListBox rightmost.

I had hard times yesterday evening when I built the window from scratch (without taking code from my project).

At last, as soon as the interface have to “redraw” the window, the white part disappears.

BTW: the OS X deal with ScrollBars: I do not recall having unset its default value (hide them): when I disagree with a property, I made it my way, but after some changes, at last, I let them as is (tired of make the same change(s) again and again and again…).

Oh ! My Heading strings have a simple error; it change nothing to the white column case.

i see what you mean now… i try changing the column widths to percentage and it still happen.

You have defined ColumnWidths to be “160,100,100,100,100”. So when you resize the window and the listbox gets wider than 160 + 100 + 100 + 100 + 100 = 560 you automatically get empty space on the right. Change ColumnWidths to be “160,100,100,100,*” so the last column fills up the space to the right. There is really no bug here – Listbox does exactly what you have defined.

Note that CellBackgroundPaint will be called for this additional space, so you have the opportunity to paint that area too (the number of the column is of course equivalent to ColumnCount). CellTextPaint will not be called for this additional space.

Percentage should work. Now that might be a bug (unless something else is wrong).

I don’t have a computer at the moment so can’t run your project but do you have by any chance a tab behind your last heading in the heading string?

i just try what eli say and it work… simply add the * to the end of the column width…

About %:
I want to be able to have an horizontal ScrollBar and the documentation says I have to use fixed (pixels values, not % nor *) values to get it.

Markus:
There is nothing hidden: Richard screen shot displays everything available (not the whole width of the last column, but like that we can see the horizontal ScrollBar). [I misunderstand your question]

An ending tab in the text source file ? No, else we will get another (empty) column. There is none.

At this point in the discussion, I have to say that in the original project, I do not wanted to display that white “column”.

In the shared window I tried to make sure anyone can see it, but I do not do / use any trick (miscoding) that can lead to achieve this need: display an ending white “column”.

Of course you’ll have space on the if you enlarge the listbox by resizing the window and the total width of all columns is fix.

Yes, I understand that, but the problem is a refresh trouble: unless some resfresh occured, that extra space is white.

And my title is not so good because this white part of teh ListBox (when one appears) is not a column at all.

As I wrote above, should this space be visible, CellBackgroundPaint will be called (the column argument will be the same value as ColumnCount). You then can paint the background there to be whatever you want.

CellBackgroundPaint is called, but if you’re resizing a column the bounds of that space are not updated. So as you shrink a heading the extra column stays the same size.

Here’s 2 static sized columns showing the extra space in red. Resize the window/lb and it’s always entirely filled red.

Now resize a column heading and you see that the red just moves over, it doesn’t get to fill the whole thing.

Then resize the window/lb a bit and red fills the whole space again.

Sub Open()
  me.HasHeading = true
  me.ColumnsResizable = true
  me.ColumnCount = 2
  me.ColumnWidths = "200,200"
  me.AddRow "a", "b"
End Sub

Function CellBackgroundPaint(g As Graphics, row As Integer, column As Integer) As Boolean
  if column = 0 then
    g.ForeColor = &c00FF00
  elseif column = 1 then
    g.ForeColor = &c00FF80
  else
    g.ForeColor = &cFF0000
  end
  g.FillRect 0, 0, g.Width, g.Height
End Function

I saw a joke with this sentence, not a threatening. :slight_smile:

Yup, a big sorry from me to Emile. He is right, this is a bug.

SSS S SSS OOO RRR RRR Y Y S O O R R Y Y SSS OOO R R YYY Y YYY

Eli: and there is a bug report done by Michel some month ago.

Detlef: Elvis Presley sing a song (T.R.O.U.B.L.E.) with this sentence in the lyrics.
BTW: I don’t.