Added wxSTOCK_FOR_BUTTON flag for wxGetStockLabel().
This allows to retrieve labels appropriate for the buttons and not menu items which currently means without trailing ellipsis. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61526 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -205,6 +205,18 @@ 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 )
|
||||
{
|
||||
wxString baseLabel;
|
||||
if ( stockLabel.EndsWith("...", &baseLabel) )
|
||||
stockLabel = baseLabel;
|
||||
|
||||
wxASSERT_MSG( !(flags & wxSTOCK_WITH_ACCELERATOR),
|
||||
"button labels never use accelerators" );
|
||||
}
|
||||
|
||||
if ( !(flags & wxSTOCK_WITH_MNEMONIC) )
|
||||
{
|
||||
stockLabel = wxStripMenuCodes(stockLabel);
|
||||
|
||||
Reference in New Issue
Block a user