]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/themes/gtk.cpp
Derive wxWebViewEvent from wxNotifyEvent.
[wxWidgets.git] / src / univ / themes / gtk.cpp
index 42fd5a4bf0960163ed12e27e583b8ee66607e226..2f383b594ccb08ff67ab506344c00901d33a0a79 100644 (file)
@@ -32,6 +32,7 @@
     #include "wx/intl.h"
     #include "wx/log.h"
     #include "wx/dcmemory.h"
     #include "wx/intl.h"
     #include "wx/log.h"
     #include "wx/dcmemory.h"
+    #include "wx/dcclient.h"
     #include "wx/window.h"
 
     #include "wx/menu.h"
     #include "wx/window.h"
 
     #include "wx/menu.h"
@@ -65,7 +66,7 @@
 #include "wx/univ/inphand.h"
 #include "wx/univ/colschem.h"
 
 #include "wx/univ/inphand.h"
 #include "wx/univ/colschem.h"
 
-class WXDLLEXPORT wxGTKMenuGeometryInfo;
+class wxGTKMenuGeometryInfo;
 
 // ----------------------------------------------------------------------------
 // constants
 
 // ----------------------------------------------------------------------------
 // constants
@@ -84,7 +85,7 @@ public:
     wxGTKRenderer(const wxColourScheme *scheme);
 
     // wxRenderer methods
     wxGTKRenderer(const wxColourScheme *scheme);
 
     // wxRenderer methods
-    virtual void DrawFocusRect(wxDC& dc, const wxRect& rect, int flags = 0);
+    virtual void DrawFocusRect(wxWindow* win, wxDC& dc, const wxRect& rect, int flags = 0);
     virtual void DrawTextBorder(wxDC& dc,
                                 wxBorder border,
                                 const wxRect& rect,
     virtual void DrawTextBorder(wxDC& dc,
                                 wxBorder border,
                                 const wxRect& rect,
@@ -327,7 +328,7 @@ protected:
                      wxCoord y1, wxCoord y2);
 
     // draw the radio button bitmap for the given state
                      wxCoord y1, wxCoord y2);
 
     // draw the radio button bitmap for the given state
-    void DrawRadioBitmap(wxDC& dc, const wxRect& rect, int flags);
+    void DrawRadioButtonBitmap(wxDC& dc, const wxRect& rect, int flags);
 
     // common part of DrawMenuItem() and DrawMenuBarItem()
     void DoDrawMenuItem(wxDC& dc,
 
     // common part of DrawMenuItem() and DrawMenuBarItem()
     void DoDrawMenuItem(wxDC& dc,
@@ -645,7 +646,7 @@ wxColour wxGTKColourScheme::GetBackground(wxWindow *win) const
     if ( !win->ShouldInheritColours() )
     {
         // doesn't depend on the state
     if ( !win->ShouldInheritColours() )
     {
         // doesn't depend on the state
-        if ( !col.Ok() )
+        if ( !col.IsOk() )
         {
             col = Get(WINDOW);
         }
         {
             col = Get(WINDOW);
         }
@@ -656,7 +657,7 @@ wxColour wxGTKColourScheme::GetBackground(wxWindow *win) const
 
         // the colour set by the user should be used for the normal state
         // and for the states for which we don't have any specific colours
 
         // the colour set by the user should be used for the normal state
         // and for the states for which we don't have any specific colours
-        if ( !col.Ok() || (flags != 0) )
+        if ( !col.IsOk() || (flags != 0) )
         {
 #if wxUSE_SCROLLBAR
             if ( wxDynamicCast(win, wxScrollBar) )
         {
 #if wxUSE_SCROLLBAR
             if ( wxDynamicCast(win, wxScrollBar) )
@@ -715,7 +716,7 @@ wxColour wxGTKColourScheme::Get(wxGTKColourScheme::StdColour col) const
 
         case MAX:
         default:
 
         case MAX:
         default:
-            wxFAIL_MSG(_T("invalid standard colour"));
+            wxFAIL_MSG(wxT("invalid standard colour"));
             return *wxBLACK;
     }
 }
             return *wxBLACK;
     }
 }
@@ -771,7 +772,7 @@ void wxGTKRenderer::DrawAntiShadedRectSide(wxDC& dc,
             break;
 
         default:
             break;
 
         default:
-            wxFAIL_MSG(_T("unknown rectangle side"));
+            wxFAIL_MSG(wxT("unknown rectangle side"));
     }
 }
 
     }
 }
 
@@ -813,7 +814,7 @@ void wxGTKRenderer::DrawSunkenBorder(wxDC& dc, wxRect *rect)
 }
 
 void
 }
 
 void
-wxGTKRenderer::DrawFocusRect(wxDC& dc, const wxRect& rect, int WXUNUSED(flags))
+wxGTKRenderer::DrawFocusRect(wxWindow* WXUNUSED(win), wxDC& dc, const wxRect& rect, int WXUNUSED(flags))
 {
     dc.SetBrush(*wxTRANSPARENT_BRUSH);
     wxRect rectFocus = rect;
 {
     dc.SetBrush(*wxTRANSPARENT_BRUSH);
     wxRect rectFocus = rect;
@@ -924,7 +925,7 @@ void wxGTKRenderer::DrawFrameWithLabel(wxDC& dc,
 }
 
 // ----------------------------------------------------------------------------
 }
 
 // ----------------------------------------------------------------------------
-// check/radion buttons
+// check/radio buttons
 // ----------------------------------------------------------------------------
 
 void wxGTKRenderer::DrawCheckItemBitmap(wxDC& dc,
 // ----------------------------------------------------------------------------
 
 void wxGTKRenderer::DrawCheckItemBitmap(wxDC& dc,
@@ -996,9 +997,9 @@ void wxGTKRenderer::DrawCheckBitmap(wxDC& dc, const wxRect& rectTotal)
     dc.DrawRectangle(rect);
 }
 
     dc.DrawRectangle(rect);
 }
 
-void wxGTKRenderer::DrawRadioBitmap(wxDC& dc,
-                                    const wxRect& rect,
-                                    int flags)
+void wxGTKRenderer::DrawRadioButtonBitmap(wxDC& dc,
+                                          const wxRect& rect,
+                                          int flags)
 {
     wxCoord x = rect.x,
             y = rect.y,
 {
     wxCoord x = rect.x,
             y = rect.y,
@@ -1068,7 +1069,7 @@ void wxGTKRenderer::DrawDownZag(wxDC& dc,
 
 wxBitmap wxGTKRenderer::GetCheckBitmap(int flags)
 {
 
 wxBitmap wxGTKRenderer::GetCheckBitmap(int flags)
 {
-    if ( !m_bitmapsCheckbox[0][0].Ok() )
+    if ( !m_bitmapsCheckbox[0][0].IsOk() )
     {
         // init the bitmaps once only
         wxRect rect;
     {
         // init the bitmaps once only
         wxRect rect;
@@ -1125,7 +1126,7 @@ wxBitmap wxGTKRenderer::GetRadioBitmap(int flags)
     GetIndicatorsFromFlags(flags, state, status);
 
     wxBitmap& bmp = m_bitmapsRadiobtn[state][status];
     GetIndicatorsFromFlags(flags, state, status);
 
     wxBitmap& bmp = m_bitmapsRadiobtn[state][status];
-    if ( !bmp.Ok() )
+    if ( !bmp.IsOk() )
     {
         const wxSize size = GetRadioBitmapSize();
 
     {
         const wxSize size = GetRadioBitmapSize();
 
@@ -1133,7 +1134,7 @@ wxBitmap wxGTKRenderer::GetRadioBitmap(int flags)
         bmp.Create(size.x, size.y);
         dc.SelectObject(bmp);
 
         bmp.Create(size.x, size.y);
         dc.SelectObject(bmp);
 
-        DrawRadioBitmap(dc, size, flags);
+        DrawRadioButtonBitmap(dc, size, flags);
     }
 
     return bmp;
     }
 
     return bmp;
@@ -1141,7 +1142,7 @@ wxBitmap wxGTKRenderer::GetRadioBitmap(int flags)
 
 wxBitmap wxGTKRenderer::GetLineWrapBitmap() const
 {
 
 wxBitmap wxGTKRenderer::GetLineWrapBitmap() const
 {
-    if ( !m_bmpLineWrap.Ok() )
+    if ( !m_bmpLineWrap.IsOk() )
     {
         // the line wrap bitmap as used by GTK+
         #define line_wrap_width 6
     {
         // the line wrap bitmap as used by GTK+
         #define line_wrap_width 6
@@ -1152,9 +1153,9 @@ wxBitmap wxGTKRenderer::GetLineWrapBitmap() const
         };
 
         wxBitmap bmpLineWrap(line_wrap_bits, line_wrap_width, line_wrap_height);
         };
 
         wxBitmap bmpLineWrap(line_wrap_bits, line_wrap_width, line_wrap_height);
-        if ( !bmpLineWrap.Ok() )
+        if ( !bmpLineWrap.IsOk() )
         {
         {
-            wxFAIL_MSG( _T("Failed to create line wrap XBM") );
+            wxFAIL_MSG( wxT("Failed to create line wrap XBM") );
         }
         else
         {
         }
         else
         {
@@ -1175,7 +1176,7 @@ void wxGTKRenderer::DrawToolBarButton(wxDC& dc,
                                       int tbarStyle)
 {
     // we don't draw the separators at all
                                       int tbarStyle)
 {
     // we don't draw the separators at all
-    if ( !label.empty() || bitmap.Ok() )
+    if ( !label.empty() || bitmap.IsOk() )
     {
         wxRect rect = rectOrig;
         rect.Deflate(BORDER_THICKNESS);
     {
         wxRect rect = rectOrig;
         rect.Deflate(BORDER_THICKNESS);
@@ -1259,7 +1260,7 @@ void wxGTKRenderer::DrawLineWrapMark(wxDC& dc, const wxRect& rect)
     dc.DrawBitmap(bmpLineWrap,
                   rect.x, rect.y + (rect.height - bmpLineWrap.GetHeight())/2);
 
     dc.DrawBitmap(bmpLineWrap,
                   rect.x, rect.y + (rect.height - bmpLineWrap.GetHeight())/2);
 
-    if ( colFgOld.Ok() )
+    if ( colFgOld.IsOk() )
     {
         // restore old colour
         dc.SetTextForeground(colFgOld);
     {
         // restore old colour
         dc.SetTextForeground(colFgOld);
@@ -1302,7 +1303,7 @@ void wxGTKRenderer::DrawTab(wxDC& dc,
         switch ( dir )
         {
             default:
         switch ( dir )
         {
             default:
-                wxFAIL_MSG(_T("invaild notebook tab orientation"));
+                wxFAIL_MSG(wxT("invaild notebook tab orientation"));
                 // fall through
 
             case wxTOP:
                 // fall through
 
             case wxTOP:
@@ -1572,7 +1573,7 @@ void wxGTKRenderer::DrawSliderThumb(wxDC& dc,
 // ----------------------------------------------------------------------------
 
 // wxGTKMenuGeometryInfo: the wxMenuGeometryInfo used by wxGTKRenderer
 // ----------------------------------------------------------------------------
 
 // wxGTKMenuGeometryInfo: the wxMenuGeometryInfo used by wxGTKRenderer
-class WXDLLEXPORT wxGTKMenuGeometryInfo : public wxMenuGeometryInfo
+class wxGTKMenuGeometryInfo : public wxMenuGeometryInfo
 {
 public:
     virtual wxSize GetSize() const { return m_size; }
 {
 public:
     virtual wxSize GetSize() const { return m_size; }
@@ -1676,12 +1677,12 @@ void wxGTKRenderer::DoDrawMenuItem(wxDC& dc,
     if ( geometryInfo )
     {
         wxBitmap bmp = bitmap;
     if ( geometryInfo )
     {
         wxBitmap bmp = bitmap;
-        if ( !bmp.Ok() && (flags & wxCONTROL_CHECKABLE) )
+        if ( !bmp.IsOk() && (flags & wxCONTROL_CHECKABLE) )
         {
             bmp = GetCheckBitmap(flags);
         }
 
         {
             bmp = GetCheckBitmap(flags);
         }
 
-        if ( bmp.Ok() )
+        if ( bmp.IsOk() )
         {
             rect.SetRight(geometryInfo->GetLabelOffset());
             wxControlRenderer::DrawBitmap(dc, bmp, rect);
         {
             rect.SetRight(geometryInfo->GetLabelOffset());
             wxControlRenderer::DrawBitmap(dc, bmp, rect);
@@ -1702,7 +1703,7 @@ void wxGTKRenderer::DoDrawMenuItem(wxDC& dc,
     if ( !accel.empty() )
     {
         // menubar items shouldn't have them
     if ( !accel.empty() )
     {
         // menubar items shouldn't have them
-        wxCHECK_RET( geometryInfo, _T("accel strings only valid for menus") );
+        wxCHECK_RET( geometryInfo, wxT("accel strings only valid for menus") );
 
         rect.x = geometryInfo->GetAccelOffset();
         rect.SetRight(geometryInfo->GetSize().x);
 
         rect.x = geometryInfo->GetAccelOffset();
         rect.SetRight(geometryInfo->GetSize().x);
@@ -1714,7 +1715,7 @@ void wxGTKRenderer::DoDrawMenuItem(wxDC& dc,
     // draw the submenu indicator
     if ( flags & wxCONTROL_ISSUBMENU )
     {
     // draw the submenu indicator
     if ( flags & wxCONTROL_ISSUBMENU )
     {
-        wxCHECK_RET( geometryInfo, _T("wxCONTROL_ISSUBMENU only valid for menus") );
+        wxCHECK_RET( geometryInfo, wxT("wxCONTROL_ISSUBMENU only valid for menus") );
 
         rect.x = geometryInfo->GetSize().x - MENU_RIGHT_MARGIN;
         rect.width = MENU_RIGHT_MARGIN;
 
         rect.x = geometryInfo->GetSize().x - MENU_RIGHT_MARGIN;
         rect.width = MENU_RIGHT_MARGIN;
@@ -1781,7 +1782,7 @@ wxMenuGeometryInfo *wxGTKRenderer::GetMenuGeometry(wxWindow *win,
             h = heightText;
 
             wxCoord widthLabel;
             h = heightText;
 
             wxCoord widthLabel;
-            dc.GetTextExtent(item->GetLabel(), &widthLabel, NULL);
+            dc.GetTextExtent(item->GetItemLabelText(), &widthLabel, NULL);
             if ( widthLabel > widthLabelMax )
             {
                 widthLabelMax = widthLabel;
             if ( widthLabel > widthLabelMax )
             {
                 widthLabelMax = widthLabel;
@@ -1795,7 +1796,7 @@ wxMenuGeometryInfo *wxGTKRenderer::GetMenuGeometry(wxWindow *win,
             }
 
             const wxBitmap& bmp = item->GetBitmap();
             }
 
             const wxBitmap& bmp = item->GetBitmap();
-            if ( bmp.Ok() )
+            if ( bmp.IsOk() )
             {
                 wxCoord widthBmp = bmp.GetWidth();
                 if ( widthBmp > widthBmpMax )
             {
                 wxCoord widthBmp = bmp.GetWidth();
                 if ( widthBmp > widthBmpMax )
@@ -1877,7 +1878,7 @@ void wxGTKRenderer::GetComboBitmaps(wxBitmap *bmpNormal,
                                     wxBitmap *bmpPressed,
                                     wxBitmap *bmpDisabled)
 {
                                     wxBitmap *bmpPressed,
                                     wxBitmap *bmpDisabled)
 {
-    if ( !m_bitmapsCombo[ComboState_Normal].Ok() )
+    if ( !m_bitmapsCombo[ComboState_Normal].IsOk() )
     {
         InitComboBitmaps();
     }
     {
         InitComboBitmaps();
     }
@@ -1949,7 +1950,7 @@ void wxGTKRenderer::DrawArrowBorder(wxDC& dc,
             break;
 
         default:
             break;
 
         default:
-            wxFAIL_MSG(_T("unknown arrow direction"));
+            wxFAIL_MSG(wxT("unknown arrow direction"));
             return;
     }
 
             return;
     }
 
@@ -2084,7 +2085,7 @@ void wxGTKRenderer::DrawArrow(wxDC& dc,
             break;
 
         default:
             break;
 
         default:
-            wxFAIL_MSG(_T("unknown arrow direction"));
+            wxFAIL_MSG(wxT("unknown arrow direction"));
     }
 
     dc.DrawPolygon(WXSIZEOF(ptArrow), ptArrow);
     }
 
     dc.DrawPolygon(WXSIZEOF(ptArrow), ptArrow);
@@ -2096,7 +2097,7 @@ void wxGTKRenderer::DrawArrow(wxDC& dc,
         case wxUP:
             dc.DrawLine(ptArrow[Point_Second], ptArrow[Point_First]);
             dc.DrawPoint(ptArrow[Point_First]);
         case wxUP:
             dc.DrawLine(ptArrow[Point_Second], ptArrow[Point_First]);
             dc.DrawPoint(ptArrow[Point_First]);
-            if ( penShadow[3].Ok() )
+            if ( penShadow[3].IsOk() )
             {
                 dc.SetPen(penShadow[3]);
                 dc.DrawLine(ptArrow[Point_First].x + 1, ptArrow[Point_First].y,
             {
                 dc.SetPen(penShadow[3]);
                 dc.DrawLine(ptArrow[Point_First].x + 1, ptArrow[Point_First].y,
@@ -2108,7 +2109,7 @@ void wxGTKRenderer::DrawArrow(wxDC& dc,
             dc.DrawPoint(ptArrow[Point_Third]);
             dc.DrawLine(ptArrow[Point_Third].x - 2, ptArrow[Point_Third].y,
                         ptArrow[Point_First].x + 1, ptArrow[Point_First].y);
             dc.DrawPoint(ptArrow[Point_Third]);
             dc.DrawLine(ptArrow[Point_Third].x - 2, ptArrow[Point_Third].y,
                         ptArrow[Point_First].x + 1, ptArrow[Point_First].y);
-            if ( penShadow[2].Ok() )
+            if ( penShadow[2].IsOk() )
             {
                 dc.SetPen(penShadow[2]);
                 dc.DrawLine(ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y,
             {
                 dc.SetPen(penShadow[2]);
                 dc.DrawLine(ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y,
@@ -2122,7 +2123,7 @@ void wxGTKRenderer::DrawArrow(wxDC& dc,
             dc.DrawLine(ptArrow[Point_First], ptArrow[Point_Second]);
             dc.DrawLine(ptArrow[Point_First].x + 2, ptArrow[Point_First].y,
                         ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y);
             dc.DrawLine(ptArrow[Point_First], ptArrow[Point_Second]);
             dc.DrawLine(ptArrow[Point_First].x + 2, ptArrow[Point_First].y,
                         ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y);
-            if ( penShadow[2].Ok() )
+            if ( penShadow[2].IsOk() )
             {
                 dc.SetPen(penShadow[2]);
                 dc.DrawLine(ptArrow[Point_Second].x, ptArrow[Point_Second].y - 1,
             {
                 dc.SetPen(penShadow[2]);
                 dc.DrawLine(ptArrow[Point_Second].x, ptArrow[Point_Second].y - 1,
@@ -2136,7 +2137,7 @@ void wxGTKRenderer::DrawArrow(wxDC& dc,
         case wxLEFT:
             dc.DrawLine(ptArrow[Point_Second], ptArrow[Point_First]);
             dc.DrawPoint(ptArrow[Point_First]);
         case wxLEFT:
             dc.DrawLine(ptArrow[Point_Second], ptArrow[Point_First]);
             dc.DrawPoint(ptArrow[Point_First]);
-            if ( penShadow[2].Ok() )
+            if ( penShadow[2].IsOk() )
             {
                 dc.SetPen(penShadow[2]);
                 dc.DrawLine(ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y,
             {
                 dc.SetPen(penShadow[2]);
                 dc.DrawLine(ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y,
@@ -2161,7 +2162,7 @@ void wxGTKRenderer::DrawArrow(wxDC& dc,
             break;
 
         default:
             break;
 
         default:
-            wxFAIL_MSG(_T("unknown arrow direction"));
+            wxFAIL_MSG(wxT("unknown arrow direction"));
             return;
     }
 }
             return;
     }
 }