refactored common parts of DrawItem() in the base class; implemented GetTextTotal/ClientArea() there as well
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41318 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -83,6 +83,11 @@ public:
|
|||||||
const wxString& label,
|
const wxString& label,
|
||||||
const wxRect& rect,
|
const wxRect& rect,
|
||||||
int flags = 0);
|
int flags = 0);
|
||||||
|
virtual void DrawCheckItem(wxDC& dc,
|
||||||
|
const wxString& label,
|
||||||
|
const wxBitmap& bitmap,
|
||||||
|
const wxRect& rect,
|
||||||
|
int flags = 0);
|
||||||
|
|
||||||
virtual void DrawCheckButton(wxDC& dc,
|
virtual void DrawCheckButton(wxDC& dc,
|
||||||
const wxString& label,
|
const wxString& label,
|
||||||
@@ -108,6 +113,12 @@ public:
|
|||||||
int flags = 0);
|
int flags = 0);
|
||||||
|
|
||||||
virtual void DrawLineWrapMark(wxDC& dc, const wxRect& rect);
|
virtual void DrawLineWrapMark(wxDC& dc, const wxRect& rect);
|
||||||
|
|
||||||
|
virtual wxRect GetTextTotalArea(const wxTextCtrl *text,
|
||||||
|
const wxRect& rect) const;
|
||||||
|
virtual wxRect GetTextClientArea(const wxTextCtrl *text,
|
||||||
|
const wxRect& rect,
|
||||||
|
wxCoord *extraSpaceBeyond) const;
|
||||||
#endif // wxUSE_TEXTCTRL
|
#endif // wxUSE_TEXTCTRL
|
||||||
|
|
||||||
virtual wxRect GetBorderDimensions(wxBorder border) const;
|
virtual wxRect GetBorderDimensions(wxBorder border) const;
|
||||||
@@ -135,7 +146,8 @@ protected:
|
|||||||
{
|
{
|
||||||
IndicatorType_Check,
|
IndicatorType_Check,
|
||||||
IndicatorType_Radio,
|
IndicatorType_Radio,
|
||||||
IndicatorType_Menu,
|
IndicatorType_MaxCtrl,
|
||||||
|
IndicatorType_Menu = IndicatorType_MaxCtrl,
|
||||||
IndicatorType_Max
|
IndicatorType_Max
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -184,6 +196,7 @@ protected:
|
|||||||
virtual void DrawRaisedBorder(wxDC& dc, wxRect *rect);
|
virtual void DrawRaisedBorder(wxDC& dc, wxRect *rect);
|
||||||
virtual void DrawSunkenBorder(wxDC& dc, wxRect *rect);
|
virtual void DrawSunkenBorder(wxDC& dc, wxRect *rect);
|
||||||
virtual void DrawAntiSunkenBorder(wxDC& dc, wxRect *rect);
|
virtual void DrawAntiSunkenBorder(wxDC& dc, wxRect *rect);
|
||||||
|
virtual void DrawFrameBorder(wxDC& dc, wxRect *rect);
|
||||||
|
|
||||||
|
|
||||||
// draw the frame with non-empty label inside the given rectText
|
// draw the frame with non-empty label inside the given rectText
|
||||||
@@ -201,6 +214,13 @@ protected:
|
|||||||
const wxRect& rectLabel);
|
const wxRect& rectLabel);
|
||||||
|
|
||||||
|
|
||||||
|
// draw the bitmap for a check item (which is by default the same as check
|
||||||
|
// box one but may be different)
|
||||||
|
virtual void DrawCheckItemBitmap(wxDC& dc,
|
||||||
|
const wxBitmap& bitmap,
|
||||||
|
const wxRect& rect,
|
||||||
|
int flags);
|
||||||
|
|
||||||
// common routine for drawing check and radio buttons
|
// common routine for drawing check and radio buttons
|
||||||
void DrawCheckOrRadioButton(wxDC& dc,
|
void DrawCheckOrRadioButton(wxDC& dc,
|
||||||
const wxString& label,
|
const wxString& label,
|
||||||
@@ -214,6 +234,10 @@ protected:
|
|||||||
virtual wxBitmap GetRadioBitmap(int flags) = 0;
|
virtual wxBitmap GetRadioBitmap(int flags) = 0;
|
||||||
virtual wxBitmap GetCheckBitmap(int flags) = 0;
|
virtual wxBitmap GetCheckBitmap(int flags) = 0;
|
||||||
|
|
||||||
|
#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
|
// 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
|
// scrollbar with the given logical position, thumb size and range and the
|
||||||
|
@@ -304,6 +304,12 @@ void wxStdRenderer::DrawAntiSunkenBorder(wxDC& dc, wxRect *rect)
|
|||||||
DrawShadedRect(dc, rect, m_penHighlight, m_penDarkGrey);
|
DrawShadedRect(dc, rect, m_penHighlight, m_penDarkGrey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxStdRenderer::DrawFrameBorder(wxDC& dc, wxRect *rect)
|
||||||
|
{
|
||||||
|
DrawShadedRect(dc, rect, m_penDarkGrey, m_penHighlight);
|
||||||
|
DrawShadedRect(dc, rect, m_penHighlight, m_penDarkGrey);
|
||||||
|
}
|
||||||
|
|
||||||
void wxStdRenderer::DrawBorder(wxDC& dc,
|
void wxStdRenderer::DrawBorder(wxDC& dc,
|
||||||
wxBorder border,
|
wxBorder border,
|
||||||
const wxRect& rectTotal,
|
const wxRect& rectTotal,
|
||||||
@@ -493,9 +499,7 @@ void wxStdRenderer::DrawFrame(wxDC& dc,
|
|||||||
}
|
}
|
||||||
else // no label
|
else // no label
|
||||||
{
|
{
|
||||||
// just draw the complete frame
|
DrawFrameBorder(dc, &rectFrame);
|
||||||
DrawShadedRect(dc, &rectFrame, m_penDarkGrey, m_penHighlight);
|
|
||||||
DrawShadedRect(dc, &rectFrame, m_penHighlight, m_penDarkGrey);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -527,6 +531,31 @@ void wxStdRenderer::DrawItem(wxDC& dc,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxStdRenderer::DrawCheckItemBitmap(wxDC& dc,
|
||||||
|
const wxBitmap& bitmap,
|
||||||
|
const wxRect& rect,
|
||||||
|
int flags)
|
||||||
|
{
|
||||||
|
DrawCheckButton(dc, wxEmptyString, bitmap, rect, flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxStdRenderer::DrawCheckItem(wxDC& dc,
|
||||||
|
const wxString& label,
|
||||||
|
const wxBitmap& bitmap,
|
||||||
|
const wxRect& rect,
|
||||||
|
int flags)
|
||||||
|
{
|
||||||
|
wxRect rectBitmap = rect;
|
||||||
|
rectBitmap.width = GetCheckBitmapSize().x;
|
||||||
|
DrawCheckItemBitmap(dc, bitmap, rectBitmap, flags);
|
||||||
|
|
||||||
|
wxRect rectLabel = rect;
|
||||||
|
wxCoord shift = rectBitmap.width + 2*GetCheckItemMargin();
|
||||||
|
rectLabel.x += shift;
|
||||||
|
rectLabel.width -= shift;
|
||||||
|
DrawItem(dc, label, rectLabel, flags);
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// check and radio bitmaps
|
// check and radio bitmaps
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -681,6 +710,32 @@ void wxStdRenderer::DrawLineWrapMark(wxDC& WXUNUSED(dc),
|
|||||||
// nothing by default
|
// nothing by default
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int wxStdRenderer::GetTextBorderWidth(const wxTextCtrl * WXUNUSED(text)) const
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxRect
|
||||||
|
wxStdRenderer::GetTextTotalArea(const wxTextCtrl *text, const wxRect& rect) const
|
||||||
|
{
|
||||||
|
wxRect rectTotal = rect;
|
||||||
|
rectTotal.Inflate(GetTextBorderWidth(text));
|
||||||
|
return rectTotal;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxRect wxStdRenderer::GetTextClientArea(const wxTextCtrl *text,
|
||||||
|
const wxRect& rect,
|
||||||
|
wxCoord *extraSpaceBeyond) const
|
||||||
|
{
|
||||||
|
wxRect rectText = rect;
|
||||||
|
rectText.Deflate(GetTextBorderWidth(text));
|
||||||
|
|
||||||
|
if ( extraSpaceBeyond )
|
||||||
|
*extraSpaceBeyond = 0;
|
||||||
|
|
||||||
|
return rectText;
|
||||||
|
}
|
||||||
|
|
||||||
#endif // wxUSE_TEXTCTRL
|
#endif // wxUSE_TEXTCTRL
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -117,11 +117,6 @@ public:
|
|||||||
int flags = 0);
|
int flags = 0);
|
||||||
virtual void DrawScrollCorner(wxDC& dc,
|
virtual void DrawScrollCorner(wxDC& dc,
|
||||||
const wxRect& rect);
|
const wxRect& rect);
|
||||||
virtual void DrawCheckItem(wxDC& dc,
|
|
||||||
const wxString& label,
|
|
||||||
const wxBitmap& bitmap,
|
|
||||||
const wxRect& rect,
|
|
||||||
int flags = 0);
|
|
||||||
|
|
||||||
#if wxUSE_TOOLBAR
|
#if wxUSE_TOOLBAR
|
||||||
virtual void DrawToolBarButton(wxDC& dc,
|
virtual void DrawToolBarButton(wxDC& dc,
|
||||||
@@ -264,8 +259,6 @@ public:
|
|||||||
{ return wxSize(6, 6); }
|
{ return wxSize(6, 6); }
|
||||||
|
|
||||||
#if wxUSE_TEXTCTRL
|
#if wxUSE_TEXTCTRL
|
||||||
virtual wxRect GetTextTotalArea(const wxTextCtrl *text,
|
|
||||||
const wxRect& rect) const;
|
|
||||||
virtual wxRect GetTextClientArea(const wxTextCtrl *text,
|
virtual wxRect GetTextClientArea(const wxTextCtrl *text,
|
||||||
const wxRect& rect,
|
const wxRect& rect,
|
||||||
wxCoord *extraSpaceBeyond) const;
|
wxCoord *extraSpaceBeyond) const;
|
||||||
@@ -306,6 +299,7 @@ public:
|
|||||||
void DrawUndeterminedBitmap(wxDC& dc, const wxRect& rect, bool isPressed);
|
void DrawUndeterminedBitmap(wxDC& dc, const wxRect& rect, bool isPressed);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
// overridden wxStdRenderer methods
|
||||||
virtual void DrawSunkenBorder(wxDC& dc, wxRect *rect);
|
virtual void DrawSunkenBorder(wxDC& dc, wxRect *rect);
|
||||||
|
|
||||||
virtual void DrawFrameWithLabel(wxDC& dc,
|
virtual void DrawFrameWithLabel(wxDC& dc,
|
||||||
@@ -316,6 +310,11 @@ protected:
|
|||||||
int alignment,
|
int alignment,
|
||||||
int indexAccel);
|
int indexAccel);
|
||||||
|
|
||||||
|
virtual void DrawCheckItemBitmap(wxDC& dc,
|
||||||
|
const wxBitmap& bitmap,
|
||||||
|
const wxRect& rect,
|
||||||
|
int flags);
|
||||||
|
|
||||||
// get the colour to use for background
|
// get the colour to use for background
|
||||||
wxColour GetBackgroundColour(int flags) const
|
wxColour GetBackgroundColour(int flags) const
|
||||||
{
|
{
|
||||||
@@ -396,15 +395,6 @@ protected:
|
|||||||
// draw the radio button bitmap for the given state
|
// draw the radio button bitmap for the given state
|
||||||
void DrawRadioBitmap(wxDC& dc, const wxRect& rect, int flags);
|
void DrawRadioBitmap(wxDC& dc, const wxRect& rect, int flags);
|
||||||
|
|
||||||
// draw check/radio - the bitmap must be a valid one by now
|
|
||||||
void DoDrawCheckOrRadioBitmap(wxDC& dc,
|
|
||||||
const wxString& label,
|
|
||||||
const wxBitmap& bitmap,
|
|
||||||
const wxRect& rectTotal,
|
|
||||||
int flags,
|
|
||||||
wxAlignment align,
|
|
||||||
int indexAccel);
|
|
||||||
|
|
||||||
// common part of DrawMenuItem() and DrawMenuBarItem()
|
// common part of DrawMenuItem() and DrawMenuBarItem()
|
||||||
void DoDrawMenuItem(wxDC& dc,
|
void DoDrawMenuItem(wxDC& dc,
|
||||||
const wxRect& rect,
|
const wxRect& rect,
|
||||||
@@ -994,34 +984,19 @@ void wxGTKRenderer::DrawFrameWithLabel(wxDC& dc,
|
|||||||
dc.DrawPoint(rectText.x + rectLabel.width - 3, rectFrame.y);
|
dc.DrawPoint(rectText.x + rectLabel.width - 3, rectFrame.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
// label
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
void wxGTKRenderer::DrawCheckItem(wxDC& dc,
|
|
||||||
const wxString& label,
|
|
||||||
const wxBitmap& bitmap,
|
|
||||||
const wxRect& rect,
|
|
||||||
int flags)
|
|
||||||
{
|
|
||||||
wxRect rectBitmap = rect;
|
|
||||||
rectBitmap.x -= 1;
|
|
||||||
rectBitmap.width = GetCheckBitmapSize().x;
|
|
||||||
|
|
||||||
// never draw the focus rect around the check indicators here
|
|
||||||
DrawCheckButton(dc, wxEmptyString, bitmap, rectBitmap, flags & ~wxCONTROL_FOCUSED);
|
|
||||||
|
|
||||||
wxRect rectLabel = rect;
|
|
||||||
wxCoord shift = rectBitmap.width + 2*GetCheckItemMargin();
|
|
||||||
rectLabel.x += shift;
|
|
||||||
rectLabel.width -= shift;
|
|
||||||
DrawItem(dc, label, rectLabel, flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// check/radion buttons
|
// check/radion buttons
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void wxGTKRenderer::DrawCheckItemBitmap(wxDC& dc,
|
||||||
|
const wxBitmap& bitmap,
|
||||||
|
const wxRect& rect,
|
||||||
|
int flags)
|
||||||
|
{
|
||||||
|
// never draw the focus rect around the check indicators here
|
||||||
|
DrawCheckButton(dc, wxEmptyString, bitmap, rect, flags & ~wxCONTROL_FOCUSED);
|
||||||
|
}
|
||||||
|
|
||||||
void wxGTKRenderer::DrawUndeterminedBitmap(wxDC& dc,
|
void wxGTKRenderer::DrawUndeterminedBitmap(wxDC& dc,
|
||||||
const wxRect& rectTotal,
|
const wxRect& rectTotal,
|
||||||
bool isPressed)
|
bool isPressed)
|
||||||
@@ -1306,20 +1281,12 @@ void wxGTKRenderer::DrawToolBarButton(wxDC& dc,
|
|||||||
|
|
||||||
#if wxUSE_TEXTCTRL
|
#if wxUSE_TEXTCTRL
|
||||||
|
|
||||||
wxRect wxGTKRenderer::GetTextTotalArea(const wxTextCtrl * WXUNUSED(text),
|
|
||||||
const wxRect& rect) const
|
|
||||||
{
|
|
||||||
wxRect rectTotal = rect;
|
|
||||||
rectTotal.Inflate(2*BORDER_THICKNESS);
|
|
||||||
return rectTotal;
|
|
||||||
}
|
|
||||||
|
|
||||||
wxRect wxGTKRenderer::GetTextClientArea(const wxTextCtrl *text,
|
wxRect wxGTKRenderer::GetTextClientArea(const wxTextCtrl *text,
|
||||||
const wxRect& rect,
|
const wxRect& rect,
|
||||||
wxCoord *extraSpaceBeyond) const
|
wxCoord *extraSpaceBeyond) const
|
||||||
{
|
{
|
||||||
wxRect rectText = rect;
|
wxRect
|
||||||
rectText.Deflate(2*BORDER_THICKNESS);
|
rectText = wxStdRenderer::GetTextClientArea(text, rect, extraSpaceBeyond);
|
||||||
|
|
||||||
if ( text->WrapLines() )
|
if ( text->WrapLines() )
|
||||||
{
|
{
|
||||||
@@ -1335,8 +1302,6 @@ wxRect wxGTKRenderer::GetTextClientArea(const wxTextCtrl *text,
|
|||||||
return rectText;
|
return rectText;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // wxUSE_TEXTCTRL
|
|
||||||
|
|
||||||
void wxGTKRenderer::DrawLineWrapMark(wxDC& dc, const wxRect& rect)
|
void wxGTKRenderer::DrawLineWrapMark(wxDC& dc, const wxRect& rect)
|
||||||
{
|
{
|
||||||
wxBitmap bmpLineWrap = GetLineWrapBitmap();
|
wxBitmap bmpLineWrap = GetLineWrapBitmap();
|
||||||
@@ -1362,6 +1327,8 @@ void wxGTKRenderer::DrawLineWrapMark(wxDC& dc, const wxRect& rect)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // wxUSE_TEXTCTRL
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// notebook
|
// notebook
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -170,11 +170,6 @@ public:
|
|||||||
int flags = 0);
|
int flags = 0);
|
||||||
virtual void DrawScrollCorner(wxDC& dc,
|
virtual void DrawScrollCorner(wxDC& dc,
|
||||||
const wxRect& rect);
|
const wxRect& rect);
|
||||||
virtual void DrawCheckItem(wxDC& dc,
|
|
||||||
const wxString& label,
|
|
||||||
const wxBitmap& bitmap,
|
|
||||||
const wxRect& rect,
|
|
||||||
int flags = 0);
|
|
||||||
|
|
||||||
#if wxUSE_TOOLBAR
|
#if wxUSE_TOOLBAR
|
||||||
virtual void DrawToolBarButton(wxDC& dc,
|
virtual void DrawToolBarButton(wxDC& dc,
|
||||||
@@ -342,6 +337,7 @@ public:
|
|||||||
#endif // wxUSE_STATUSBAR
|
#endif // wxUSE_STATUSBAR
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
// overridden wxStdRenderer methods
|
||||||
virtual void DrawFrameWithLabel(wxDC& dc,
|
virtual void DrawFrameWithLabel(wxDC& dc,
|
||||||
const wxString& label,
|
const wxString& label,
|
||||||
const wxRect& rectFrame,
|
const wxRect& rectFrame,
|
||||||
@@ -350,6 +346,11 @@ protected:
|
|||||||
int alignment,
|
int alignment,
|
||||||
int indexAccel);
|
int indexAccel);
|
||||||
|
|
||||||
|
virtual void DrawCheckItemBitmap(wxDC& dc,
|
||||||
|
const wxBitmap& bitmap,
|
||||||
|
const wxRect& rect,
|
||||||
|
int flags);
|
||||||
|
|
||||||
|
|
||||||
// draw the border used for scrollbar arrows
|
// draw the border used for scrollbar arrows
|
||||||
void DrawArrowBorder(wxDC& dc, wxRect *rect, bool isPressed = false);
|
void DrawArrowBorder(wxDC& dc, wxRect *rect, bool isPressed = false);
|
||||||
@@ -363,16 +364,6 @@ protected:
|
|||||||
wxArrowDirection arrowDir,
|
wxArrowDirection arrowDir,
|
||||||
wxArrowStyle arrowStyle);
|
wxArrowStyle arrowStyle);
|
||||||
|
|
||||||
// DrawCheckButton helper
|
|
||||||
void DrawCheckOrRadioButton(wxDC& dc,
|
|
||||||
const wxString& label,
|
|
||||||
const wxBitmap& bitmap,
|
|
||||||
const wxRect& rect,
|
|
||||||
int flags,
|
|
||||||
wxAlignment align,
|
|
||||||
int indexAccel,
|
|
||||||
wxCoord focusOffsetY);
|
|
||||||
|
|
||||||
// draw a normal or transposed line (useful for using the same code fo both
|
// draw a normal or transposed line (useful for using the same code fo both
|
||||||
// horizontal and vertical widgets)
|
// horizontal and vertical widgets)
|
||||||
void DrawLine(wxDC& dc,
|
void DrawLine(wxDC& dc,
|
||||||
@@ -388,9 +379,9 @@ protected:
|
|||||||
|
|
||||||
// get the standard check/radio button bitmap
|
// get the standard check/radio button bitmap
|
||||||
wxBitmap GetIndicator(IndicatorType indType, int flags);
|
wxBitmap GetIndicator(IndicatorType indType, int flags);
|
||||||
wxBitmap GetCheckBitmap(int flags)
|
virtual wxBitmap GetCheckBitmap(int flags)
|
||||||
{ return GetIndicator(IndicatorType_Check, flags); }
|
{ return GetIndicator(IndicatorType_Check, flags); }
|
||||||
wxBitmap GetRadioBitmap(int flags)
|
virtual wxBitmap GetRadioBitmap(int flags)
|
||||||
{ return GetIndicator(IndicatorType_Radio, flags); }
|
{ return GetIndicator(IndicatorType_Radio, flags); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -399,7 +390,7 @@ private:
|
|||||||
|
|
||||||
wxFont m_titlebarFont;
|
wxFont m_titlebarFont;
|
||||||
|
|
||||||
// the checked and unchecked bitmaps for DrawCheckItem()
|
// the checked and unchecked bitmaps for DrawCheckItemBitmap()
|
||||||
wxBitmap m_bmpCheckBitmaps[IndicatorStatus_Max];
|
wxBitmap m_bmpCheckBitmaps[IndicatorStatus_Max];
|
||||||
|
|
||||||
// the bitmaps returned by GetIndicator()
|
// the bitmaps returned by GetIndicator()
|
||||||
@@ -1715,11 +1706,10 @@ void wxWin32Renderer::DrawButtonBorder(wxDC& dc,
|
|||||||
// (check)listbox items
|
// (check)listbox items
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
void wxWin32Renderer::DrawCheckItem(wxDC& dc,
|
void wxWin32Renderer::DrawCheckItemBitmap(wxDC& dc,
|
||||||
const wxString& label,
|
const wxBitmap& bitmap,
|
||||||
const wxBitmap& bitmap,
|
const wxRect& rect,
|
||||||
const wxRect& rect,
|
int flags)
|
||||||
int flags)
|
|
||||||
{
|
{
|
||||||
wxBitmap bmp;
|
wxBitmap bmp;
|
||||||
if ( bitmap.Ok() )
|
if ( bitmap.Ok() )
|
||||||
@@ -1742,13 +1732,6 @@ void wxWin32Renderer::DrawCheckItem(wxDC& dc,
|
|||||||
|
|
||||||
dc.DrawBitmap(bmp, rect.x, rect.y + (rect.height - bmp.GetHeight()) / 2 - 1,
|
dc.DrawBitmap(bmp, rect.x, rect.y + (rect.height - bmp.GetHeight()) / 2 - 1,
|
||||||
true /* use mask */);
|
true /* use mask */);
|
||||||
|
|
||||||
wxRect rectLabel = rect;
|
|
||||||
int bmpWidth = bmp.GetWidth();
|
|
||||||
rectLabel.x += bmpWidth;
|
|
||||||
rectLabel.width -= bmpWidth;
|
|
||||||
|
|
||||||
DrawItem(dc, label, rectLabel, flags);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -1776,6 +1759,10 @@ wxBitmap wxWin32Renderer::GetIndicator(IndicatorType indType, int flags)
|
|||||||
return bmp;
|
return bmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// toolbar stuff
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
#if wxUSE_TOOLBAR
|
#if wxUSE_TOOLBAR
|
||||||
void wxWin32Renderer::DrawToolBarButton(wxDC& dc,
|
void wxWin32Renderer::DrawToolBarButton(wxDC& dc,
|
||||||
const wxString& label,
|
const wxString& label,
|
||||||
@@ -3564,28 +3551,20 @@ wxBitmap wxWin32ArtProvider::CreateBitmap(const wxArtID& id,
|
|||||||
// text control geometry
|
// text control geometry
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
static inline int GetTextBorderWidth()
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
wxRect
|
wxRect
|
||||||
wxWin32Renderer::GetTextTotalArea(const wxTextCtrl * WXUNUSED(text),
|
wxWin32Renderer::GetTextTotalArea(const wxTextCtrl *text,
|
||||||
const wxRect& rect) const
|
const wxRect& rect) const
|
||||||
{
|
{
|
||||||
wxRect rectTotal = rect;
|
wxRect rectTotal = wxStdRenderer::GetTextTotalArea(text, rect);
|
||||||
|
|
||||||
wxCoord widthBorder = GetTextBorderWidth();
|
// this is strange but it's what Windows does
|
||||||
rectTotal.Inflate(widthBorder);
|
|
||||||
|
|
||||||
// this is what Windows does
|
|
||||||
rectTotal.height++;
|
rectTotal.height++;
|
||||||
|
|
||||||
return rectTotal;
|
return rectTotal;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxRect
|
wxRect
|
||||||
wxWin32Renderer::GetTextClientArea(const wxTextCtrl * WXUNUSED(text),
|
wxWin32Renderer::GetTextClientArea(const wxTextCtrl *text,
|
||||||
const wxRect& rect,
|
const wxRect& rect,
|
||||||
wxCoord *extraSpaceBeyond) const
|
wxCoord *extraSpaceBeyond) const
|
||||||
{
|
{
|
||||||
@@ -3595,13 +3574,7 @@ wxWin32Renderer::GetTextClientArea(const wxTextCtrl * WXUNUSED(text),
|
|||||||
if ( rectText.height > 0 )
|
if ( rectText.height > 0 )
|
||||||
rectText.height--;
|
rectText.height--;
|
||||||
|
|
||||||
wxCoord widthBorder = GetTextBorderWidth();
|
return wxStdRenderer::GetTextClientArea(text, rect, extraSpaceBeyond);
|
||||||
rectText.Inflate(-widthBorder);
|
|
||||||
|
|
||||||
if ( extraSpaceBeyond )
|
|
||||||
*extraSpaceBeyond = 0;
|
|
||||||
|
|
||||||
return rectText;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // wxUSE_TEXTCTRL
|
#endif // wxUSE_TEXTCTRL
|
||||||
|
Reference in New Issue
Block a user