]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/univ/stdrend.h
Support using GetTextExtent() with empty string to get descent in wxOSX.
[wxWidgets.git] / include / wx / univ / stdrend.h
index 9acd6e31bf33f141834244372f8b2a252d79177d..62aa0753b109b23abb37b08ed77e87fabfdad647 100644 (file)
@@ -14,7 +14,7 @@
 #include "wx/univ/renderer.h"
 #include "wx/pen.h"
 
-class WXDLLEXPORT wxColourScheme;
+class WXDLLIMPEXP_FWD_CORE wxColourScheme;
 
 // ----------------------------------------------------------------------------
 // wxStdRenderer: implements as much of wxRenderer API as possible generically
@@ -38,7 +38,8 @@ public:
                                    int flags);
 
 
-    virtual void DrawFocusRect(wxDC& dc, const wxRect& rect);
+    virtual void DrawFocusRect(wxWindow* win, wxDC& dc, const wxRect& rect, int flags = 0);
+
     virtual void DrawLabel(wxDC& dc,
                            const wxString& label,
                            const wxRect& rect,
@@ -132,21 +133,63 @@ public:
 
     virtual bool AreScrollbarsInsideBorder() const;
 
-#if wxUSE_SCROLLBAR
-    virtual wxRect GetScrollbarRect(const wxScrollBar *scrollbar,
-                                    wxScrollBar::Element elem,
-                                    int thumbPos = -1) const;
+    virtual void AdjustSize(wxSize *size, const wxWindow *window);
+
+    virtual wxCoord GetListboxItemHeight(wxCoord fontHeight);
+
+#if wxUSE_STATUSBAR
+    virtual void DrawStatusField(wxDC& dc,
+                                 const wxRect& rect,
+                                 const wxString& label,
+                                 int flags = 0, int style = 0);
+
+    virtual wxSize GetStatusBarBorders() const;
+
+    virtual wxCoord GetStatusBarBorderBetweenFields() const;
 
-    virtual wxCoord GetScrollbarSize(const wxScrollBar *scrollbar);
+    virtual wxSize GetStatusBarFieldMargins() const;
+#endif // wxUSE_STATUSBAR
 
-    virtual wxHitTest HitTestScrollbar(const wxScrollBar *scrollbar,
-                                       const wxPoint& pt) const;
+    virtual wxCoord GetCheckItemMargin() const { return 0; }
 
-    virtual wxCoord ScrollbarToPixel(const wxScrollBar *scrollbar,
-                                     int thumbPos = -1);
-    virtual int PixelToScrollbar(const wxScrollBar *scrollbar, wxCoord coord);
-#endif // wxUSE_SCROLLBAR
 
+    virtual void DrawFrameTitleBar(wxDC& dc,
+                                   const wxRect& rect,
+                                   const wxString& title,
+                                   const wxIcon& icon,
+                                   int flags,
+                                   int specialButton = 0,
+                                   int specialButtonFlag = 0);
+    virtual void DrawFrameBorder(wxDC& dc,
+                                 const wxRect& rect,
+                                 int flags);
+    virtual void DrawFrameBackground(wxDC& dc,
+                                     const wxRect& rect,
+                                     int flags);
+    virtual void DrawFrameTitle(wxDC& dc,
+                                const wxRect& rect,
+                                const wxString& title,
+                                int flags);
+    virtual void DrawFrameIcon(wxDC& dc,
+                               const wxRect& rect,
+                               const wxIcon& icon,
+                               int flags);
+    virtual void DrawFrameButton(wxDC& dc,
+                                 wxCoord x, wxCoord y,
+                                 int button,
+                                 int flags = 0);
+
+    virtual wxRect GetFrameClientArea(const wxRect& rect, int flags) const;
+
+    virtual wxSize GetFrameTotalSize(const wxSize& clientSize, int flags) const;
+
+    virtual wxSize GetFrameMinSize(int flags) const;
+
+    virtual wxSize GetFrameIconSize() const;
+
+    virtual int HitTestFrame(const wxRect& rect,
+                             const wxPoint& pt,
+                             int flags = 0) const;
 protected:
     // various constants
     enum ArrowDirection
@@ -168,6 +211,16 @@ protected:
         Arrow_StateMax
     };
 
+    enum FrameButtonType
+    {
+        FrameButton_Close,
+        FrameButton_Minimize,
+        FrameButton_Maximize,
+        FrameButton_Restore,
+        FrameButton_Help,
+        FrameButton_Max
+    };
+
     enum IndicatorType
     {
         IndicatorType_Check,
@@ -226,7 +279,9 @@ protected:
     virtual void DrawRaisedBorder(wxDC& dc, wxRect *rect);
     virtual void DrawSunkenBorder(wxDC& dc, wxRect *rect);
     virtual void DrawAntiSunkenBorder(wxDC& dc, wxRect *rect);
-    virtual void DrawFrameBorder(wxDC& dc, wxRect *rect);
+    virtual void DrawBoxBorder(wxDC& dc, wxRect *rect);
+    virtual void DrawStaticBorder(wxDC& dc, wxRect *rect);
+    virtual void DrawExtraBorder(wxDC& dc, wxRect *rect);
 
 
     // draw the frame with non-empty label inside the given rectText
@@ -264,32 +319,35 @@ protected:
     virtual wxBitmap GetRadioBitmap(int flags) = 0;
     virtual wxBitmap GetCheckBitmap(int flags) = 0;
 
+    // return the frame icon bitmap
+    virtual wxBitmap GetFrameButtonBitmap(FrameButtonType type) = 0;
+
+    // get the width of either normal or resizable frame border depending on
+    // whether flags contains wxTOPLEVEL_RESIZEABLE bit
+    //
+    // notice that these methods only make sense with standard border drawing
+    // code which uses the borders of the same width on all sides, this is why
+    // they are only present here and not in wxRenderer itself
+    virtual int GetFrameBorderWidth(int flags) const;
+
 #if wxUSE_TEXTCTRL
     // return the width of the border around the text area in the text control
     virtual int GetTextBorderWidth(const wxTextCtrl *text) const;
 #endif // wxUSE_TEXTCTRL
 
-    // return the starting and ending positions, in pixels, of the thumb of a
-    // scrollbar with the given logical position, thumb size and range and the
-    // given physical length
-    static void GetScrollBarThumbSize(wxCoord length,
-                                      int thumbPos,
-                                      int thumbSize,
-                                      int range,
-                                      wxCoord *thumbStart,
-                                      wxCoord *thumbEnd);
-
     // GDI objects we often use
     wxPen m_penBlack,
           m_penDarkGrey,
           m_penLightGrey,
           m_penHighlight;
 
+    wxFont m_titlebarFont;
+
     // the colours we use, they never change currently so we don't have to ever
     // update m_penXXX objects above
     const wxColourScheme * const m_scheme;
 
-    DECLARE_NO_COPY_CLASS(wxStdRenderer)
+    wxDECLARE_NO_COPY_CLASS(wxStdRenderer);
 };
 
 #endif // _WX_UNIV_STDREND_H_