Remove fudges in Show: 1) Do not force a window to top when it is shown 2) Remove...
[wxWidgets.git] / src / msw / wince / tbarwce.cpp
index 5161b4806ff70bbc46044272168004697fb65f1d..5a410368c428e0250e232bdbc6380925b07dafa2 100644 (file)
 // headers
 // ----------------------------------------------------------------------------
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-    #pragma implementation "tbarwce.h"
-#endif
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
@@ -355,7 +351,7 @@ bool wxToolMenuBar::DoDeleteTool(size_t pos, wxToolBarToolBase *tool)
     return true;
 }
 
-bool wxToolMenuBar:Realize()
+bool wxToolMenuBar::Realize()
 {
     const size_t nTools = GetToolsCount();
     if ( nTools == 0 )
@@ -393,6 +389,7 @@ bool wxToolMenuBar:Realize()
             case wxTOOL_STYLE_CONTROL:
                 button.idCommand = tool->GetId();
                 // fall through: create just a separator too
+                // TODO: controls are not yet supported on wxToolMenuBar.
 
             case wxTOOL_STYLE_SEPARATOR:
                 button.fsState = TBSTATE_ENABLED;
@@ -419,7 +416,8 @@ bool wxToolMenuBar:Realize()
                     wxMemoryDC memDC;
                     wxBitmap b(16,16);
                     memDC.SelectObject(b);
-                    memDC.SetBackground(wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)));
+                    wxColour col = wxColour(192,192,192);
+                    memDC.SetBackground(wxBrush(col));
                     memDC.Clear();
                     int x = (16 - bmp.GetWidth())/2;
                     int y = (16 - bmp.GetHeight())/2;
@@ -477,9 +475,10 @@ bool wxToolMenuBar:Realize()
                 break;
         }
 
-        BOOL bRc = ::CommandBar_AddButtons( (HWND) GetHWND(), 1, buttons );
-        
-        wxASSERT_MSG( bRc, wxT("Could not add toolbar button."));
+        if ( !::CommandBar_AddButtons( (HWND) GetHWND(), 1, buttons ) )
+        {
+            wxFAIL_MSG( wxT("Could not add toolbar button."));
+        }
 
         lastWasRadio = isRadio;
     }