]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/richedit/wxllist.cpp
ignore error when trying to delete zlib.lib
[wxWidgets.git] / samples / richedit / wxllist.cpp
index 7fb9992447328bcc26749777dd688c671a0b0f42..32224783f211e6ed57695b1d81d617114f593898 100644 (file)
@@ -1230,7 +1230,7 @@ wxLayoutLine::Layout(wxDC &dc,
    {
       // this might be the case if the cursor is at the end of the
       // line or on a command object:
-      if(cursorSize->y < WXLO_MINIMUM_CURSOR_WIDTH)
+      if(cursorSize->x < WXLO_MINIMUM_CURSOR_WIDTH)
       {
          CoordType width, height, descent;
          dc.GetTextExtent(WXLO_CURSORCHAR, &width, &height, &descent);
@@ -1568,6 +1568,18 @@ wxLayoutList::InternalClear(void)
    m_CursorStyleInfo = m_DefaultStyleInfo;
 }
 
+void
+wxLayoutList::Read(wxString &istr)
+{
+   while(istr.Length())
+   {
+      wxLayoutObject *obj = wxLayoutObject::Read(istr);
+      if(obj)
+         Insert(obj);
+   }
+}
+
+
 void
 wxLayoutList::SetFont(int family, int size, int style, int weight,
                       int underline, wxColour *fg,
@@ -2019,8 +2031,7 @@ wxLayoutList::LineBreak(void)
    m_CursorLine = m_CursorLine->Break(m_CursorPos.x, this);
    if(m_CursorLine->GetPreviousLine() == NULL)
       m_FirstLine = m_CursorLine;
-   if(m_CursorPos.x > 0)
-      m_CursorPos.y++;
+   m_CursorPos.y++;
    m_CursorPos.x = 0;
 
    // The following code will produce a height which is guaranteed to
@@ -2479,6 +2490,8 @@ wxLayoutList::DrawCursor(wxDC &dc, bool active, wxPoint const &translate)
 #ifdef WXLAYOUT_USE_CARET
    m_caret->Move(coords);
 #else // !WXLAYOUT_USE_CARET
+
+   wxASSERT(m_CursorSize.x >= WXLO_MINIMUM_CURSOR_WIDTH);
    dc.SetBrush(*wxWHITE_BRUSH);
    //FIXME: wxGTK XOR is borken at the moment!!!dc.SetLogicalFunction(wxXOR);
    dc.SetPen(wxPen(*wxBLACK,1,wxSOLID));
@@ -2544,16 +2557,16 @@ wxLayoutList::ContinueSelection(const wxPoint& cposOrig, const wxPoint& spos)
    wxASSERT(m_Selection.m_valid == false);
    WXLO_DEBUG(("Continuing selection at %ld/%ld", cpos.x, cpos.y));
 
-      m_Selection.m_ScreenB = spos;
-      m_Selection.m_CursorB = cpos;}
+   m_Selection.m_ScreenB = spos;
+   m_Selection.m_CursorB = cpos;
+}
 
 void
 wxLayoutList::EndSelection(const wxPoint& cposOrig, const wxPoint& spos)
 {
    wxPoint cpos(cposOrig);
-   if(cpos.x == -1)
-      cpos = m_CursorPos;
-   ContinueSelection(cpos);
+   if(cpos.x == -1) cpos = m_CursorPos;
+   ContinueSelection(cpos, spos);
    WXLO_DEBUG(("Ending selection at %ld/%ld", cpos.x, cpos.y));
    // we always want m_CursorA <= m_CursorB!
    if( m_Selection.m_CursorA > m_Selection.m_CursorB )
@@ -2854,7 +2867,6 @@ wxLayoutList::GetSelection(wxLayoutDataObject *wxlo, bool invalidate)
             exp->content.object->Write(string);
          delete exp;
       }
-
       wxlo->SetLayoutData(string);
    }
    return llist;