- if ( u )
- {
- u->DecRef();
- u = NULL;
- }
- }
- else if(eventId == WXLOWIN_MENU_LCLICK)
- {
- // always move cursor to mouse click:
- m_llist->MoveCursorTo(cursorPos);
+ 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();
+ m_Selecting = false;
+ 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;
+#ifdef WXLAYOUT_USE_CARET
+ if ( m_CursorVisibility == 1 )
+ GetCaret()->Show();
+#endif // WXLAYOUT_USE_CARET