wxListCtrl entries won't fill up the entire wxListCtrl box (formatting)

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
itachiboi999
Knows some wx things
Knows some wx things
Posts: 33
Joined: Mon Nov 15, 2021 7:06 pm

wxListCtrl entries won't fill up the entire wxListCtrl box (formatting)

Post by itachiboi999 »

Hey all, I'm having trouble with getting the wxListCtrl entries to fill up the entire width of the wxListCtrl box... as you can see form the attached image the entries only fill up a small portion of the ListCtrl box making the GUI look empty in this section.

Here is how i populate the wxListCtrl box:

Code: Select all

regList = new wxListCtrl(panel_center, wxID_ANY, wxDefaultPosition, wxDefaultSize);
					
for (int i = 0; i < 10; i++)
{
	regList->InsertItem(i, wxString::Format("Item %d -------------", i));
}

regListSizer = new wxBoxSizer(wxHORIZONTAL);
regListSizer->Add(regList, 1, wxEXPAND | wxALL, 3);
panel_center->SetSizerAndFit(regListSizer);

any and all help when it comes to formatting these items to stretch across the entire box would be greatly appreciated !!
Attachments
ListCtrl_notstretch.PNG
ListCtrl_notstretch.PNG (3.84 KiB) Viewed 376 times
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxListCtrl entries won't fill up the entire wxListCtrl box (formatting)

Post by doublemax »

Maybe you wanted a list display like a file explorer in "detail" view? Then you need to use the wxLC_REPORT style.
Use the source, Luke!
itachiboi999
Knows some wx things
Knows some wx things
Posts: 33
Joined: Mon Nov 15, 2021 7:06 pm

Re: wxListCtrl entries won't fill up the entire wxListCtrl box (formatting)

Post by itachiboi999 »

doublemax wrote: Thu Jan 27, 2022 11:15 pm Maybe you wanted a list display like a file explorer in "detail" view? Then you need to use the wxLC_REPORT style.
thank you! i took your advice and looked at the different modes/options that correspond to each; which led me to trying wxLC_LIST which solved my character entry length issue, but then by default switched to a horizontal scrollbar instead of a vertical one which created another small problem...
I read through the sample code and the documentation pages of wxListCtrl but haven't seen anything that would solve the scroll bar issue (image to horizontal scroll attached on bottom)

and when i attempt to convert to wxLC_REPORT mode, i am slightly confused on if/how i would need to assign custom columns since unlike wxLC_LIST mode wxLC_REPORT mode doesn't automatically generate columns (which has proposed a new set of issues/work)

so any assistance in either converting the horizontal scroll to a vertical scroll or with the syntax of generating columns would be largely helpful!!!
thanks
Attachments
ListCtrl_notstretch.PNG
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxListCtrl entries won't fill up the entire wxListCtrl box (formatting)

Post by doublemax »

I don't think wxListCtrl can do what you're looking for. Run the "listctrl" sample that comes with wxWidgets and check all modes.
Use the source, Luke!
Post Reply