+ while(i != end());
+ m_MaxY = position.y + baseLineSkip;
+}
+
+void
+wxLayoutList::Draw(wxDC &dc,
+ CoordType fromLine, CoordType toLine,
+ iterator start,
+ wxPoint const &translate)
+{
+ //Layout(dc); // FIXME just for now
+
+ ResetSettings(dc);
+
+ wxLayoutObjectList::iterator i;
+
+ if(start == iterator(NULL))
+ start = begin();
+ else // we need to restore font settings
+ {
+ for( i = begin() ; i != start; i++)
+ if((**i).GetType() == WXLO_TYPE_CMD)
+ (**i).Draw(dc,translate); // apply font settings
+ }
+
+ while( start != end() && (**start).GetPosition().y < fromLine)
+ {
+ if((**start).GetType() == WXLO_TYPE_CMD)
+ (**start).Draw(dc,translate); // apply font settings
+ start++;
+ }
+ for( i = start ;
+ i != end() && (toLine == -1 || (**i).GetPosition().y < toLine) ;
+ i++ )
+ (*i)->Draw(dc,translate);
+}
+
+/** Erase at least to end of line */
+void
+wxLayoutList::EraseAndDraw(wxDC &dc, iterator start, wxPoint const &translate)
+{
+ //look for begin of line
+ while(start != end() && start != begin() && (**start).GetType() !=
+ WXLO_TYPE_LINEBREAK)
+ start--;
+ if(start == iterator(NULL))
+ start = begin();
+ if(start == iterator(NULL))
+ return;
+
+ wxPoint p = (**start).GetPosition();
+
+ //FIXME: wxGTK: MaxX()/MaxY() broken
+ //WXL_VAR(dc.MaxX()); WXL_VAR(dc.MaxY());
+
+ dc.SetBrush(wxBrush(*m_ColourBG, wxSOLID));
+ dc.SetPen(wxPen(*m_ColourBG,0,wxTRANSPARENT));
+ dc.DrawRectangle(p.x,p.y,2000,2000); //dc.MaxX(),dc.MaxY());
+ Draw(dc,-1,-1,start,translate);
+ //dc.DrawRectangle(p.x,p.y,2000,2000); //dc.MaxX(),dc.MaxY());
+}
+
+
+void
+wxLayoutList::CalculateCursor(wxDC &dc)
+{
+ if(! m_CursorMoved)
+ return;
+
+ CoordType width, height, descent;
+ CoordType baseLineSkip = 20; //FIXME
+
+ int cursorWidth = m_boldCursor ? 4 : 2;
+
+ if( m_CursorObject == iterator(NULL)) // empty list
+ {
+ m_CursorCoords = wxPoint(0,0);
+ m_CursorSize = wxPoint(cursorWidth,baseLineSkip);
+ m_CursorMoved = false; // coords are valid
+ return;
+ }
+ wxLayoutObjectBase &obj = **m_CursorObject;
+
+ m_CursorCoords = obj.GetPosition();
+ if(obj.GetType() == WXLO_TYPE_TEXT)