highlighting fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2500 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -935,24 +935,7 @@ wxLayoutLine::Draw(wxDC &dc,
|
|||||||
{
|
{
|
||||||
// parts of the line need highlighting
|
// parts of the line need highlighting
|
||||||
tempto = xpos+(**i).GetLength();
|
tempto = xpos+(**i).GetLength();
|
||||||
#if 0
|
(**i).Draw(dc, pos, llist, from-xpos, to-xpos);
|
||||||
if(tempto >= from && xpos <= to)
|
|
||||||
{
|
|
||||||
tempto = to-xpos;
|
|
||||||
if(tempto > (**i).GetLength())
|
|
||||||
tempto = (**i).GetLength();
|
|
||||||
CoordType tmp = from-xpos;
|
|
||||||
if(tmp < 0) tmp = 0;
|
|
||||||
#endif
|
|
||||||
(**i).Draw(dc, pos, llist, from-xpos, to-xpos);
|
|
||||||
#if 0
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
llist->EndHighlighting(dc); // FIXME! inefficient
|
|
||||||
(**i).Draw(dc, pos, llist);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
(**i).Draw(dc, pos, llist);
|
(**i).Draw(dc, pos, llist);
|
||||||
@@ -1149,7 +1132,7 @@ wxLayoutLine::Break(CoordType xpos, wxLayoutList *llist)
|
|||||||
void
|
void
|
||||||
wxLayoutLine::MergeNextLine(wxLayoutList *llist)
|
wxLayoutLine::MergeNextLine(wxLayoutList *llist)
|
||||||
{
|
{
|
||||||
wxASSERT(GetNextLine());
|
wxCHECK_RET(GetNextLine(),"wxLayout internal error: no next line to merge");
|
||||||
wxLayoutObjectList &list = GetNextLine()->m_ObjectList;
|
wxLayoutObjectList &list = GetNextLine()->m_ObjectList;
|
||||||
wxLOiterator i;
|
wxLOiterator i;
|
||||||
//FIXME: this could be optimised, for now be prudent:
|
//FIXME: this could be optimised, for now be prudent:
|
||||||
@@ -1164,6 +1147,7 @@ wxLayoutLine::MergeNextLine(wxLayoutList *llist)
|
|||||||
wxLayoutLine *oldnext = GetNextLine();
|
wxLayoutLine *oldnext = GetNextLine();
|
||||||
SetNext(GetNextLine()->GetNextLine());
|
SetNext(GetNextLine()->GetNextLine());
|
||||||
delete oldnext;
|
delete oldnext;
|
||||||
|
GetNextLine()->MoveLines(-1);
|
||||||
RecalculatePositions(1, llist);
|
RecalculatePositions(1, llist);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1766,7 +1750,7 @@ wxLayoutList::Layout(wxDC &dc, CoordType bottom, bool forceAll)
|
|||||||
// little condition to speed up redrawing:
|
// little condition to speed up redrawing:
|
||||||
if(bottom != -1 && line->GetPosition().y > bottom) break;
|
if(bottom != -1 && line->GetPosition().y > bottom) break;
|
||||||
}
|
}
|
||||||
line->RecalculatePosition(this);
|
line->RecalculatePositions(1,this);
|
||||||
line = line->GetNextLine();
|
line = line->GetNextLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1793,6 +1777,7 @@ wxLayoutList::Draw(wxDC &dc,
|
|||||||
ApplyStyle(&m_DefaultSetting, dc);
|
ApplyStyle(&m_DefaultSetting, dc);
|
||||||
wxBrush brush(m_CurrentSetting.m_bg, wxSOLID);
|
wxBrush brush(m_CurrentSetting.m_bg, wxSOLID);
|
||||||
dc.SetBrush(brush);
|
dc.SetBrush(brush);
|
||||||
|
dc.SetBackgroundMode(wxTRANSPARENT);
|
||||||
|
|
||||||
while(line)
|
while(line)
|
||||||
{
|
{
|
||||||
@@ -2088,6 +2073,7 @@ wxLayoutList::StartHighlighting(wxDC &dc)
|
|||||||
#if SHOW_SELECTIONS
|
#if SHOW_SELECTIONS
|
||||||
dc.SetTextForeground(m_CurrentSetting.m_bg);
|
dc.SetTextForeground(m_CurrentSetting.m_bg);
|
||||||
dc.SetTextBackground(m_CurrentSetting.m_fg);
|
dc.SetTextBackground(m_CurrentSetting.m_fg);
|
||||||
|
dc.SetBackgroundMode(wxSOLID);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2098,6 +2084,7 @@ wxLayoutList::EndHighlighting(wxDC &dc)
|
|||||||
#if SHOW_SELECTIONS
|
#if SHOW_SELECTIONS
|
||||||
dc.SetTextForeground(m_CurrentSetting.m_fg);
|
dc.SetTextForeground(m_CurrentSetting.m_fg);
|
||||||
dc.SetTextBackground(m_CurrentSetting.m_bg);
|
dc.SetTextBackground(m_CurrentSetting.m_bg);
|
||||||
|
dc.SetBackgroundMode(wxTRANSPARENT);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2171,8 +2158,8 @@ wxLayoutList::GetSelection(wxLayoutDataObject *wxlo, bool invalidate)
|
|||||||
|
|
||||||
wxLayoutList *llist = Copy( m_Selection.m_CursorA,
|
wxLayoutList *llist = Copy( m_Selection.m_CursorA,
|
||||||
m_Selection.m_CursorB );
|
m_Selection.m_CursorB );
|
||||||
|
|
||||||
if(wxlo) // export as data object, too
|
if(llist && wxlo) // export as data object, too
|
||||||
{
|
{
|
||||||
wxString string;
|
wxString string;
|
||||||
|
|
||||||
@@ -2249,6 +2236,9 @@ wxLayoutPrintout::wxLayoutPrintout(wxLayoutList *llist,
|
|||||||
{
|
{
|
||||||
m_llist = llist;
|
m_llist = llist;
|
||||||
m_title = title;
|
m_title = title;
|
||||||
|
// remove any highlighting which could interfere with printing:
|
||||||
|
m_llist->StartSelection();
|
||||||
|
m_llist->EndSelection();
|
||||||
}
|
}
|
||||||
|
|
||||||
wxLayoutPrintout::~wxLayoutPrintout()
|
wxLayoutPrintout::~wxLayoutPrintout()
|
||||||
|
Reference in New Issue
Block a user