Update of /cvsroot/mahogany/M/src/modules
In directory sc8-pr-cvs1:/tmp/cvs-serv26065/src/modules

Modified Files:
        TextViewer.cpp 
Log Message:
ignore clicks below attachments in the text viewer

Index: TextViewer.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/modules/TextViewer.cpp,v
retrieving revision 1.50
retrieving revision 1.51
diff -b -u -2 -r1.50 -r1.51
--- TextViewer.cpp      3 Oct 2003 15:32:09 -0000       1.50
+++ TextViewer.cpp      11 Oct 2003 23:04:32 -0000      1.51
@@ -422,6 +422,19 @@
    POINTL ptl = { pt.x, pt.y };
 
-   // can't use SendMessage because it's a class name!
-   return ::SendMessageA(GetHwnd(), EM_CHARFROMPOS, 0, (LPARAM)&ptl);
+   // can't use SendMessage because it's a class name for us and so we had to
+   // #undef it before...
+   long pos = ::SendMessageA(GetHwnd(), EM_CHARFROMPOS, 0, (LPARAM)&ptl);
+
+   // EM_CHARFROMPOS lies when the point is below the last line: it simply
+   // ignroes the y coord then, so double check that we really clicked where it
+   // pretends we did
+   ::SendMessageA(GetHwnd(), EM_POSFROMCHAR, (LPARAM)&ptl, pos);
+   if ( pt.y > ptl.y + GetCharHeight() )
+   {
+      // the click was really below the last line, there is nothing there
+      pos = -1;
+   }
+
+   return pos;
 }
 
@@ -436,5 +449,5 @@
 #endif // __WXMSW__/!__WXMSW__
 
-   if ( !ProcessMouseEvent(event, pos) )
+   if ( pos == -1 || !ProcessMouseEvent(event, pos) )
    {
       event.Skip();



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to