one because we don't want to position the cursor behind the
object what we clicked on, but before - otherwise it looks
funny. */
one because we don't want to position the cursor behind the
object what we clicked on, but before - otherwise it looks
funny. */
CoordType x = 0, len;
/* We search through the objects. As we don't like returning the
object that the cursor is behind, we just remember such an
object in "found" so we can return it if there is really no
further object following it. */
CoordType x = 0, len;
/* We search through the objects. As we don't like returning the
object that the cursor is behind, we just remember such an
object in "found" so we can return it if there is really no
further object following it. */
{
wxLayoutObjectText *tobj = (wxLayoutObjectText *) *i;
tobj->GetText().insert(offset, text);
{
wxLayoutObjectText *tobj = (wxLayoutObjectText *) *i;
tobj->GetText().insert(offset, text);
if((**i).GetType() != WXLO_TYPE_TEXT)
{
// This should only happen when at end of line, behind a non-text
if((**i).GetType() != WXLO_TYPE_TEXT)
{
// This should only happen when at end of line, behind a non-text
// when a line becomes dirty, we redraw it from the place where it was
// changed till the end of line (because the following wxLayoutObjects are
// when a line becomes dirty, we redraw it from the place where it was
// changed till the end of line (because the following wxLayoutObjects are
// must be at the end of the line then
return new wxLayoutLine(this, llist);
// split this line:
// must be at the end of the line then
return new wxLayoutLine(this, llist);
// split this line:
if(GetLength() < wrapmargin)
return false; // nothing to do
// find the object which covers the wrapmargin:
CoordType offset;
wxLOiterator i = FindObject(wrapmargin, &offset);
if(GetLength() < wrapmargin)
return false; // nothing to do
// find the object which covers the wrapmargin:
CoordType offset;
wxLOiterator i = FindObject(wrapmargin, &offset);
wxT("Cannot find object covering wrapmargin."));
// from this object on, the rest of the line must be copied to the
// next one:
wxT("Cannot find object covering wrapmargin."));
// from this object on, the rest of the line must be copied to the
// next one:
// if we split a text-object, we must pre-pend some text to the
// next line later on, remember it here:
wxString prependText = _T("");
// if we split a text-object, we must pre-pend some text to the
// next line later on, remember it here:
wxString prependText = _T("");
// i--;
// try to find a suitable place to split the object:
wxLayoutObjectText *tobj = (wxLayoutObjectText *)*i;
// i--;
// try to find a suitable place to split the object:
wxLayoutObjectText *tobj = (wxLayoutObjectText *)*i;
wxASSERT(m_Next);
// We need to move this and all following objects to the next
// line. Starting from the end of line, to keep the order right.
wxASSERT(m_Next);
// We need to move this and all following objects to the next
// line. Starting from the end of line, to keep the order right.
/* If we reached the begin of the list and have more than one
object, that one is longer than the margin, so break behind
it. */
CoordType pos = 0;
i = m_ObjectList.begin();
/* If we reached the begin of the list and have more than one
object, that one is longer than the margin, so break behind
it. */
CoordType pos = 0;
i = m_ObjectList.begin();
wxPoint pos = GetPosition();
WXLO_DEBUG((wxT("Line %ld, Pos (%ld,%ld), Height %ld, BL %ld, Font: %d"),
(long int) GetLineNumber(),
wxPoint pos = GetPosition();
WXLO_DEBUG((wxT("Line %ld, Pos (%ld,%ld), Height %ld, BL %ld, Font: %d"),
(long int) GetLineNumber(),
CoordType firstOffset, lastOffset;
if(to == -1) to = GetLength();
CoordType firstOffset, lastOffset;
if(to == -1) to = GetLength();
wxLOiterator last = FindObject(to, &lastOffset);
// Common special case: only one object
wxLOiterator last = FindObject(to, &lastOffset);
// Common special case: only one object
wxCHECK_MSG( m_CursorLine, false, wxT("no current line") );
wxCHECK_MSG( n == -1 || n == +1, false, wxT("not implemented yet") );
wxCHECK_MSG( m_CursorLine, false, wxT("no current line") );
wxCHECK_MSG( n == -1 || n == +1, false, wxT("not implemented yet") );
wxLayoutList::FindObjectScreen(wxDC &dc, wxPoint const pos,
wxPoint *cursorPos, bool *found)
{
wxLayoutList::FindObjectScreen(wxDC &dc, wxPoint const pos,
wxPoint *cursorPos, bool *found)
{