]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/themes/mono.cpp
Avoid clash with control container event handlers
[wxWidgets.git] / src / univ / themes / mono.cpp
index a4ffd5f06dc280ef11146ea6cb271e1b3728aa9f..4fd27cea1e29a4ca7fdedd661a3339aa88fefc27 100644 (file)
     #pragma hdrstop
 #endif
 
+#include "wx/univ/theme.h"
+
+#if wxUSE_THEME_MONO
+
 #ifndef WX_PRECOMP
     #include "wx/dc.h"
 #endif // WX_PRECOMP
@@ -32,7 +36,6 @@
 #include "wx/univ/stdrend.h"
 #include "wx/univ/inphand.h"
 #include "wx/univ/colschem.h"
-#include "wx/univ/theme.h"
 
 class wxMonoColourScheme;
 
@@ -59,6 +62,8 @@ public:
                                  int indexAccel = -1,
                                  wxRect *rectBounds = NULL);
 
+    virtual void DrawFocusRect(wxWindow* win, wxDC& dc, const wxRect& rect, int flags = 0);
+
     virtual void DrawButtonBorder(wxDC& dc,
                                   const wxRect& rect,
                                   int flags = 0,
@@ -203,6 +208,12 @@ public:
                                                 const wxMenu& menu) const;
 #endif // wxUSE_MENUS
 
+#if wxUSE_STATUSBAR
+    virtual wxCoord GetStatusBarBorderBetweenFields() const;
+
+    virtual wxSize GetStatusBarFieldMargins() const;
+#endif // wxUSE_STATUSBAR
+
 protected:
     // override base class border drawing routines: we always draw just a
     // single simple border
@@ -232,6 +243,7 @@ protected:
         { return GetIndicator(IndicatorType_Radio, flags); }
 
     virtual wxBitmap GetFrameButtonBitmap(FrameButtonType type);
+    virtual int GetFrameBorderWidth(int flags) const;
 
 private:
     // the bitmaps returned by GetIndicator()
@@ -588,6 +600,7 @@ wxColour wxMonoColourScheme::Get(wxMonoColourScheme::StdColour col) const
         case TITLEBAR_ACTIVE:
         case HIGHLIGHT_TEXT:
         case DESKTOP:
+        case FRAME:
             return GetBg();
 
         case MAX:
@@ -689,6 +702,18 @@ wxMonoRenderer::DrawVerticalLine(wxDC& dc, wxCoord x, wxCoord y1, wxCoord y2)
     dc.DrawLine(x, y1, x, y2 + 1);
 }
 
+void wxMonoRenderer::DrawFocusRect(wxWindow* WXUNUSED(win), wxDC& dc, const wxRect& rect, int flags)
+{
+    // no need to draw the focus rect for selected items, it would be invisible
+    // anyhow
+    if ( !(flags & wxCONTROL_SELECTED) )
+    {
+        dc.SetPen(m_penFg);
+        dc.SetBrush(*wxTRANSPARENT_BRUSH);
+        dc.DrawRectangle(rect);
+    }
+}
+
 // ----------------------------------------------------------------------------
 // label
 // ----------------------------------------------------------------------------
@@ -702,7 +727,6 @@ void wxMonoRenderer::DrawButtonLabel(wxDC& dc,
                                      int indexAccel,
                                      wxRect *rectBounds)
 {
-    dc.SetTextForeground(m_penFg.GetColour());
     dc.DrawLabel(label, image, rect, alignment, indexAccel, rectBounds);
 
     if ( flags & wxCONTROL_DISABLED )
@@ -777,18 +801,18 @@ wxBitmap wxMonoRenderer::GetFrameButtonBitmap(FrameButtonType type)
 
 #if wxUSE_TOOLBAR
 
-void wxMonoRenderer::DrawToolBarButton(wxDC& dc,
-                                       const wxString& label,
-                                       const wxBitmap& bitmap,
-                                       const wxRect& rect,
-                                       int flags,
-                                       long style,
-                                       int tbarStyle)
+void wxMonoRenderer::DrawToolBarButton(wxDC& WXUNUSED(dc),
+                                       const wxString& WXUNUSED(label),
+                                       const wxBitmap& WXUNUSED(bitmap),
+                                       const wxRect& WXUNUSED(rect),
+                                       int WXUNUSED(flags),
+                                       long WXUNUSED(style),
+                                       int WXUNUSED(tbarStyle))
 {
     wxFAIL_MSG(_T("TODO"));
 }
 
-wxSize wxMonoRenderer::GetToolBarButtonSize(wxCoord *separator) const
+wxSize wxMonoRenderer::GetToolBarButtonSize(wxCoord *WXUNUSED(separator)) const
 {
     wxFAIL_MSG(_T("TODO"));
 
@@ -810,13 +834,13 @@ wxSize wxMonoRenderer::GetToolBarMargin() const
 
 #if wxUSE_NOTEBOOK
 
-void wxMonoRenderer::DrawTab(wxDC& dc,
-                             const wxRect& rect,
-                             wxDirection dir,
-                             const wxString& label,
-                             const wxBitmap& bitmap,
-                             int flags,
-                             int indexAccel)
+void wxMonoRenderer::DrawTab(wxDC& WXUNUSED(dc),
+                             const wxRect& WXUNUSED(rect),
+                             wxDirection WXUNUSED(dir),
+                             const wxString& WXUNUSED(label),
+                             const wxBitmap& WXUNUSED(bitmap),
+                             int WXUNUSED(flags),
+                             int WXUNUSED(indexAccel))
 {
     wxFAIL_MSG(_T("TODO"));
 }
@@ -843,10 +867,10 @@ wxSize wxMonoRenderer::GetTabPadding() const
 
 #if wxUSE_COMBOBOX
 
-void wxMonoRenderer::GetComboBitmaps(wxBitmap *bmpNormal,
-                                     wxBitmap *bmpFocus,
-                                     wxBitmap *bmpPressed,
-                                     wxBitmap *bmpDisabled)
+void wxMonoRenderer::GetComboBitmaps(wxBitmap *WXUNUSED(bmpNormal),
+                                     wxBitmap *WXUNUSED(bmpFocus),
+                                     wxBitmap *WXUNUSED(bmpPressed),
+                                     wxBitmap *WXUNUSED(bmpDisabled))
 {
     wxFAIL_MSG(_T("TODO"));
 }
@@ -859,43 +883,43 @@ void wxMonoRenderer::GetComboBitmaps(wxBitmap *bmpNormal,
 
 #if wxUSE_MENUS
 
-void wxMonoRenderer::DrawMenuBarItem(wxDC& dc,
-                                     const wxRect& rect,
-                                     const wxString& label,
-                                     int flags,
-                                     int indexAccel)
+void wxMonoRenderer::DrawMenuBarItem(wxDC& WXUNUSED(dc),
+                                     const wxRect& WXUNUSED(rect),
+                                     const wxString& WXUNUSED(label),
+                                     int WXUNUSED(flags),
+                                     int WXUNUSED(indexAccel))
 {
     wxFAIL_MSG(_T("TODO"));
 }
 
-void wxMonoRenderer::DrawMenuItem(wxDC& dc,
-                                  wxCoord y,
-                                  const wxMenuGeometryInfo& geometryInfo,
-                                  const wxString& label,
-                                  const wxString& accel,
-                                  const wxBitmap& bitmap,
-                                  int flags,
-                                  int indexAccel)
+void wxMonoRenderer::DrawMenuItem(wxDC& WXUNUSED(dc),
+                                  wxCoord WXUNUSED(y),
+                                  const wxMenuGeometryInfo& WXUNUSED(geometryInfo),
+                                  const wxString& WXUNUSED(label),
+                                  const wxString& WXUNUSED(accel),
+                                  const wxBitmap& WXUNUSED(bitmap),
+                                  int WXUNUSED(flags),
+                                  int WXUNUSED(indexAccel))
 {
     wxFAIL_MSG(_T("TODO"));
 }
 
-void wxMonoRenderer::DrawMenuSeparator(wxDC& dc,
-                                       wxCoord y,
-                                       const wxMenuGeometryInfo& geomInfo)
+void wxMonoRenderer::DrawMenuSeparator(wxDC& WXUNUSED(dc),
+                                       wxCoord WXUNUSED(y),
+                                       const wxMenuGeometryInfo& WXUNUSED(geomInfo))
 {
     wxFAIL_MSG(_T("TODO"));
 }
 
-wxSize wxMonoRenderer::GetMenuBarItemSize(const wxSize& sizeText) const
+wxSize wxMonoRenderer::GetMenuBarItemSize(const wxSize& WXUNUSED(sizeText)) const
 {
     wxFAIL_MSG(_T("TODO"));
 
     return wxSize();
 }
 
-wxMenuGeometryInfo *wxMonoRenderer::GetMenuGeometry(wxWindow *win,
-                                                    const wxMenu& menu) const
+wxMenuGeometryInfo *wxMonoRenderer::GetMenuGeometry(wxWindow *WXUNUSED(win),
+                                                    const wxMenu& WXUNUSED(menu)) const
 {
     wxFAIL_MSG(_T("TODO"));
 
@@ -910,36 +934,36 @@ wxMenuGeometryInfo *wxMonoRenderer::GetMenuGeometry(wxWindow *win,
 
 #if wxUSE_SLIDER
 
-void wxMonoRenderer::DrawSliderShaft(wxDC& dc,
-                                     const wxRect& rect,
-                                     int lenThumb,
-                                     wxOrientation orient,
-                                     int flags,
-                                     long style,
-                                     wxRect *rectShaft)
+void wxMonoRenderer::DrawSliderShaft(wxDC& WXUNUSED(dc),
+                                     const wxRect& WXUNUSED(rect),
+                                     int WXUNUSED(lenThumb),
+                                     wxOrientation WXUNUSED(orient),
+                                     int WXUNUSED(flags),
+                                     long WXUNUSED(style),
+                                     wxRect *WXUNUSED(rectShaft))
 {
     wxFAIL_MSG(_T("TODO"));
 }
 
 
-void wxMonoRenderer::DrawSliderThumb(wxDC& dc,
-                                     const wxRect& rect,
-                                     wxOrientation orient,
-                                     int flags,
-                                     long style)
+void wxMonoRenderer::DrawSliderThumb(wxDC& WXUNUSED(dc),
+                                     const wxRect& WXUNUSED(rect),
+                                     wxOrientation WXUNUSED(orient),
+                                     int WXUNUSED(flags),
+                                     long WXUNUSED(style))
 {
     wxFAIL_MSG(_T("TODO"));
 }
 
-void wxMonoRenderer::DrawSliderTicks(wxDC& dc,
-                                     const wxRect& rect,
-                                     int lenThumb,
-                                     wxOrientation orient,
-                                     int start,
-                                     int end,
-                                     int step,
-                                     int flags,
-                                     long style)
+void wxMonoRenderer::DrawSliderTicks(wxDC& WXUNUSED(dc),
+                                     const wxRect& WXUNUSED(rect),
+                                     int WXUNUSED(lenThumb),
+                                     wxOrientation WXUNUSED(orient),
+                                     int WXUNUSED(start),
+                                     int WXUNUSED(end),
+                                     int WXUNUSED(step),
+                                     int WXUNUSED(flags),
+                                     long WXUNUSED(style))
 {
     wxFAIL_MSG(_T("TODO"));
 }
@@ -959,19 +983,19 @@ wxCoord wxMonoRenderer::GetSliderTickLen() const
 }
 
 
-wxRect wxMonoRenderer::GetSliderShaftRect(const wxRect& rect,
-                                          int lenThumb,
-                                          wxOrientation orient,
-                                          long style) const
+wxRect wxMonoRenderer::GetSliderShaftRect(const wxRect& WXUNUSED(rect),
+                                          int WXUNUSED(lenThumb),
+                                          wxOrientation WXUNUSED(orient),
+                                          long WXUNUSED(style)) const
 {
     wxFAIL_MSG(_T("TODO"));
 
     return wxRect();
 }
 
-wxSize wxMonoRenderer::GetSliderThumbSize(const wxRect& rect,
-                                          int lenThumb,
-                                          wxOrientation orient) const
+wxSize wxMonoRenderer::GetSliderThumbSize(const wxRect& WXUNUSED(rect),
+                                          int WXUNUSED(lenThumb),
+                                          wxOrientation WXUNUSED(orient)) const
 {
     wxFAIL_MSG(_T("TODO"));
 
@@ -1015,7 +1039,18 @@ void wxMonoRenderer::DrawScrollbarThumb(wxDC& dc,
                                         const wxRect& rect,
                                         int WXUNUSED(flags))
 {
-    DrawSolidRect(dc, wxMONO_FG_COL, rect);
+    DrawSolidRect(dc, wxMONO_BG_COL, rect);
+
+    // manually draw stipple pattern (wxDFB doesn't implement the wxSTIPPLE
+    // brush style):
+    dc.SetPen(m_penFg);
+    for ( wxCoord y = rect.GetTop(); y <= rect.GetBottom(); y++ )
+    {
+        for ( wxCoord x = rect.GetLeft() + (y % 2); x <= rect.GetRight(); x+=2 )
+        {
+            dc.DrawPoint(x, y);
+        }
+    }
 }
 
 void wxMonoRenderer::DrawScrollbarShaft(wxDC& dc,
@@ -1026,10 +1061,33 @@ void wxMonoRenderer::DrawScrollbarShaft(wxDC& dc,
     DrawSolidRect(dc, wxMONO_BG_COL, rect);
 }
 
+// ----------------------------------------------------------------------------
+// status bar
+// ----------------------------------------------------------------------------
+
+#if wxUSE_STATUSBAR
+
+wxCoord wxMonoRenderer::GetStatusBarBorderBetweenFields() const
+{
+    return 1;
+}
+
+wxSize wxMonoRenderer::GetStatusBarFieldMargins() const
+{
+    return wxSize(1, 1);
+}
+
+#endif // wxUSE_STATUSBAR
+
 // ----------------------------------------------------------------------------
 // top level windows
 // ----------------------------------------------------------------------------
 
+int wxMonoRenderer::GetFrameBorderWidth(int WXUNUSED(flags)) const
+{
+    // all our borders are simple
+    return 1;
+}
 
 // ----------------------------------------------------------------------------
 // wxMonoArtProvider
@@ -1041,3 +1099,5 @@ wxBitmap wxMonoArtProvider::CreateBitmap(const wxArtID& WXUNUSED(id),
 {
     return wxNullBitmap;
 }
+
+#endif // wxUSE_THEME_MONO