]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/toolbar.cpp
Small oops in redrawing code.
[wxWidgets.git] / src / motif / toolbar.cpp
index 56529122275fc43083a64104899a1e4f7c939074..9a79f005ba8d06e89f7ee903536388319e68e3b8 100644 (file)
@@ -172,6 +172,12 @@ void wxToolBar::Init()
     m_maxHeight = -1;
     m_defaultWidth = 24;
     m_defaultHeight = 22;
+    m_toolPacking = 2;
+    m_toolSeparation = 8;
+    m_xMargin = 2;
+    m_yMargin = 2;
+    m_maxRows = 100;
+    m_maxCols = 100;
 }
 
 bool wxToolBar::Create(wxWindow *parent,
@@ -245,6 +251,7 @@ bool wxToolBar::Realize()
     // Separator spacing
     const int separatorSize = GetToolSeparation(); // 8;
     wxSize margins = GetToolMargins();
+    wxSize packing = GetToolPacking();
     int marginX = margins.x;
     int marginY = margins.y;
 
@@ -267,7 +274,12 @@ bool wxToolBar::Realize()
         switch ( tool->GetStyle() )
         {
             case wxTOOL_STYLE_CONTROL:
-                wxFAIL_MSG( _T("not implemented") );
+                wxControl* control = tool->GetControl();
+                wxSize sz = control->GetSize();
+                wxSize pos = control->GetPosition();
+                control->Move(currentX, pos.y);
+                currentX += sz.x + packing.x;
+
                 break;
 
             case wxTOOL_STYLE_SEPARATOR:
@@ -435,7 +447,7 @@ bool wxToolBar::Realize()
                                   XmNwidth, &width,
                                   XmNheight, & height,
                                   NULL);
-                    currentX += width + marginX;
+                    currentX += width + packing.x;
                     buttonHeight = wxMax(buttonHeight, height);
                 }