Page 1 of 1

ColumnInfo widths

Posted: Mon May 25, 2015 9:32 pm
by mritter0
I have a ColumnInfo with 3 columns:

Code: Select all

	if (!(ContentCI=IListBrowser->AllocLBColumnInfo(3,
		LBCIA_Column,						0,
			LBCIA_Title,						"",
			LBCIA_Width,						38,
			LBCIA_Sortable,						FALSE,
			LBCIA_DraggableSeparator,			FALSE,
			LBCIA_UserData,						0,
		LBCIA_Column,						1,
			LBCIA_Title,						SAK_LocaleString(MSG_TITLE_NAME),
			LBCIA_Weight,						100,
			LBCIA_Sortable,						TRUE,
			LBCIA_SortArrow,					TRUE,
			LBCIA_SortDirection,				!Prefs->ContentSortDirection,
			LBCIA_DraggableSeparator,			FALSE,
			LBCIA_UserData,						1,
		LBCIA_Column,						2,
			LBCIA_Title,						"",
			LBCIA_Width,						185,
			LBCIA_Sortable,						FALSE,
			LBCIA_DraggableSeparator,			FALSE,
			LBCIA_UserData,						2,
	TAG_DONE)))
		return(FALSE);
I want the first and last columns to be fixed-width, and the center column to be max width (minus the width of the other 2). But it doesn't. It acts like I told it LBCIA_Width, not LBCIA_Weight.

Is there a way to make this happen?

Re: ColumnInfo widths

Posted: Mon May 25, 2015 9:46 pm
by mritter0
I figured it out. I had to put a CHILD_MinWidth on the listbrowser gadget. Not a big fan of that, it should just do it regardless.

Re: ColumnInfo widths

Posted: Mon May 25, 2015 9:53 pm
by broadblues
How is the listbrowser added to the layout?

In order for wht you describe to be aceivable the listbrowser width would require setting, then the column widths calculated, but if you've set LAYOUT_WeightedWith,0 or some such it would collapse to the smalles size.

There so many variables it's difficult to advise further without seeing more code.

Just as a random thought looking at a listrbroswer I have where I had fixed width column, the others have the weight set to 0 not 100

Re: ColumnInfo widths

Posted: Mon May 25, 2015 9:55 pm
by broadblues
mritter0 wrote:I figured it out. I had to put a CHILD_MinWidth on the listbrowser gadget. Not a big fan of that, it should just do it regardless.
You replied while I was posting.

That would do it but, as theat implies set window size, perhaps you should try CHILD_NominalWidth ?

Unfrtunatly the nearest equivalent layout I can find in my own codes is wider than the window, so doesn't really apply.

Re: ColumnInfo widths

Posted: Mon May 25, 2015 10:26 pm
by mritter0
Well, it is working the way I wanted now. It has to be LBCIA_Width,100, not 0.

I came up with another idea in the mean time, and you touched on it, and OS4Coding.net has another tidbit to tweak it.

Off for more tweaking....Thanks