]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/framelayout/src/dyntbar.cpp
#included log.h
[wxWidgets.git] / utils / framelayout / src / dyntbar.cpp
index cc5aa166bc41cf7ce2febe0f7cad777901c9d911..a5019a86c7905f6b67633e32b0c2018c2645fdfa 100644 (file)
@@ -67,7 +67,7 @@ wxDynamicToolBar::wxDynamicToolBar(wxWindow *parent, const wxWindowID id,
 {
        Create(parent, id, pos, size, style, orientation, RowsOrColumns, name);
 
-       SetBackgroundColour( wxColour(192,192,192) );
+       SetBackgroundColour( wxSystemSettings::GetSystemColour( wxSYS_COLOUR_3DFACE) );
 }
 
 bool wxDynamicToolBar::Create(wxWindow *parent, const wxWindowID id, 
@@ -82,7 +82,7 @@ bool wxDynamicToolBar::Create(wxWindow *parent, const wxWindowID id,
        if ( ! wxWindow::Create(parent, id, pos, size, style, name) )
                return FALSE;
 
-       SetBackgroundColour( wxColour( 192,192,192 ) );
+       SetBackgroundColour( wxSystemSettings::GetSystemColour( wxSYS_COLOUR_3DFACE ));
 
        return TRUE;
 }
@@ -145,6 +145,26 @@ void wxDynamicToolBar::AddTool( int toolIndex,
        
        AddTool( toolIndex, pBtn );
 }
+void wxDynamicToolBar::AddTool( int toolIndex, wxBitmap labelBmp,
+                                                               const wxString& labelText, bool alignTextRight,
+                                                               bool isFlat )
+{
+       wxNewBitmapButton* pBtn =
+
+         new wxNewBitmapButton( labelBmp,
+                                                        labelText, 
+                                                        ( alignTextRight ) 
+                                                        ? NB_ALIGN_TEXT_RIGHT 
+                                                        : NB_ALIGN_TEXT_BOTTOM,
+                                                        isFlat
+                                                  );
+
+       pBtn->Create( this, toolIndex );
+
+       pBtn->Reshape();
+       
+       AddTool( toolIndex, pBtn );
+}
 
 
   wxToolBarTool* 
@@ -322,7 +342,7 @@ void wxDynamicToolBar::SizeToolWindows()
        }
 }
 
-void wxDynamicToolBar::Layout()
+bool wxDynamicToolBar::Layout()
 {
        if ( !mpLayoutMan ) mpLayoutMan = CreateDefaulLayout();
 
@@ -339,6 +359,7 @@ void wxDynamicToolBar::Layout()
        mpLayoutMan->Layout( wndDim, result, items, mVertGap, mHorizGap );;
 
        SizeToolWindows();
+    return TRUE;
 }
 
 void wxDynamicToolBar::GetPreferredDim( const wxSize& givenDim, wxSize& prefDim )