]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/dc.h
Updated translations manual page with latest status given by the website translations...
[wxWidgets.git] / include / wx / dc.h
index fefa92f50e64e69dc9ecae3ae2286832f1c07c2e..ab19b30997693a161011a70679a0cbcca8febefb 100644 (file)
@@ -1,7 +1,7 @@
 /////////////////////////////////////////////////////////////////////////////
 // Name:        wx/dc.h
 // Purpose:     wxDC class
-// Author:      Vadim Zeitlin 
+// Author:      Vadim Zeitlin
 // Modified by:
 // Created:     05/25/99
 // RCS-ID:      $Id$
@@ -497,10 +497,10 @@ public:
     // ---------------------------------------------------------
     // wxPrinterDC Impl API
 
-    virtual wxRect GetPaperRect()
+    virtual wxRect GetPaperRect() const
         { int w = 0; int h = 0; DoGetSize( &w, &h ); return wxRect(0,0,w,h); }
 
-    virtual int GetResolution()
+    virtual int GetResolution() const
         { return -1; }
 
 private:
@@ -667,7 +667,7 @@ public:
     wxSize GetPPI() const
         { return m_pimpl->GetPPI(); }
 
-    virtual int GetResolution()
+    virtual int GetResolution() const
         { return m_pimpl->GetResolution(); }
 
     // Right-To-Left (RTL) modes
@@ -1121,8 +1121,12 @@ public:
     wxDEPRECATED( void GetLogicalOrigin(long *x, long *y) const );
     wxDEPRECATED( void GetDeviceOrigin(long *x, long *y) const );
     wxDEPRECATED( void GetClippingBox(long *x, long *y, long *w, long *h) const );
+
 #endif  // WXWIN_COMPATIBILITY_2_8
 
+#ifdef __WXMSW__
+    WXHDC GetHDC() const;
+#endif // __WXMSW__
 
 protected:
     // ctor takes ownership of the pointer
@@ -1248,4 +1252,32 @@ private:
     DECLARE_NO_COPY_CLASS(wxDCClipper)
 };
 
+// ----------------------------------------------------------------------------
+// helper class: you can use it to temporarily change the DC font and
+// restore it automatically when the object goes out of scope
+// ----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_CORE wxDCFontChanger
+{
+public:
+    wxDCFontChanger(wxDC& dc, const wxFont& font) : m_dc(dc), m_fontOld(dc.GetFont())
+    {
+        m_dc.SetFont(font);
+    }
+
+    ~wxDCFontChanger()
+    {
+        if ( m_fontOld.Ok() )
+            m_dc.SetFont(m_fontOld);
+    }
+
+private:
+    wxDC& m_dc;
+
+    wxFont m_fontOld;
+
+    DECLARE_NO_COPY_CLASS(wxDCFontChanger)
+};
+
+
 #endif // _WX_DC_H_BASE_