Printing produces empty pages only.
-Formatting of first text in message in M is broken.
-Large images in last line don't get displayed properly.
-Taking last line's height as default for next is rubbish,
-use "default height" and adjust as necessary.
-
Selections:
- moving in negative direction doesn't work
- selection state not properly reset, only works once
- selecting non-text objects is strange
-wxllist::GetSize() requires extra Layout() call, which should not be
-necessary. Find out why this is so.
-YES, it is necessary, because the normal drawing only happens within
-the visible window.
-I must find a way to re-Layout() objects. This is only required after
-their sizes change:
-- Just mark them as dirty:
- - mark current line as dirty when editing it (so width gets recalculated)
- - mark all following lines as dirty when changing font settings
- - Let Layout() work only on the dirty lines.
- !!! GOOD: this can also be used to recalculate the wxLayoutObjectCmds'
- fonts! :-)
-
-- cursor screen positioning ignores font sizes once again :-(
- --> UpdateCursorScreenPos() cannot work as it ignores previous font formatting commands.
- Either draw cursor when drawing text, or wait for new wxLayoutObjectCmd to be fully
- implemented.
-
-RECENTLY FIXED (?)
- - delete in empty line doesn't work
+- Changing default settings in Clear() or changing/inserting/deleting
+ a wxLayoutObject needs to update the m_StyleInfo in all lines, only
+ then can we start using that one.
- update rectangle (needs support in wxllist and wxWindows)
--> needs a bit of fixing still
offset handling seems a bit dodgy, white shadow to top/left of cursor
- replacement of llist in window
- - undo
- UNDO
- DragNDrop
-- More optimisations:
- - let each line have a pointer to the last layoutcommand and let that
- one only store the settings that changed, then we no longer need to
- recalculate all the lines
-
+ - Update docs, do full rtf/html editing.
+ - Verify html export.
m_LineNumber = m_Previous->GetLineNumber()+1;
m_Next = m_Previous->GetNextLine();
m_Previous->m_Next = this;
- m_Height = m_Previous->GetHeight();
}
if(m_Next)
{
for(i = m_ObjectList.begin(); i != NULLIT; i++)
{
-//FIXME! (**i).Layout(dc, NULL);
width = (**i).GetWidth();
if( x <= xpos && xpos <= x + width )
{
*cxpos = cx + (**i).GetOffsetScreen(dc, xpos-x);
-// WXLO_DEBUG(("wxLayoutLine::FindObjectScreen: cursor xpos = %ld", *cxpos));
if(found) *found = true;
return i;
}
{
wxASSERT(xpos >= 0);
wxASSERT(obj != NULL);
+ //FIXME: this could be optimised, for now be prudent:
+ m_Dirty = true;
CoordType offset;
wxLOiterator i = FindObject(xpos, &offset);
if(i == NULLIT)
wxLayoutLine::Insert(CoordType xpos, wxString text)
{
wxASSERT(xpos >= 0);
+ //FIXME: this could be optimised, for now be prudent:
+ m_Dirty = true;
CoordType offset;
wxLOiterator i = FindObject(xpos, &offset);
if(i != NULLIT && (**i).GetType() == WXLO_TYPE_TEXT)
wxASSERT(xpos >= 0);
wxASSERT(npos >= 0);
+ //FIXME: this could be optimised, for now be prudent:
+ m_Dirty = true;
wxLOiterator i = FindObject(xpos, &offset);
while(npos > 0)
{
{
wxASSERT(xpos >= 0);
CoordType offset;
+ //FIXME: this could be optimised, for now be prudent:
+ m_Dirty = true;
wxLOiterator i = FindObject(xpos, &offset);
wxPoint size;
bool cursorFound = false;
+ m_Dirty = false;
+
if(cursorPos)
{
*cursorPos = m_Position;
if(m_Height == 0)
{
- if(GetPreviousLine()) // empty line
- {
- m_Height = GetPreviousLine()->GetHeight();
- m_BaseLine = GetPreviousLine()->m_BaseLine;
- }
- else
- {
- CoordType width, height, descent;
- dc.GetTextExtent(WXLO_CURSORCHAR, &width, &height, &descent);
- m_Height = height;
- m_BaseLine = m_Height - descent;
- }
+ CoordType width, height, descent;
+ dc.GetTextExtent(WXLO_CURSORCHAR, &width, &height, &descent);
+ m_Height = height;
+ m_BaseLine = m_Height - descent;
}
wxLayoutLine::Break(CoordType xpos, wxLayoutList *llist)
{
wxASSERT(xpos >= 0);
+ //FIXME: this could be optimised, for now be prudent:
+ m_Dirty = true;
if(xpos == 0)
{ // insert an empty line before this one
wxASSERT(GetNextLine());
wxLayoutObjectList &list = GetNextLine()->m_ObjectList;
wxLOiterator i;
+ //FIXME: this could be optimised, for now be prudent:
+ m_Dirty = true;
for(i = list.begin(); i != list.end();)
{
return m_CursorScreenPos;
}
+/*
+ Is called before each Draw(). Now, it will re-layout all lines which
+ have changed.
+*/
void
-wxLayoutList::Layout(wxDC &dc, CoordType bottom)
+wxLayoutList::Layout(wxDC &dc, CoordType bottom, bool forceAll)
{
wxLayoutLine *line = m_FirstLine;
-
+
// first, make sure everything is calculated - this might not be
// needed, optimise it later
- ApplyStyle(&m_DefaultSetting, dc);
+ //FIXME This doesn't work yet, needs updating afterr default
+ //settings for list or a wxLayoutObjectCmd have changed:
+ // ApplyStyle(&m_DefaultSetting, dc);
while(line)
{
- line->GetStyleInfo() = m_CurrentSetting;
- if(line == m_CursorLine)
- line->Layout(dc, this, (wxPoint *)&m_CursorScreenPos, (wxPoint *)&m_CursorSize, m_CursorPos.x);
- else
- line->Layout(dc, this);
- // little condition to speed up redrawing:
- if(bottom != -1 && line->GetPosition().y > bottom) break;
+ if(forceAll || line->IsDirty())
+ {
+ line->GetStyleInfo() = m_CurrentSetting;
+ if(line == m_CursorLine)
+ line->Layout(dc, this, (wxPoint *)&m_CursorScreenPos,
+ (wxPoint *)&m_CursorSize, m_CursorPos.x);
+ else
+ line->Layout(dc, this);
+ line->RecalculatePosition(this);
+ // little condition to speed up redrawing:
+ if(bottom != -1 && line->GetPosition().y > bottom) break;
+ }
line = line->GetNextLine();
}
{
wxLayoutLine *line = m_FirstLine;
+ Layout(dc);
ApplyStyle(&m_DefaultSetting, dc);
- wxBrush brush(m_DefaultSetting.m_bg, wxSOLID);
+ wxBrush brush(m_CurrentSetting.m_bg, wxSOLID);
dc.SetBrush(brush);
while(line)