## wxComboPopup

In order to use a custom popup with wxComboCtrl, an interface class must be derived from wxComboPopup. For more information how to use it, see Setting Custom Popup for wxComboCtrl.

Include files

<combo.h>

See also

wxComboCtrl

Members

wxComboPopup::wxComboPopup
wxComboPopup::m_combo
wxComboPopup::Create
wxComboPopup::Dismiss
wxComboPopup::GetAdjustedSize
wxComboPopup::GetControl
wxComboPopup::GetStringValue
wxComboPopup::Init
wxComboPopup::IsCreated
wxComboPopup::LazyCreate
wxComboPopup::OnComboDoubleClick
wxComboPopup::OnComboKeyEvent
wxComboPopup::OnDismiss
wxComboPopup::OnPopup
wxComboPopup::PaintComboControl
wxComboPopup::SetStringValue

### wxComboPopup::wxComboPopup

wxComboPopup()

Default constructor. It is recommended that internal variables are prepared in Init instead (because m_combo is not valid in constructor).

### wxComboPopup::m_combo

wxComboCtrl m_combo

Parent wxComboCtrl. This is parameter has been prepared before Init is called.

### wxComboPopup::Create

bool Create(wxWindow* parent)

The derived class must implement this to create the popup control.

Return value

`true` if the call succeeded, `false` otherwise.

### wxComboPopup::Dismiss

void Dismiss()

Utility function that hides the popup.

### wxComboPopup::GetAdjustedSize

wxSize GetAdjustedSize(int minWidth, int prefHeight, int maxHeight)

The derived class may implement this to return adjusted size for the popup control, according to the variables given.

Parameters

minWidth

Preferred minimum width.

prefHeight

Preferred height. May be -1 to indicate no preference.

maxWidth

Max height for window, as limited by screen size.

Remarks

Called each time popup is about to be shown.

### wxComboPopup::GetControl

wxWindow* GetControl()

The derived class must implement this to return pointer to the associated control created in Create.

### wxComboPopup::GetStringValue

wxString GetStringValue() const

The derived class must implement this to return string representation of the value.

### wxComboPopup::Init

void Init()

The derived class must implement this to initialize its internal variables. This method is called immediately after construction finishes. m_combo member variable has been initialized before the call.

### wxComboPopup::IsCreated

bool IsCreated() const

Utility method that returns `true` if Create has been called.

Useful in conjunction with LazyCreate.

### wxComboPopup::LazyCreate

bool LazyCreate()

The derived class may implement this to return `true` if it wants to delay call to Create until the popup is shown for the first time. It is more efficient, but on the other hand it is often more convenient to have the control created immediately.

Remarks

Base implementation returns `false`.

### wxComboPopup::OnComboDoubleClick

void OnComboDoubleClick()

The derived class may implement this to do something when the parent wxComboCtrl gets double-clicked.

### wxComboPopup::OnComboKeyEvent

void OnComboKeyEvent(wxKeyEvent& event)

The derived class may implement this to receive key events from the parent wxComboCtrl.

Events not handled should be skipped, as usual.

### wxComboPopup::OnDismiss

void OnDismiss()

The derived class may implement this to do special processing when popup is hidden.

### wxComboPopup::OnPopup

void OnPopup()

The derived class may implement this to do special processing when popup is shown.

### wxComboPopup::PaintComboControl

void PaintComboControl(wxDC& dc, const wxRect& rect)

The derived class may implement this to paint the parent wxComboCtrl.

Default implementation draws value as string.

### wxComboPopup::SetStringValue

void SetStringValue(const wxString& value)

The derived class must implement this to receive string value changes from wxComboCtrl.