]> git.saurik.com Git - wxWidgets.git/blobdiff - src/richtext/richtextbuffer.cpp
prevent disappearing menus in tabmdi
[wxWidgets.git] / src / richtext / richtextbuffer.cpp
index fd6a7c8423831c986e4326da0f9352c593d0c78f..4ac92a5b5298b5b7eac40255b7081d99a90fc9b7 100644 (file)
@@ -3500,7 +3500,7 @@ bool wxRichTextParagraph::GetRangeSize(const wxRichTextRange& range, wxSize& siz
                 rangeToUse.LimitTo(child->GetRange());
                 int childDescent = 0;
 
-                if (child->GetRangeSize(rangeToUse, childSize, childDescent, dc, flags, position))
+                if (child->GetRangeSize(rangeToUse, childSize, childDescent, dc, flags, wxPoint(position.x + sz.x, position.y)))
                 {
                     sz.y = wxMax(sz.y, childSize.y);
                     sz.x += childSize.x;
@@ -3545,7 +3545,7 @@ bool wxRichTextParagraph::GetRangeSize(const wxRichTextRange& range, wxSize& siz
 
                         wxSize childSize;
                         int childDescent = 0;
-                        if (child->GetRangeSize(rangeToUse, childSize, childDescent, dc, flags, position))
+                        if (child->GetRangeSize(rangeToUse, childSize, childDescent, dc, flags, wxPoint(position.x + sz.x, position.y)))
                         {
                             lineSize.y = wxMax(lineSize.y, childSize.y);
                             lineSize.x += childSize.x;
@@ -3921,9 +3921,11 @@ bool wxRichTextParagraph::FindWrapPosition(const wxRichTextRange& range, wxDC& d
         else
         {
             int spacePos = plainText.Find(wxT(' '), true);
-            if (spacePos != wxNOT_FOUND)
+            int tabPos = plainText.Find(wxT('\t'), true);
+            int pos = wxMax(spacePos, tabPos);
+            if (pos != wxNOT_FOUND)
             {
-                int positionsFromEndOfString = plainText.length() - spacePos - 1;
+                int positionsFromEndOfString = plainText.length() - pos - 1;
                 breakPosition = breakPosition - positionsFromEndOfString;
             }
         }
@@ -4329,19 +4331,20 @@ bool wxRichTextPlainText::DrawTabbedString(wxDC& dc, const wxTextAttrEx& attr, c
         dc.SetBrush(*wxBLACK_BRUSH);
         dc.SetPen(*wxBLACK_PEN);
         dc.SetTextForeground(*wxWHITE);
+        dc.SetBackgroundMode(wxTRANSPARENT);
     }
     else
     {
         dc.SetTextForeground(attr.GetTextColour());
-    }
 
-    if (attr.HasFlag(wxTEXT_ATTR_BACKGROUND_COLOUR) && attr.GetBackgroundColour().IsOk())
-    {
-        dc.SetBackgroundMode(wxSOLID);
-        dc.SetTextBackground(attr.GetBackgroundColour());
+        if (attr.HasFlag(wxTEXT_ATTR_BACKGROUND_COLOUR) && attr.GetBackgroundColour().IsOk())
+        {
+            dc.SetBackgroundMode(wxSOLID);
+            dc.SetTextBackground(attr.GetBackgroundColour());
+        }
+        else
+            dc.SetBackgroundMode(wxTRANSPARENT);
     }
-    else
-        dc.SetBackgroundMode(wxTRANSPARENT);
 
     while (hasTabs)
     {