// Creates popup window, calls interface->Create(), etc
void CreatePopup();
+ // Destroy popup window and all related constructs
+ void DestroyPopup();
+
// override the base class virtuals involved in geometry calculations
virtual void DoMoveWindow(int x, int y, int width, int height);
virtual wxSize DoGetBestSize() const;
// sends combobox select event from the parent combo control
void SendComboBoxEvent( int selection );
-
+
// gets value, sends event and dismisses
void DismissWithEvent();
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
- long style = 0,
+ long style,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
virtual int GetSelection() const;
virtual void SetSelection(int n) { Select(n); }
+
+ // Prevent a method from being hidden
+ virtual void SetSelection(long from, long to)
+ {
+ wxComboCtrl::SetSelection(from,to);
+ }
+
wxCONTROL_ITEMCONTAINER_CLIENTDATAOBJECT_RECAST
protected:
#endif // wxUSE_ODCOMBOBOX
+
#endif
// _WX_ODCOMBO_H_
m_toplevEvtHandler = (wxEvtHandler*) NULL;
#endif
- if ( m_popup )
- m_popup->RemoveEventHandler(m_popupExtraHandler);
-
- delete m_popupExtraHandler;
-
- HidePopup();
-
- delete m_popupInterface;
- delete m_winPopup;
+ DestroyPopup();
RemoveEventHandler(m_extraEvtHandler);
popupInterface->m_iFlags |= wxCP_IFLAG_CREATED;
}
+// Destroy popup window and the child control
+void wxComboCtrlBase::DestroyPopup()
+{
+ if ( m_popup )
+ m_popup->RemoveEventHandler(m_popupExtraHandler);
+
+ delete m_popupExtraHandler;
+
+ HidePopup();
+
+ delete m_popupInterface;
+
+ if ( m_winPopup )
+ m_winPopup->Destroy();
+
+ m_popupInterface = (wxComboPopup*) NULL;
+ m_winPopup = (wxWindow*) NULL;
+ m_popup = (wxWindow*) NULL;
+}
+
void wxComboCtrlBase::SetPopupControl( wxComboPopup* iface )
{
wxCHECK_RET( iface, wxT("no popup interface set for wxComboCtrl") );
- delete m_popupInterface;
- delete m_winPopup;
+ DestroyPopup();
iface->InitBase(this);
iface->Init();
m_popupInterface = iface;
- if ( !iface->LazyCreate() || m_winPopup )
+ if ( !iface->LazyCreate() )
{
CreatePopup();
}