Fixed wxValidator::Clone and friends to return a wxObject* to keep
MS VC++ happy git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2309 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -33,7 +33,7 @@ public:
|
|||||||
// if you're passing a reference to a validator.
|
// if you're passing a reference to a validator.
|
||||||
// Another possibility is to always pass a pointer to a new validator
|
// Another possibility is to always pass a pointer to a new validator
|
||||||
// (so the calling code can use a copy constructor of the relevant class).
|
// (so the calling code can use a copy constructor of the relevant class).
|
||||||
virtual wxValidator *Clone(void) const { return new wxGenericValidator(*this); }
|
virtual wxObject *Clone(void) const { return new wxGenericValidator(*this); }
|
||||||
bool Copy(const wxGenericValidator& val);
|
bool Copy(const wxGenericValidator& val);
|
||||||
|
|
||||||
// Called when the value in the window must be validated.
|
// Called when the value in the window must be validated.
|
||||||
|
@@ -42,7 +42,7 @@ public:
|
|||||||
// if you're passing a reference to a validator.
|
// if you're passing a reference to a validator.
|
||||||
// Another possibility is to always pass a pointer to a new validator
|
// Another possibility is to always pass a pointer to a new validator
|
||||||
// (so the calling code can use a copy constructor of the relevant class).
|
// (so the calling code can use a copy constructor of the relevant class).
|
||||||
virtual wxValidator *Clone() const
|
virtual wxObject *Clone() const
|
||||||
{ return (wxValidator *)NULL; }
|
{ return (wxValidator *)NULL; }
|
||||||
bool Copy(const wxValidator& val)
|
bool Copy(const wxValidator& val)
|
||||||
{ m_validatorWindow = val.m_validatorWindow; return TRUE; }
|
{ m_validatorWindow = val.m_validatorWindow; return TRUE; }
|
||||||
|
@@ -39,7 +39,7 @@ public:
|
|||||||
// if you're passing a reference to a validator.
|
// if you're passing a reference to a validator.
|
||||||
// Another possibility is to always pass a pointer to a new validator
|
// Another possibility is to always pass a pointer to a new validator
|
||||||
// (so the calling code can use a copy constructor of the relevant class).
|
// (so the calling code can use a copy constructor of the relevant class).
|
||||||
virtual wxValidator *Clone(void) const { return new wxTextValidator(*this); }
|
virtual wxObject *Clone(void) const { return new wxTextValidator(*this); }
|
||||||
bool Copy(const wxTextValidator& val);
|
bool Copy(const wxTextValidator& val);
|
||||||
|
|
||||||
// Called when the value in the window must be validated.
|
// Called when the value in the window must be validated.
|
||||||
|
@@ -2575,7 +2575,7 @@ wxValidator *wxWindow::GetValidator()
|
|||||||
void wxWindow::SetValidator( const wxValidator& validator )
|
void wxWindow::SetValidator( const wxValidator& validator )
|
||||||
{
|
{
|
||||||
if (m_windowValidator) delete m_windowValidator;
|
if (m_windowValidator) delete m_windowValidator;
|
||||||
m_windowValidator = validator.Clone();
|
m_windowValidator = (wxValidator*)validator.Clone();
|
||||||
if (m_windowValidator) m_windowValidator->SetWindow(this);
|
if (m_windowValidator) m_windowValidator->SetWindow(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2575,7 +2575,7 @@ wxValidator *wxWindow::GetValidator()
|
|||||||
void wxWindow::SetValidator( const wxValidator& validator )
|
void wxWindow::SetValidator( const wxValidator& validator )
|
||||||
{
|
{
|
||||||
if (m_windowValidator) delete m_windowValidator;
|
if (m_windowValidator) delete m_windowValidator;
|
||||||
m_windowValidator = validator.Clone();
|
m_windowValidator = (wxValidator*)validator.Clone();
|
||||||
if (m_windowValidator) m_windowValidator->SetWindow(this);
|
if (m_windowValidator) m_windowValidator->SetWindow(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -4449,7 +4449,7 @@ void wxWindow::SetValidator(const wxValidator& validator)
|
|||||||
{
|
{
|
||||||
if ( m_windowValidator )
|
if ( m_windowValidator )
|
||||||
delete m_windowValidator;
|
delete m_windowValidator;
|
||||||
m_windowValidator = validator.Clone();
|
m_windowValidator = (wxValidator*)validator.Clone();
|
||||||
|
|
||||||
if ( m_windowValidator )
|
if ( m_windowValidator )
|
||||||
m_windowValidator->SetWindow(this) ;
|
m_windowValidator->SetWindow(this) ;
|
||||||
|
Reference in New Issue
Block a user