]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/dcbase.cpp
Correctly determine best wxPropertyGrid width.
[wxWidgets.git] / src / common / dcbase.cpp
index 1742bf8dadf501062060326c5f9ef153588d4b10..d698009c316fe755d4ea235d8a277c7b189255e7 100644 (file)
@@ -569,7 +569,7 @@ void wxDCImpl::GetMultiLineTextExtent(const wxString& text,
     wxString curLine;
     for ( wxString::const_iterator pc = text.begin(); ; ++pc )
     {
-        if ( pc == text.end() || *pc == _T('\n') )
+        if ( pc == text.end() || *pc == wxT('\n') )
         {
             if ( curLine.empty() )
             {
@@ -585,7 +585,7 @@ void wxDCImpl::GetMultiLineTextExtent(const wxString& text,
                 if ( !heightLineDefault )
                 {
                     // but we don't know it yet - choose something reasonable
-                    DoGetTextExtent(_T("W"), NULL, &heightLineDefault,
+                    DoGetTextExtent(wxT("W"), NULL, &heightLineDefault,
                                   NULL, NULL, font);
                 }
 
@@ -656,7 +656,7 @@ wxDCImpl::DoStretchBlit(wxCoord xdest, wxCoord ydest,
                         wxCoord ysrcMask)
 {
     wxCHECK_MSG( srcWidth && srcHeight && dstWidth && dstHeight, false,
-                 _T("invalid blit size") );
+                 wxT("invalid blit size") );
 
     // emulate the stretching by modifying the DC scale
     double xscale = (double)srcWidth/dstWidth,
@@ -1115,7 +1115,8 @@ void wxDCImpl::InheritAttributes(wxWindow *win)
     SetFont(win->GetFont());
     SetTextForeground(win->GetForegroundColour());
     SetTextBackground(win->GetBackgroundColour());
-    SetBackground(wxBrush(win->GetBackgroundColour()));
+    SetBackground(win->GetBackgroundColour());
+    SetLayoutDirection(win->GetLayoutDirection());
 }
 
 //-----------------------------------------------------------------------------
@@ -1124,6 +1125,15 @@ void wxDCImpl::InheritAttributes(wxWindow *win)
 
 IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
 
+void wxDC::CopyAttributes(const wxDC& dc)
+{
+    SetFont(dc.GetFont());
+    SetTextForeground(dc.GetTextForeground());
+    SetTextBackground(dc.GetTextBackground());
+    SetBackground(dc.GetBackground());
+    SetLayoutDirection(dc.GetLayoutDirection());
+}
+
 void wxDC::DrawLabel(const wxString& text,
                          const wxBitmap& bitmap,
                          const wxRect& rect,