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
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()
Default constructor. It is recommended that internal variables are prepared in Init instead (because m_combo is not valid in constructor).
wxComboCtrl m_combo
Parent wxComboCtrl. This is parameter has been prepared before Init is called.
bool Create(wxWindow* parent)
The derived class must implement this to create the popup control.
Return value
true if the call succeeded, false otherwise.
void Dismiss()
Utility function that hides the popup.
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
Remarks
Called each time popup is about to be shown.
wxWindow* GetControl()
The derived class must implement this to return pointer to the associated control created in Create.
wxString GetStringValue() const
The derived class must implement this to return string representation of the value.
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.
bool IsCreated() const
Utility method that returns true if Create has been called.
Useful in conjunction with 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.
void OnComboDoubleClick()
The derived class may implement this to do something when the parent wxComboCtrl gets double-clicked.
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.
void OnDismiss()
The derived class may implement this to do special processing when popup is hidden.
void OnPopup()
The derived class may implement this to do special processing when popup is shown.
void PaintComboControl(wxDC& dc, const wxRect& rect)
The derived class may implement this to paint the parent wxComboCtrl.
Default implementation draws value as string.
void SetStringValue(const wxString& value)
The derived class must implement this to receive string value changes from wxComboCtrl.