WxComboBox White Dropdown

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
gillp28
Knows some wx things
Knows some wx things
Posts: 25
Joined: Tue Jun 25, 2019 3:19 pm

WxComboBox White Dropdown

Post by gillp28 » Wed Aug 21, 2019 4:37 pm

Hi,
Does anyone know to get rid of the dropdown white portion in wxCombox? I tired using dismiss so it wouldn't show up but you can still see the dropdown
white portion.

Code: Select all

void Project1Frame::onDropdown(wxCommandEvent& event)
{
	wxColourDialog dialog; 
	if (dialog.ShowModal() == wxID_OK)
	{
		wxColourData data = dialog.GetColourData();
		colorSelect->SetBackgroundColour(data.GetColour()); 
		colorSelect->Dismiss(); 
	}
}

User avatar
doublemax
Moderator
Moderator
Posts: 14314
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: WxComboBox White Dropdown

Post by doublemax » Wed Aug 21, 2019 5:25 pm

I have no idea what you're talking about. Can you make a screenshot?
Use the source, Luke!

gillp28
Knows some wx things
Knows some wx things
Posts: 25
Joined: Tue Jun 25, 2019 3:19 pm

Re: WxComboBox White Dropdown

Post by gillp28 » Wed Aug 21, 2019 7:09 pm

ComboBox.png
ComboBox.png (15.7 KiB) Viewed 199 times

User avatar
doublemax
Moderator
Moderator
Posts: 14314
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: WxComboBox White Dropdown

Post by doublemax » Wed Aug 21, 2019 8:32 pm

I don't think there is any way to avoid this. You could try wxComboCtrl, which is more flexible, but also a little harder to use.
https://docs.wxwidgets.org/trunk/classw ... _ctrl.html
Use the source, Luke!

Nunki
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 201
Joined: Fri Sep 14, 2012 8:26 am
Location: Kontich, Belgium
Contact:

Re: WxComboBox White Dropdown

Post by Nunki » Thu Aug 22, 2019 9:18 am

Hi Gillp28,

Could it be that you have only three controls on your dialog of which only the combobox gains the input focus. Or where your combobox is the first object in the dialog (when being created). And if the focus is set on the combobox it automatically opens to show the possible choices, of which there are none for now, hence the white empty space.

So maybe if you add a plain textedit control as first object, so that this will get the input focus first, the dropdown of the combobox will no longer appear.

with regards,
Nunki

gillp28
Knows some wx things
Knows some wx things
Posts: 25
Joined: Tue Jun 25, 2019 3:19 pm

Re: WxComboBox White Dropdown

Post by gillp28 » Thu Aug 22, 2019 6:40 pm

Hi,

I tried changing the focus but i still see the dropdown.

Thanks

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 3607
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: WxComboBox White Dropdown

Post by ONEEYEMAN » Thu Aug 22, 2019 9:46 pm

Hi,
What are you doing in order to see the drop down?
And why does it not have any items? I.e. that's why it is white (according to you theme).

Thank you.

gillp28
Knows some wx things
Knows some wx things
Posts: 25
Joined: Tue Jun 25, 2019 3:19 pm

Re: WxComboBox White Dropdown

Post by gillp28 » Fri Aug 23, 2019 1:17 am

I am trying to use the drop-down as a colour selection tool. When i click the combo box i don't want the white portion to appear so i tried dismissing it and as well change focus when the event is triggered but it still doesn't work.

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 3607
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: WxComboBox White Dropdown

Post by ONEEYEMAN » Fri Aug 23, 2019 3:08 am

Hi,
What is wrong with using wxColourPicker?

Thank you.

gillp28
Knows some wx things
Knows some wx things
Posts: 25
Joined: Tue Jun 25, 2019 3:19 pm

Re: WxComboBox White Dropdown

Post by gillp28 » Fri Aug 23, 2019 3:19 am

I have used that widget before but I don’t like how in windows the whole button doesn’t fill in with colour

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 3607
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: WxComboBox White Dropdown

Post by ONEEYEMAN » Fri Aug 23, 2019 2:17 pm

Hi,
gillp28 wrote:
Fri Aug 23, 2019 1:17 am
I am trying to use the drop-down as a colour selection tool. When i click the combo box i don't want the white portion to appear
What do you want to happen in this case? I am not sure you can prevent the drop down from showing...
But I'm also curious why it is empty? Did you put some strings in the combo box?

Thank you.

Post Reply