]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixes for WinCE toolbar
authorJulian Smart <julian@anthemion.co.uk>
Sun, 20 Mar 2005 12:02:55 +0000 (12:02 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Sun, 20 Mar 2005 12:02:55 +0000 (12:02 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32932 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/tbar95.cpp
src/msw/wince/tbarwce.cpp

index 56df126fa4f3eac1fb03e289e0f2b9271bcdff91..2dfd130a585130fae333409dcfd9838565eaedf8 100644 (file)
@@ -520,6 +520,11 @@ bool wxToolBar::Realize()
     const bool isVertical = HasFlag(wxTB_VERTICAL);
 
     bool doRemap, doRemapBg, doTransparent;
+#ifdef __WXWINCE__
+    doRemapBg = false;
+    doRemap = false;
+    doTransparent = false;
+#else
     if (wxSystemOptions::GetOptionInt(wxT("msw.remap")) == 2)
     {
         doRemapBg = doRemap = false;
@@ -531,6 +536,7 @@ bool wxToolBar::Realize()
         doRemapBg = !doRemap;
         doTransparent = false;
     }
+#endif
 
     // delete all old buttons, if any
     for ( size_t pos = 0; pos < m_nButtons; pos++ )
@@ -570,15 +576,20 @@ bool wxToolBar::Realize()
         wxMemoryDC dcAllButtons;
         wxBitmap bitmap(totalBitmapWidth, totalBitmapHeight);
         dcAllButtons.SelectObject(bitmap);
+#ifdef __WXWINCE__
+        dcAllButtons.SetBackground(wxBrush(wxColour(192,192,192)));
+#else
         if (doTransparent)
             dcAllButtons.SetBackground(*wxTRANSPARENT_BRUSH);
         else
-        dcAllButtons.SetBackground(*wxLIGHT_GREY_BRUSH);
+            dcAllButtons.SetBackground(*wxLIGHT_GREY_BRUSH);
+#endif        
         dcAllButtons.Clear();
 
         m_hBitmap = bitmap.GetHBITMAP();
         HBITMAP hBitmap = (HBITMAP)m_hBitmap;
 
+#ifndef __WXWINCE__
         if (doRemapBg)
         {
             dcAllButtons.SelectObject(wxNullBitmap);
@@ -590,6 +601,7 @@ bool wxToolBar::Realize()
 
             dcAllButtons.SelectObject(bitmap);
         }
+#endif
 
         // the button position
         wxCoord x = 0;
@@ -1434,20 +1446,22 @@ WXLRESULT wxToolBar::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam
 {
     switch ( nMsg )
     {
-        case WM_SIZE:
-            if ( HandleSize(wParam, lParam) )
-                return 0;
-            break;
-
         case WM_MOUSEMOVE:
             // we don't handle mouse moves, so always pass the message to
-            // wxControl::MSWWindowProc
+            // wxControl::MSWWindowProc (HandleMouseMove just calls OnMouseEnter)
             HandleMouseMove(wParam, lParam);
             break;
 
+        case WM_SIZE:
+            if ( HandleSize(wParam, lParam) )
+                return 0;
+            break;
+
+#ifndef __WXWINCE__
         case WM_PAINT:
             if ( HandlePaint(wParam, lParam) )
                 return 0;
+#endif
     }
 
     return wxControl::MSWWindowProc(nMsg, wParam, lParam);
index 5161b4806ff70bbc46044272168004697fb65f1d..ae471ff2fd6929083d9e56e72266fe9f212b0d3e 100644 (file)
@@ -355,7 +355,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 +393,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 +420,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;