call Init() from wxBufferedDC ctors to ensure that layout direction is inherited in any case

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42238 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-10-22 13:04:28 +00:00
parent b1ed79a980
commit c4a34cf8c5

View File

@@ -50,29 +50,25 @@ public:
// Construct a wxBufferedDC using a user supplied buffer. // Construct a wxBufferedDC using a user supplied buffer.
wxBufferedDC(wxDC *dc, wxBufferedDC(wxDC *dc,
const wxBitmap &buffer = wxNullBitmap, const wxBitmap& buffer = wxNullBitmap,
int style = wxBUFFER_CLIENT_AREA) int style = wxBUFFER_CLIENT_AREA)
: m_dc(dc), : m_dc(NULL),
m_buffer(&buffer), m_buffer(NULL)
m_style(style)
{ {
UseBuffer(); Init(dc, buffer, style);
} }
// Construct a wxBufferedDC with an internal buffer of 'area' // Construct a wxBufferedDC with an internal buffer of 'area'
// (where area is usually something like the size of the window // (where area is usually something like the size of the window
// being buffered) // being buffered)
wxBufferedDC(wxDC *dc, const wxSize &area, int style = wxBUFFER_CLIENT_AREA) wxBufferedDC(wxDC *dc, const wxSize& area, int style = wxBUFFER_CLIENT_AREA)
: m_dc(dc), : m_dc(NULL),
m_buffer(NULL), m_buffer(NULL)
m_style(style)
{ {
UseBuffer(area.x, area.y); Init(dc, area, style);
} }
// default copy ctor ok.
// The usually desired action in the dtor is to blit the buffer. // The usually desired action in the dtor is to blit the buffer.
virtual ~wxBufferedDC() virtual ~wxBufferedDC()
{ {
@@ -80,8 +76,7 @@ public:
UnMask(); UnMask();
} }
// These reimplement the actions of the ctors for two stage creation, but // These reimplement the actions of the ctors for two stage creation
// are not used by the ctors themselves to save a few cpu cycles.
void Init(wxDC *dc, void Init(wxDC *dc,
const wxBitmap& buffer = wxNullBitmap, const wxBitmap& buffer = wxNullBitmap,
int style = wxBUFFER_CLIENT_AREA) int style = wxBUFFER_CLIENT_AREA)
@@ -271,5 +266,4 @@ inline wxDC* wxAutoBufferedPaintDCFactory(wxWindow* window)
return new wxBufferedPaintDC(window); return new wxBufferedPaintDC(window);
} }
#endif // _WX_DCBUFFER_H_ #endif // _WX_DCBUFFER_H_