Hello,
I have created a wxListView inside a wxComboCtrl a populated the list with items according to samle in:
https://docs.wxwidgets.org/3.0/classwx_combo_ctrl.html
I want to:
1. Change size of the textfield in the wxComboCtrl.
2. Change the alignment of the items in the dropdown wxListCtrl - allign to the left.
3. Disable the horizontal scrollbar and add a vertical scrollbar.
ad 1. I tried - SetSize() on both comboCtrl and popupCtrl without success.
ad 2. I tried to call popupCtrl->Arrange(wxLIST_ALIGN_LEFT), but without any visible change
ad 3. I tried popupCtrl->SetScrollbar(), but without any visible change.
Can anybody tell me how to achieve the points 1 - 3?
Thanks!
edit scrollbar and properties of list in wxComboCtrl
Re: edit scrollbar and properties of list in wxComboCtrl
Hi,
1. You should override DoGetBestSize() and return new size. You are using sizers, right?
2.what do you use as items - text ot icons?
And finally - whats your wx version and OS?
Thank you.
1. You should override DoGetBestSize() and return new size. You are using sizers, right?
2.what do you use as items - text ot icons?
And finally - whats your wx version and OS?
Thank you.
Re: edit scrollbar and properties of list in wxComboCtrl
Hi ONEEYEMAN ,
thank you for your reply.
I use Ubuntu 18.04.5 LTS; version of wxWidgets is 3.0.5.
1. So, the new size, which DoGetBestSize() returns, returns the optimal size of the text field of the wxComboCtrl when included into a sizer. Right?
- Yes, I add the wxComboCtrl into a cell of the wxGridBagSizer. But I leave the expansion parameter set to 0 - keeps the original size of the object.
2. I use text.
Do you have any suggestion about point 3?
Thanks.
thank you for your reply.
I use Ubuntu 18.04.5 LTS; version of wxWidgets is 3.0.5.
1. So, the new size, which DoGetBestSize() returns, returns the optimal size of the text field of the wxComboCtrl when included into a sizer. Right?
- Yes, I add the wxComboCtrl into a cell of the wxGridBagSizer. But I leave the expansion parameter set to 0 - keeps the original size of the object.
2. I use text.
Do you have any suggestion about point 3?
Thanks.
Re: edit scrollbar and properties of list in wxComboCtrl
1) if the control is inside a sizer, the sizer takes control over the size. But you can still affect it with SetMinSize().
2) the default alignment is left-aligned. Can you show the code how you create the control and fill it with data?
3) For native controls, the scrollbars can not always be removed. Would something like wxSimpleHtmlListBox work for your purpose?
https://docs.wxwidgets.org/trunk/classw ... t_box.html
Use the source, Luke!