]> git.saurik.com Git - wxWidgets.git/blobdiff - src/aui/auibar.cpp
use CPPUNIT_ASSERT_EQUAL instead of CPPUNIT_ASSERT whenever possible to see more...
[wxWidgets.git] / src / aui / auibar.cpp
index d398e2b79502c7b5e90beedaaa181915a0b80b2d..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;
     }
 }
 
@@ -833,7 +839,7 @@ wxAuiToolBar::wxAuiToolBar(wxWindow* parent,
     m_gripper_sizer_item = NULL;
     m_overflow_sizer_item = NULL;
     m_dragging = false;
-    m_style = style;
+    m_style = style | wxBORDER_NONE;
     m_gripper_visible = (m_style & wxAUI_TB_GRIPPER) ? true : false;
     m_overflow_visible = (m_style & wxAUI_TB_OVERFLOW) ? true : false;
     m_overflow_state = 0;