[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] wxWindowBase::GetValidator() const or not?

From: Greg Chicares
Subject: [lmi] wxWindowBase::GetValidator() const or not?
Date: Sat, 29 Apr 2006 02:08:33 +0000
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

The documentation says it's const:
| wxValidator* GetValidator() const
but the header says it isn't:
| virtual wxValidator *GetValidator() { return m_windowValidator; }

Would a change like

+ virtual wxValidator const *GetValidator() const { return m_windowValidator; }

make sense?

I realize that there's little you can do with a const wxValidator per se,
and calling GetWindow() on it in this case would be silly:

  wxWindow const* w = ...
  w->GetValidator->GetWindow(); // Same as w

but this would be useful for derived classes: for example,

  void do_something_that_depends_on_include_list(wxWindow const* w)
    wxTextValidator const* v = 
      wxArrayString const& includes = v->GetIncludes();

reply via email to

[Prev in Thread] Current Thread [Next in Thread]