From e787be745729644e414a5a586e0a7a03b4c4cbb5 Mon Sep 17 00:00:00 2001 From: Benjamin Williams Date: Thu, 16 Apr 2009 12:58:37 +0000 Subject: [PATCH] implement default width for toolbar labels git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@60197 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/aui/auibar.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/aui/auibar.cpp b/src/aui/auibar.cpp index 05917b9a55..f2f3622f64 100644 --- a/src/aui/auibar.cpp +++ b/src/aui/auibar.cpp @@ -539,7 +539,13 @@ wxSize wxAuiDefaultToolBarArt::GetLabelSize( // get item's width width = item.GetMinSize().GetWidth(); - + + if (width == -1) + { + // no width specified, measure the text ourselves + width = dc.GetTextExtent(item.GetLabel()).GetX(); + } + return wxSize(width, height); }