Add small helper function to wxMSW wxToolBar code

Encapsulate the logic for deciding whether we should show the labels for
the embedded controls or not in a small helper function, to make it
simpler to change it in the future if needed and also to have a single
place to explain why do we do what we do now.

No real changes.
This commit is contained in:
Vadim Zeitlin
2019-02-24 02:03:23 +01:00
parent 4a02b73a6a
commit 82857cfa9d
2 changed files with 11 additions and 5 deletions

View File

@@ -174,6 +174,16 @@ private:
WXHBRUSH MSWGetToolbarBgBrush();
#endif // wxHAS_MSW_BACKGROUND_ERASE_HOOK
// Return true if we're showing the labels for the embedded controls: we
// only do it if text is enabled and, somewhat less expectedly, if icons
// are enabled too because showing both the control and its label when only
// text is shown for the other buttons is too inconsistent to be useful.
bool AreControlLabelsShown() const
{
return HasFlag(wxTB_TEXT) && !HasFlag(wxTB_NOICONS);
}
wxDECLARE_EVENT_TABLE();
wxDECLARE_DYNAMIC_CLASS(wxToolBar);
wxDECLARE_NO_COPY_CLASS(wxToolBar);