- case WXLOWIN_MENU_LDOWN:
- {
- // always move cursor to mouse click:
- if ( obj )
- {
- // we have found the real position
- m_llist->MoveCursorTo(cursorPos);
- }
- else
- {
- // click beyond the end of the text
- m_llist->MoveCursorToEnd();
- }
-
- // clicking a mouse removes the selection
- if ( m_llist->HasSelection() )
- {
- m_llist->DiscardSelection();
- DoPaint(); // TODO: we don't have to redraw everything!
- }
-
- // Calculate where the top of the visible area is:
- int x0, y0;
- ViewStart(&x0,&y0);
- int dx, dy;
- GetScrollPixelsPerUnit(&dx, &dy);
- x0 *= dx; y0 *= dy;
-
- wxPoint offset(-x0+WXLO_XOFFSET, -y0+WXLO_YOFFSET);
-
- if(m_CursorVisibility == -1)
- m_CursorVisibility = 1;
-
- if(m_CursorVisibility != 0)
- {
- // draw a thick cursor for editable windows with focus
- m_llist->DrawCursor(dc, m_HaveFocus && IsEditable(), offset);
- }
-
- // VZ: this should be unnecessary because mouse can only click on a
- // visible part of the canvas
-#if 0
- ScrollToCursor();
-#endif // 0
+ // clicking a mouse removes the selection
+ if ( m_llist->HasSelection() )
+ {
+ m_llist->DiscardSelection();
+ m_Selecting = false;
+ RequestUpdate(); // TODO: we don't have to redraw everything!
+ }
+
+ // Calculate where the top of the visible area is:
+ int x0, y0;
+ GetViewStart(&x0,&y0);
+ int dx, dy;
+ GetScrollPixelsPerUnit(&dx, &dy);
+ x0 *= dx; y0 *= dy;
+
+ wxPoint offset(-x0+WXLO_XOFFSET, -y0+WXLO_YOFFSET);
+
+ if(m_CursorVisibility == -1)
+ m_CursorVisibility = 1;
+#ifdef WXLAYOUT_USE_CARET
+ if ( m_CursorVisibility == 1 )
+ GetCaret()->Show();
+#endif // WXLAYOUT_USE_CARET
+
+ if(m_CursorVisibility)
+ {
+ // draw a thick cursor for editable windows with focus
+ m_llist->DrawCursor(dc, m_HaveFocus && IsEditable(), offset);
+ }