#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/univ/inphand.h"
#include "wx/univ/colschem.h"
-class WXDLLEXPORT wxGTKMenuGeometryInfo;
+class wxGTKMenuGeometryInfo;
// ----------------------------------------------------------------------------
// constants
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 AdjustSize(wxSize *size, const wxWindow *window);
// geometry and hit testing
+#if wxUSE_SCROLLBAR
virtual wxSize GetScrollbarArrowSize() const
{ return m_sizeScrollbarArrow; }
-#if wxUSE_SCROLLBAR
- virtual wxRect GetScrollbarRect(const wxScrollBar *scrollbar,
- wxScrollBar::Element elem,
- int thumbPos = -1) const;
#endif // wxUSE_SCROLLBAR
virtual wxSize GetCheckBitmapSize() const
// draw inner GTK shadow
void DrawInnerShadedRect(wxDC& dc, wxRect *rect);
-#if wxUSE_SCROLLBAR
- // returns the size of the arrow for the scrollbar (depends on
- // orientation)
- wxSize GetScrollbarArrowSize(const wxScrollBar *scrollbar) const
- {
- wxSize size;
- if ( scrollbar->IsVertical() )
- {
- size = m_sizeScrollbarArrow;
- }
- else
- {
- size.x = m_sizeScrollbarArrow.y;
- size.y = m_sizeScrollbarArrow.x;
- }
-
- return size;
- }
-#endif // wxUSE_SCROLLBAR
-
// get the line wrap indicator bitmap
wxBitmap GetLineWrapBitmap() const;
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,
{
switch ( col )
{
+ case FRAME:
case WINDOW: return *wxWHITE;
case SHADOW_DARK: return *wxBLACK;
case MAX:
default:
- wxFAIL_MSG(_T("invalid standard colour"));
+ wxFAIL_MSG(wxT("invalid standard colour"));
return *wxBLACK;
}
}
break;
default:
- wxFAIL_MSG(_T("unknown rectangle side"));
+ wxFAIL_MSG(wxT("unknown rectangle side"));
}
}
}
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;
}
// ----------------------------------------------------------------------------
-// check/radion buttons
+// check/radio buttons
// ----------------------------------------------------------------------------
void wxGTKRenderer::DrawCheckItemBitmap(wxDC& dc,
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,
bmp.Create(size.x, size.y);
dc.SelectObject(bmp);
- DrawRadioBitmap(dc, size, flags);
+ DrawRadioButtonBitmap(dc, size, flags);
}
return bmp;
wxBitmap bmpLineWrap(line_wrap_bits, line_wrap_width, line_wrap_height);
if ( !bmpLineWrap.Ok() )
{
- wxFAIL_MSG( _T("Failed to create line wrap XBM") );
+ wxFAIL_MSG( wxT("Failed to create line wrap XBM") );
}
else
{
switch ( dir )
{
default:
- wxFAIL_MSG(_T("invaild notebook tab orientation"));
+ wxFAIL_MSG(wxT("invaild notebook tab orientation"));
// fall through
case wxTOP:
// ----------------------------------------------------------------------------
// wxGTKMenuGeometryInfo: the wxMenuGeometryInfo used by wxGTKRenderer
-class WXDLLEXPORT wxGTKMenuGeometryInfo : public wxMenuGeometryInfo
+class wxGTKMenuGeometryInfo : public wxMenuGeometryInfo
{
public:
virtual wxSize GetSize() const { return m_size; }
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);
// 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;
h = heightText;
wxCoord widthLabel;
- dc.GetTextExtent(item->GetLabel(), &widthLabel, NULL);
+ dc.GetTextExtent(item->GetItemLabelText(), &widthLabel, NULL);
if ( widthLabel > widthLabelMax )
{
widthLabelMax = widthLabel;
break;
default:
- wxFAIL_MSG(_T("unknown arrow direction"));
+ wxFAIL_MSG(wxT("unknown arrow direction"));
return;
}
break;
default:
- wxFAIL_MSG(_T("unknown arrow direction"));
+ wxFAIL_MSG(wxT("unknown arrow direction"));
}
dc.DrawPolygon(WXSIZEOF(ptArrow), ptArrow);
break;
default:
- wxFAIL_MSG(_T("unknown arrow direction"));
+ wxFAIL_MSG(wxT("unknown arrow direction"));
return;
}
}
DrawSolidRect(dc, wxSCHEME_COLOUR(m_scheme, SCROLLBAR), rectBar);
}
-#if wxUSE_SCROLLBAR
-wxRect wxGTKRenderer::GetScrollbarRect(const wxScrollBar *scrollbar,
- wxScrollBar::Element elem,
- int thumbPos) const
-{
- // as GTK scrollbars can't be disabled, it makes no sense to remove the
- // thumb for a scrollbar with range 0 - instead, make it fill the entire
- // scrollbar shaft
- if ( (elem == wxScrollBar::Element_Thumb) && !scrollbar->GetRange() )
- {
- elem = wxScrollBar::Element_Bar_2;
- }
-
- return wxStdRenderer::GetScrollbarRect(scrollbar, elem, thumbPos);
-}
-
-#endif // wxUSE_SCROLLBAR
-
// ----------------------------------------------------------------------------
// size adjustments
// ----------------------------------------------------------------------------