X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e49776ccfbdd36a2930266dc3fcd48bab8e5460d..b404a8f3b072129c107c6d9a5e0f6f53cd34807b:/src/common/stockitem.cpp diff --git a/src/common/stockitem.cpp b/src/common/stockitem.cpp index 9a02d8bf58..1d0e914631 100644 --- a/src/common/stockitem.cpp +++ b/src/common/stockitem.cpp @@ -205,16 +205,17 @@ wxString wxGetStockLabel(wxWindowID id, long flags) #undef STOCKITEM - // we assume that buttons use the same labels as menu items but unlike them - // they should never use ellipsis - if ( (flags & wxSTOCK_FOR_BUTTON) == wxSTOCK_FOR_BUTTON ) + if ( flags & wxSTOCK_WITHOUT_ELLIPSIS ) { wxString baseLabel; if ( stockLabel.EndsWith("...", &baseLabel) ) stockLabel = baseLabel; + // accelerators only make sense for the menu items which should have + // ellipsis too while wxSTOCK_WITHOUT_ELLIPSIS is mostly useful for + // buttons which shouldn't have accelerators in their labels wxASSERT_MSG( !(flags & wxSTOCK_WITH_ACCELERATOR), - "button labels never use accelerators" ); + "labels without ellipsis shouldn't use accelerators" ); } #ifdef __WXMSW__