X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8f20ea03912fa5bffc537230ce853ef15b77f1fa..7a69cd967ad590541b83a6c52dca78b5b24f4037:/include/wx/dcmirror.h diff --git a/include/wx/dcmirror.h b/include/wx/dcmirror.h index fcb396113c..5b3a13988c 100644 --- a/include/wx/dcmirror.h +++ b/include/wx/dcmirror.h @@ -18,7 +18,7 @@ // wxMirrorDC allows to write the same code for horz/vertical layout // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxMirrorDC : public wxDCBase +class WXDLLEXPORT wxMirrorDC : public wxDC { public: // constructs a mirror DC associated with the given real DC @@ -67,6 +67,12 @@ public: virtual void SetLogicalFunction(int function) { m_dc.SetLogicalFunction(function); } + // helper functions which may be useful for the users of this class + wxSize Reflect(const wxSize& sizeOrig) + { + return m_mirror ? wxSize(sizeOrig.y, sizeOrig.x) : sizeOrig; + } + protected: // returns x and y if not mirroring or y and x if mirroring wxCoord GetX(wxCoord x, wxCoord y) const { return m_mirror ? y : x; } @@ -272,6 +278,8 @@ private: wxMirrorDC& m_dc; bool m_mirror; + + DECLARE_NO_COPY_CLASS(wxMirrorDC) }; #endif // _WX_DCMIRROR_H_