#include <wx/combo.h>
In order to use a custom popup with wxComboCtrl, an interface class must be derived from wxComboPopup.
For more information on how to use it, see Setting Custom Popup for wxComboCtrl.
- See also
- wxComboCtrl
◆ wxComboPopup()
wxComboPopup::wxComboPopup |
( |
| ) |
|
Default constructor.
It is recommended that internal variables are prepared in Init() instead (because m_combo is not valid in constructor).
◆ Create()
virtual bool wxComboPopup::Create |
( |
wxWindow * |
parent | ) |
|
|
pure virtual |
The derived class must implement this to create the popup control.
- Returns
- true if the call succeeded, false otherwise.
◆ DestroyPopup()
virtual void wxComboPopup::DestroyPopup |
( |
| ) |
|
|
virtual |
You only need to implement this member function if you create your popup class in non-standard way.
The default implementation can handle both multiple-inherited popup control (as seen in wxComboCtrl samples) and one allocated separately in heap.
If you do completely re-implement this function, make sure it calls Destroy() for the popup control and also deletes this object (usually as the last thing).
◆ Dismiss()
void wxComboPopup::Dismiss |
( |
| ) |
|
Utility function that hides the popup.
◆ FindItem()
virtual bool wxComboPopup::FindItem |
( |
const wxString & |
item, |
|
|
wxString * |
trueItem = NULL |
|
) |
| |
|
virtual |
Implement to customize matching of value string to an item container entry.
- Parameters
-
item | String entered, usually by user or from SetValue() call. |
trueItem | When item matches an entry, but the entry's string representation is not exactly the same (case mismatch, for example), then the true item string should be written back to here, if it is not a NULL pointer. |
◆ GetAdjustedSize()
virtual wxSize wxComboPopup::GetAdjustedSize |
( |
int |
minWidth, |
|
|
int |
prefHeight, |
|
|
int |
maxHeight |
|
) |
| |
|
virtual |
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. |
maxHeight | Max height for window, as limited by screen size. |
◆ GetComboCtrl()
◆ GetControl()
virtual wxWindow* wxComboPopup::GetControl |
( |
| ) |
|
|
pure virtual |
The derived class must implement this to return pointer to the associated control created in Create().
◆ GetStringValue()
virtual wxString wxComboPopup::GetStringValue |
( |
| ) |
const |
|
pure virtual |
The derived class must implement this to return string representation of the value.
◆ Init()
virtual void wxComboPopup::Init |
( |
| ) |
|
|
virtual |
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.
◆ IsCreated()
bool wxComboPopup::IsCreated |
( |
| ) |
const |
Utility method that returns true if Create has been called.
Useful in conjunction with LazyCreate().
◆ LazyCreate()
virtual bool wxComboPopup::LazyCreate |
( |
| ) |
|
|
virtual |
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.
◆ OnComboDoubleClick()
virtual void wxComboPopup::OnComboDoubleClick |
( |
| ) |
|
|
virtual |
The derived class may implement this to do something when the parent wxComboCtrl gets double-clicked.
◆ OnComboKeyEvent()
virtual void wxComboPopup::OnComboKeyEvent |
( |
wxKeyEvent & |
event | ) |
|
|
virtual |
The derived class may implement this to receive key events from the parent wxComboCtrl.
Events not handled should be skipped, as usual.
◆ OnDismiss()
virtual void wxComboPopup::OnDismiss |
( |
| ) |
|
|
virtual |
The derived class may implement this to do special processing when popup is hidden.
◆ OnPopup()
virtual void wxComboPopup::OnPopup |
( |
| ) |
|
|
virtual |
The derived class may implement this to do special processing when popup is shown.
◆ PaintComboControl()
virtual void wxComboPopup::PaintComboControl |
( |
wxDC & |
dc, |
|
|
const wxRect & |
rect |
|
) |
| |
|
virtual |
The derived class may implement this to paint the parent wxComboCtrl.
Default implementation draws value as string.
◆ SetStringValue()
virtual void wxComboPopup::SetStringValue |
( |
const wxString & |
value | ) |
|
|
virtual |
The derived class must implement this to receive string value changes from wxComboCtrl.
◆ m_combo
Parent wxComboCtrl.
This member variable is prepared automatically before Init() is called.