Page 1 of 1

WxComboBox White Dropdown

Posted: Wed Aug 21, 2019 4:37 pm
by gillp28
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(); 
	}
}

Re: WxComboBox White Dropdown

Posted: Wed Aug 21, 2019 5:25 pm
by doublemax
I have no idea what you're talking about. Can you make a screenshot?

Re: WxComboBox White Dropdown

Posted: Wed Aug 21, 2019 7:09 pm
by gillp28
ComboBox.png
ComboBox.png (15.7 KiB) Viewed 453 times

Re: WxComboBox White Dropdown

Posted: Wed Aug 21, 2019 8:32 pm
by doublemax
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

Re: WxComboBox White Dropdown

Posted: Thu Aug 22, 2019 9:18 am
by Nunki
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

Re: WxComboBox White Dropdown

Posted: Thu Aug 22, 2019 6:40 pm
by gillp28
Hi,

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

Thanks

Re: WxComboBox White Dropdown

Posted: Thu Aug 22, 2019 9:46 pm
by ONEEYEMAN
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.

Re: WxComboBox White Dropdown

Posted: Fri Aug 23, 2019 1:17 am
by gillp28
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.

Re: WxComboBox White Dropdown

Posted: Fri Aug 23, 2019 3:08 am
by ONEEYEMAN
Hi,
What is wrong with using wxColourPicker?

Thank you.

Re: WxComboBox White Dropdown

Posted: Fri Aug 23, 2019 3:19 am
by gillp28
I have used that widget before but I don’t like how in windows the whole button doesn’t fill in with colour

Re: WxComboBox White Dropdown

Posted: Fri Aug 23, 2019 2:17 pm
by ONEEYEMAN
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.