}
else // backwards
{
- if ( isspace(*p) )
+ // in these 2 cases we took 1 char too much
+ if ( (p < start) || isspace(*p) )
+ {
p++;
+ }
}
n > 0 ? n-- : n++;
if(prev)
height += prev->GetHeight();
height += m_CursorLine->GetHeight();
-
+
m_movedCursor = true;
SetUpdateRect(position);
if(cpos && line ->GetLineNumber() == cpos->y)
{
*cpos = m_CursorScreenPos;
- *csize = m_CursorSize;
+ if ( csize )
+ *csize = m_CursorSize;
}
}
else
DoPaint((wxRect *)NULL);
}
+void wxLayoutWindow::Refresh(bool eraseBackground, const wxRect *rect)
+{
+ wxScrolledWindow::Refresh(eraseBackground, rect);
+
+ ResizeScrollbars();
+ ScrollToCursor();
+}
+
void
wxLayoutWindow::OnMouse(int eventId, wxMouseEvent& event)
{
case WXLOWIN_MENU_LDOWN:
{
// always move cursor to mouse click:
- m_llist->MoveCursorTo(cursorPos);
+ if ( obj )
+ {
+ // we have found the real position
+ m_llist->MoveCursorTo(cursorPos);
+ }
+ else
+ {
+ // click beyond the end of the text
+ m_llist->MoveCursorTo(m_llist->GetSize());
+ }
// clicking a mouse removes the selection
if ( m_llist->HasSelection() )
int underline=0,
wxColour *fg=NULL,
wxColour *bg=NULL);
+
+ /// override base class virtual to also refresh the scrollbar position
+ virtual void Refresh(bool eraseBackground = TRUE,
+ const wxRect *rect = (const wxRect *)NULL);
+
/** Sets a background image, only used on screen, not on printouts.
@param bitmap a pointer to a wxBitmap or NULL to remove it
*/