Check for correct window in wxNumValidatorBase::SetWindow()
Override SetWindow() to check that the validator is being associated with the window of the correct type, this allows to trigger an assert immediately if this is not the case, making it simpler to find the error as the call to SetValitator() on the wrong window will be in the call stack when this happens, unlike before when the assert would happen only at some later time.
This commit is contained in:
@@ -50,6 +50,10 @@ public:
|
||||
// we don't need this as we do our validation on the fly here.
|
||||
virtual bool Validate(wxWindow * WXUNUSED(parent)) wxOVERRIDE { return true; }
|
||||
|
||||
// Override base class method to check that the window is a text control or
|
||||
// combobox.
|
||||
virtual void SetWindow(wxWindow *win) wxOVERRIDE;
|
||||
|
||||
protected:
|
||||
wxNumValidatorBase(int style)
|
||||
{
|
||||
|
Reference in New Issue
Block a user