Moved the [Set|Get]Client[Data|Object] and such out of wxWindowBase
and into a mixin class. Mixed it with wxEvtHandler. Regenerated files lists and makefiles. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11911 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -115,10 +115,6 @@ void wxWindowBase::InitBase()
|
||||
m_isShown = FALSE;
|
||||
m_isEnabled = TRUE;
|
||||
|
||||
// no client data (yet)
|
||||
m_clientData = NULL;
|
||||
m_clientDataType = wxClientData_None;
|
||||
|
||||
// the default event handler is just this window
|
||||
m_eventHandler = this;
|
||||
|
||||
@@ -236,10 +232,6 @@ wxWindowBase::~wxWindowBase()
|
||||
delete m_windowValidator;
|
||||
#endif // wxUSE_VALIDATORS
|
||||
|
||||
// we only delete object data, not untyped
|
||||
if ( m_clientDataType == wxClientData_Object )
|
||||
delete m_clientObject;
|
||||
|
||||
#if wxUSE_CONSTRAINTS
|
||||
// Have to delete constraints/sizer FIRST otherwise sizers may try to look
|
||||
// at deleted windows as they delete themselves.
|
||||
@@ -1471,51 +1463,6 @@ wxPoint wxWindowBase::ConvertDialogToPixels(const wxPoint& pt)
|
||||
return pt2;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// client data
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxWindowBase::DoSetClientObject( wxClientData *data )
|
||||
{
|
||||
wxASSERT_MSG( m_clientDataType != wxClientData_Void,
|
||||
wxT("can't have both object and void client data") );
|
||||
|
||||
if ( m_clientObject )
|
||||
delete m_clientObject;
|
||||
|
||||
m_clientObject = data;
|
||||
m_clientDataType = wxClientData_Object;
|
||||
}
|
||||
|
||||
wxClientData *wxWindowBase::DoGetClientObject() const
|
||||
{
|
||||
// it's not an error to call GetClientObject() on a window which doesn't
|
||||
// have client data at all - NULL will be returned
|
||||
wxASSERT_MSG( m_clientDataType != wxClientData_Void,
|
||||
wxT("this window doesn't have object client data") );
|
||||
|
||||
return m_clientObject;
|
||||
}
|
||||
|
||||
void wxWindowBase::DoSetClientData( void *data )
|
||||
{
|
||||
wxASSERT_MSG( m_clientDataType != wxClientData_Object,
|
||||
wxT("can't have both object and void client data") );
|
||||
|
||||
m_clientData = data;
|
||||
m_clientDataType = wxClientData_Void;
|
||||
}
|
||||
|
||||
void *wxWindowBase::DoGetClientData() const
|
||||
{
|
||||
// it's not an error to call GetClientData() on a window which doesn't have
|
||||
// client data at all - NULL will be returned
|
||||
wxASSERT_MSG( m_clientDataType != wxClientData_Object,
|
||||
wxT("this window doesn't have void client data") );
|
||||
|
||||
return m_clientData;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// event handlers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user