1. crash when deleting multi line selection fixed

2. BreakLine() does just discard the first line (wreaking total havoc) any
   more
3. ScrollToCursor() actually scrolls to cursor
4. style change affects the first line too - and since the first time, style
   doesn't change mysteriously any more after second Clear()
5. word cursor movement even better (did I get it right this time?)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2766 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-06-12 21:07:44 +00:00
parent 6b92f831b7
commit 668e4f17be
6 changed files with 200 additions and 94 deletions

View File

@@ -520,12 +520,14 @@ public:
/** Finds the object which covers the screen position xpos in this
line.
@param dc the wxDC to use for calculations
@param llist the layout list to which this line belongs
@param xpos the screen x coordinate
@param offset where to store the difference between xpos and
the object's head
@return iterator to the object or NULLIT
*/
wxLayoutObjectList::iterator FindObjectScreen(wxDC &dc,
wxLayoutList *llist,
CoordType xpos,
CoordType *offset,
bool *found = NULL) const ;
@@ -541,11 +543,18 @@ public:
functions to export the list.
@return iterator to the first object
*/
wxLayoutObjectList::iterator GetFirstObject(void)
wxLayoutObjectList::iterator GetFirstObject(void) const
{
return m_ObjectList.begin();
}
/** Get the last object in the list.
*/
wxLayoutObjectList::iterator GetLastObject(void) const
{
return m_ObjectList.tail();
}
/** Deletes this line, returns pointer to next line.
@param update If true, update all following lines.
*/
@@ -600,13 +609,14 @@ public:
for that position
@return pointer to the object
*/
wxLayoutObject * FindObjectScreen(wxDC &dc, CoordType xpos, bool
*found = NULL);
wxLayoutObject * FindObjectScreen(wxDC &dc,
CoordType xpos,
bool *found = NULL);
/** This sets the style info for the beginning of this line.
@param si styleinfo structure
*/
void ApplyStyle(const wxLayoutStyleInfo &si)
{ m_StyleInfo = si; }
{ m_StyleInfo = si; }
//@}
@@ -1123,6 +1133,26 @@ public:
void IncNumLines() { m_numLines++; }
void DecNumLines() { m_numLines--; }
/// get the line by number
wxLayoutLine *GetLine(CoordType index) const
{
wxASSERT_MSG( (0 <= index) && (index < (CoordType)m_numLines),
"invalid index" );
wxLayoutLine *line;
CoordType n = index;
for ( line = m_FirstLine; line && n-- > 0; line = line->GetNextLine() )
;
if ( line )
{
// should be the right one
wxASSERT( line->GetLineNumber() == index );
}
return line;
}
private:
/// Clear the list.
void InternalClear(void);