Replace dynamic casts with MSWShouldSetDefaultFont() virtual method

Get rid of ugly wxDynamicCastThis()s in wxMSW wxControl code and add a
new virtual method overridden in wx{Tree,List}Ctrl instead.

Also stop comparing the font with wxSYS_DEFAULT_GUI_FONT, there doesn't
seem to be any good reason to set this particular font for these
controls neither.

In addition to simplifying and de-ugligying the code, this commit
incidentally fixes -Wnonnull-compare warnings in this code from gcc6
too.
This commit is contained in:
Vadim Zeitlin
2017-08-21 02:09:19 +02:00
parent 04c5a179be
commit c45a8d49f1
4 changed files with 11 additions and 33 deletions

View File

@@ -380,6 +380,8 @@ protected:
// common part of all ctors
void Init();
virtual bool MSWShouldSetDefaultFont() const wxOVERRIDE { return false; }
// Implement constrained best size calculation.
virtual int DoGetBestClientHeight(int width) const wxOVERRIDE
{ return MSWGetBestViewRect(width, -1).y; }