Right configuration for wxListCtrl (shall be smaller)

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
Pellaeon
Experienced Solver
Experienced Solver
Posts: 56
Joined: Fri Mar 16, 2012 12:32 pm

Right configuration for wxListCtrl (shall be smaller)

Post by Pellaeon »

Hi,

I build a GUI with wxFormBuilder and I use a lot of sizers.
Attached you find a screenshot of my application and a screenshot of the wxFormBuilder Project.

Now my problem: the left bar is too wide in my eyes. And I want to have it smaller.
I tried a lot of things but I didn't get to reach my desired target. Atm I have a flexGridSizer to order the components (StaticBoxSizers with names).

In my opinion it is the wxListCtrl which forces the big width of the left bar. It has 3 columens and the following code shows how I create them.

So my question: how can I make this left bar smaller?

Code: Select all

m_axesList->ClearAll();	

m_axesList->SetSingleStyle(wxLC_REPORT);
m_axesList->InsertColumn(0,"Name");	
m_axesList->InsertColumn(1,"Position");
m_axesList->InsertColumn(2,"Unit");

m_axesList->SetColumnWidth(0, wxLIST_AUTOSIZE_USEHEADER);
m_axesList->SetColumnWidth(1, wxLIST_AUTOSIZE_USEHEADER);
m_axesList->SetColumnWidth(2, wxLIST_AUTOSIZE_USEHEADER);
Attachments
Screen.jpg
formBuilder.jpg
User avatar
doublemax
Moderator
Moderator
Posts: 19115
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Right configuration for wxListCtrl (shall be smaller)

Post by doublemax »

I'm not sure that the wxListCtrl is the reason. Try hiding it and check if the width of the sidebar changes.
Use the source, Luke!
Pellaeon
Experienced Solver
Experienced Solver
Posts: 56
Joined: Fri Mar 16, 2012 12:32 pm

Re: Right configuration for wxListCtrl (shall be smaller)

Post by Pellaeon »

When hiding it, it is also too wide, same effect.
User avatar
doublemax
Moderator
Moderator
Posts: 19115
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Right configuration for wxListCtrl (shall be smaller)

Post by doublemax »

When hiding it, it is also too wide, same effect.
Which shows that the wxListCtrl is not responsible. Do the same with other parts of the gui until you see a difference.
Use the source, Luke!
Pellaeon
Experienced Solver
Experienced Solver
Posts: 56
Joined: Fri Mar 16, 2012 12:32 pm

Re: Right configuration for wxListCtrl (shall be smaller)

Post by Pellaeon »

If a hide both lists (there are two) then the left aream becomes more narrow. So I think the wxListCtrl is the reason.
I also defined a max width in the properties. Then, in the editor, the left area becomes smaller. but when I recompile and start my program it is still the old wide size.
User avatar
doublemax
Moderator
Moderator
Posts: 19115
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Right configuration for wxListCtrl (shall be smaller)

Post by doublemax »

What happens if you increase the frame size, does the side bar get wider?
Use the source, Luke!
Pellaeon
Experienced Solver
Experienced Solver
Posts: 56
Joined: Fri Mar 16, 2012 12:32 pm

Re: Right configuration for wxListCtrl (shall be smaller)

Post by Pellaeon »

No, the size remains. In my configuration growing in the flexgrid is not allowed for the first column.
Post Reply