Tag: cws_dev300_dba30d
User: fs      
Date: 2008-05-28 21:44:49+0000
Modified:
   dba/dbaccess/source/ui/browser/dataview.cxx

Log:
 #i84016# PreNotify: allow the controller to intercept key events and mouse 
clicks

File Changes:

Directory: /dba/dbaccess/source/ui/browser/
===========================================

File [changed]: dataview.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/browser/dataview.cxx?r1=1.22&r2=1.22.30.1
Delta lines:  +16 -12
---------------------
--- dataview.cxx        2008-04-10 14:04:54+0000        1.22
+++ dataview.cxx        2008-05-28 21:44:46+0000        1.22.30.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: dataview.cxx,v $
- * $Revision: 1.22 $
+ * $Revision: 1.22.30.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -190,23 +190,27 @@
                resizeAll( Rectangle( Point( 0, 0), GetSizePixel() ) );
        }
        // 
-----------------------------------------------------------------------------
-       long ODataView::PreNotify( NotifyEvent& rNEvt )
+       long ODataView::PreNotify( NotifyEvent& _rNEvt )
        {
-               BOOL bHandled = FALSE;
-               switch (rNEvt.GetType())
+               bool bHandled = false;
+               switch ( _rNEvt.GetType() )
                {
                        case EVENT_KEYINPUT:
                        {
-                               const KeyEvent* pKeyEvent =     
rNEvt.GetKeyEvent();
+                               const KeyEvent* pKeyEvent =     
_rNEvt.GetKeyEvent();
                                const KeyCode& aKeyCode = 
pKeyEvent->GetKeyCode();
-                               if ( m_pAccel.get() )
-                               {
-                                       bHandled = m_pAccel->execute(aKeyCode);
-                               } 
-                       }
+                               if ( m_pAccel.get() && m_pAccel->execute( 
aKeyCode ) )
+                    // the accelerator consumed the event
+                    return 1L;
+                       }
+            // NO break
+            case EVENT_KEYUP:
+            case EVENT_MOUSEBUTTONDOWN:
+            case EVENT_MOUSEBUTTONUP:
+                bHandled = m_pController->interceptUserInput( _rNEvt );
                        break;
                }
-               return bHandled ? 1L : Window::PreNotify(rNEvt);
+               return bHandled ? 1L : Window::PreNotify( _rNEvt );
        }
        // 
-----------------------------------------------------------------------------
        void ODataView::StateChanged( StateChangedType nType )




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to