// return the frame icon bitmap
virtual wxBitmap GetFrameButtonBitmap(FrameButtonType type) = 0;
+ // get the width of either normal or resizeable 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;
// constants
// ----------------------------------------------------------------------------
-static const int FRAME_BORDER_THICKNESS = 3;
-static const int RESIZEABLE_FRAME_BORDER_THICKNESS = 4;
static const int FRAME_TITLEBAR_HEIGHT = 18;
static const int FRAME_BUTTON_WIDTH = 16;
static const int FRAME_BUTTON_HEIGHT = 14;
dc.DrawBitmap(bmp, rectBmp.CentreIn(rectBtn).GetPosition(), true);
}
+int wxStdRenderer::GetFrameBorderWidth(int flags) const
+{
+ return flags & wxTOPLEVEL_RESIZEABLE ? 4 : 3;
+}
+
wxRect wxStdRenderer::GetFrameClientArea(const wxRect& rect, int flags) const
{
if ( (flags & wxTOPLEVEL_BORDER) && !(flags & wxTOPLEVEL_MAXIMIZED) )
{
- int border = flags & wxTOPLEVEL_RESIZEABLE
- ? RESIZEABLE_FRAME_BORDER_THICKNESS
- : FRAME_BORDER_THICKNESS;
- r.Inflate(-border);
+ r.Inflate(-GetFrameBorderWidth(flags));
}
if ( flags & wxTOPLEVEL_TITLEBAR )
if ( (flags & wxTOPLEVEL_BORDER) && !(flags & wxTOPLEVEL_MAXIMIZED) )
{
- int border = flags & wxTOPLEVEL_RESIZEABLE
- ? RESIZEABLE_FRAME_BORDER_THICKNESS
- : FRAME_BORDER_THICKNESS;
- s.x += 2*border;
- s.y += 2*border;
+ s.IncBy(2*GetFrameBorderWidth(flags));
}
if ( flags & wxTOPLEVEL_TITLEBAR )
if ( (flags & wxTOPLEVEL_BORDER) && !(flags & wxTOPLEVEL_MAXIMIZED) )
{
- int border = (flags & wxTOPLEVEL_RESIZEABLE) ?
- RESIZEABLE_FRAME_BORDER_THICKNESS :
- FRAME_BORDER_THICKNESS;
- s.x += 2*border;
- s.y += 2*border;
+ s.IncBy(2*GetFrameBorderWidth(flags));
}
if ( flags & wxTOPLEVEL_TITLEBAR )
{ return GetIndicator(IndicatorType_Radio, flags); }
virtual wxBitmap GetFrameButtonBitmap(FrameButtonType type);
+ virtual int GetFrameBorderWidth(int flags) const;
private:
// the bitmaps returned by GetIndicator()
// top level windows
// ----------------------------------------------------------------------------
+int wxMonoRenderer::GetFrameBorderWidth(int WXUNUSED(flags)) const
+{
+ // all our borders are simple
+ return 1;
+}
// ----------------------------------------------------------------------------
// wxMonoArtProvider