]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/themes/win32.cpp
readding trace constant
[wxWidgets.git] / src / univ / themes / win32.cpp
index 5aa723165f47ac701fc80e5f3132ccd957d99bef..40475959a0d569be0d3c465200e882db776e1f88 100644 (file)
     #pragma hdrstop
 #endif
 
+#include "wx/univ/theme.h"
+
+#if wxUSE_THEME_WIN32
+
 #ifndef WX_PRECOMP
     #include "wx/timer.h"
     #include "wx/intl.h"
@@ -31,6 +35,7 @@
     #include "wx/window.h"
 
     #include "wx/dcmemory.h"
+    #include "wx/dcclient.h"
 
     #include "wx/button.h"
     #include "wx/bmpbuttn.h"
@@ -65,7 +70,6 @@
 #include "wx/univ/inpcons.h"
 #include "wx/univ/inphand.h"
 #include "wx/univ/colschem.h"
-#include "wx/univ/theme.h"
 
 // ----------------------------------------------------------------------------
 // constants
@@ -1280,6 +1284,7 @@ wxColour wxWin32ColourScheme::Get(wxWin32ColourScheme::StdColour col) const
         case TITLEBAR_ACTIVE_TEXT: return wxColour(GetSysColor(COLOR_CAPTIONTEXT));
 
         case DESKTOP:           return wxColour(0x808000);
+        case FRAME:             return wxColour(GetSysColor(COLOR_APPWORKSPACE));
 #else // !__WXMSW__
         // use the standard Windows colours elsewhere
         case WINDOW:            return *wxWHITE;
@@ -1312,6 +1317,7 @@ wxColour wxWin32ColourScheme::Get(wxWin32ColourScheme::StdColour col) const
         case TITLEBAR_ACTIVE_TEXT:return *wxWHITE;
 
         case DESKTOP:           return wxColour(0x808000);
+        case FRAME:             return wxColour(0x808080);
 #endif // __WXMSW__
 
         case GAUGE:             return Get(HIGHLIGHT);
@@ -1717,7 +1723,7 @@ void wxWin32Renderer::DrawToolBarButton(wxDC& dc,
         {
             int xpoint = (rect.GetLeft() + rect.GetRight() + 1 - bitmap.GetWidth()) / 2;
             int ypoint = (rect.GetTop() + rect.GetBottom() + 1 - bitmap.GetHeight()) / 2;
-            dc.DrawBitmap(bitmap, xpoint, ypoint);
+            dc.DrawBitmap(bitmap, xpoint, ypoint, bitmap.GetMask() != NULL);
         }
     }
     else if (style == wxTOOL_STYLE_SEPARATOR)
@@ -2047,7 +2053,7 @@ void wxWin32Renderer::DrawSliderShaft(wxDC& dc,
     */
 
     if (flags & wxCONTROL_FOCUSED) {
-        DrawFocusRect(dc, rectOrig);
+        DrawFocusRect(NULL, dc, rectOrig);
     }
 
     wxRect rect = GetSliderShaftRect(rectOrig, lenThumb, orient, style);
@@ -2499,7 +2505,7 @@ wxMenuGeometryInfo *wxWin32Renderer::GetMenuGeometry(wxWindow *win,
             h = heightText;
 
             wxCoord widthLabel;
-            dc.GetTextExtent(item->GetLabel(), &widthLabel, NULL);
+            dc.GetTextExtent(item->GetItemLabelText(), &widthLabel, NULL);
             if ( widthLabel > widthLabelMax )
             {
                 widthLabelMax = widthLabel;
@@ -3190,10 +3196,9 @@ bool wxWin32InputHandler::HandleMouse(wxInputConsumer *control,
     // clicking on the control gives it focus
     if ( event.ButtonDown() )
     {
-        wxWindow *win = control->GetInputWindow();
+        wxWindow * const win = control->GetInputWindow();
 
-        if ( (wxWindow::FindFocus() != control->GetInputWindow()) &&
-             win->AcceptsFocus() )
+        if ( win->CanAcceptFocus() && wxWindow::FindFocus() != win )
         {
             win->SetFocus();
 
@@ -3226,13 +3231,11 @@ bool wxWin32ScrollBarInputHandler::OnScrollTimer(wxScrollBar *scrollbar,
     bool stop = false;
     if ( action == wxACTION_SCROLL_PAGE_DOWN )
     {
-        stop = m_renderer->HitTestScrollbar(scrollbar, m_ptStartScrolling)
-                != wxHT_SCROLLBAR_BAR_2;
+        stop = scrollbar->HitTestBar(m_ptStartScrolling) != wxHT_SCROLLBAR_BAR_2;
     }
     else if ( action == wxACTION_SCROLL_PAGE_UP )
     {
-        stop = m_renderer->HitTestScrollbar(scrollbar, m_ptStartScrolling)
-                != wxHT_SCROLLBAR_BAR_1;
+        stop = scrollbar->HitTestBar(m_ptStartScrolling) != wxHT_SCROLLBAR_BAR_1;
     }
 
     if ( stop )
@@ -3294,7 +3297,7 @@ bool wxWin32ScrollBarInputHandler::HandleMouseMove(wxInputConsumer *control,
             return false;
         }
 
-        ht = m_renderer->HitTestScrollbar(scrollbar, event.GetPosition());
+        ht = scrollbar->HitTestBar(event.GetPosition());
         if ( ht == m_htLast )
         {
             // yes it did, resume scrolling
@@ -3324,7 +3327,7 @@ bool wxWin32ScrollBarInputHandler::HandleMouseMove(wxInputConsumer *control,
         // Always let thumb jump back if we leave the scrollbar
         if ( event.Moving() )
         {
-            ht = m_renderer->HitTestScrollbar(scrollbar, event.GetPosition());
+            ht = scrollbar->HitTestBar(event.GetPosition());
         }
         else // event.Leaving()
         {
@@ -3343,7 +3346,7 @@ bool wxWin32ScrollBarInputHandler::HandleMouseMove(wxInputConsumer *control,
             if (pos.y > -40 && pos.y < scrollbar->GetSize().y+40)
                pos.y = 5;
         }
-        ht = m_renderer->HitTestScrollbar(scrollbar, pos );
+        ht = scrollbar->HitTestBar(pos);
 #endif
 
         // if we're dragging the thumb and the mouse stays in the scrollbar, it
@@ -3772,3 +3775,5 @@ bool wxWin32FrameInputHandler::HandleActivation(wxInputConsumer *consumer,
 
     return wxStdInputHandler::HandleActivation(consumer, activated);
 }
+
+#endif // wxUSE_THEME_WIN32