]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/wince/tbarwce.cpp
wxPalette unified. Source cleaning.
[wxWidgets.git] / src / msw / wince / tbarwce.cpp
index c2d6df75b04fbfaec57dfc11f5c22c94dde628c0..5a410368c428e0250e232bdbc6380925b07dafa2 100644 (file)
 // headers
 // ----------------------------------------------------------------------------
 
 // 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"
 
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
@@ -393,6 +389,7 @@ bool wxToolMenuBar::Realize()
             case wxTOOL_STYLE_CONTROL:
                 button.idCommand = tool->GetId();
                 // fall through: create just a separator too
             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;
 
             case wxTOOL_STYLE_SEPARATOR:
                 button.fsState = TBSTATE_ENABLED;
@@ -414,12 +411,13 @@ bool wxToolMenuBar::Realize()
 
                 wxBitmap bmpToUse = bmp;
 
 
                 wxBitmap bmpToUse = bmp;
 
-                if (bmp.GetWidth() < 16 || bmp.GetHeight() < 16)
+                if (bmp.GetWidth() < 16 || bmp.GetHeight() < 16 || bmp.GetMask() != NULL)
                 {
                     wxMemoryDC memDC;
                     wxBitmap b(16,16);
                     memDC.SelectObject(b);
                 {
                     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;
                     memDC.Clear();
                     int x = (16 - bmp.GetWidth())/2;
                     int y = (16 - bmp.GetHeight())/2;
@@ -477,9 +475,10 @@ bool wxToolMenuBar::Realize()
                 break;
         }
 
                 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;
     }
 
         lastWasRadio = isRadio;
     }
@@ -527,6 +526,27 @@ bool wxToolMenuBar::MSWCommand(WXUINT WXUNUSED(cmd), WXWORD id)
     return true;
 }
 
     return true;
 }
 
+WXLRESULT wxToolMenuBar::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
+{
+    switch ( nMsg )
+    {
+        case WM_SIZE:
+            break;
+
+        case WM_MOUSEMOVE:
+            // we don't handle mouse moves, so always pass the message to
+            // wxControl::MSWWindowProc
+            HandleMouseMove(wParam, lParam);
+            break;
+
+        case WM_PAINT:
+            break;
+    }
+
+    return wxControl::MSWWindowProc(nMsg, wParam, lParam);
+}
+
+
 #else
 
 ////////////// For Smartphone
 #else
 
 ////////////// For Smartphone