]> git.saurik.com Git - wxWidgets.git/blobdiff - src/aui/auibar.cpp
fixing param
[wxWidgets.git] / src / aui / auibar.cpp
index 0497c3ced9a3e29ad441d87906e638db8378fa1c..d356d353a208ebc5038f098bcf7302eace75db4e 100644 (file)
@@ -554,7 +554,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);
 }
 
@@ -728,9 +734,9 @@ void wxAuiDefaultToolBarArt::SetElementSize(int element_id, int size)
 {
     switch (element_id)
     {
-        case wxAUI_TBART_SEPARATOR_SIZE: m_separator_size = size;
-        case wxAUI_TBART_GRIPPER_SIZE:   m_gripper_size = size;
-        case wxAUI_TBART_OVERFLOW_SIZE:  m_overflow_size = size;
+        case wxAUI_TBART_SEPARATOR_SIZE: m_separator_size = size; break;
+        case wxAUI_TBART_GRIPPER_SIZE:   m_gripper_size = size; break;
+        case wxAUI_TBART_OVERFLOW_SIZE:  m_overflow_size = size; break;
     }
 }