summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/browser/dataview.cxx
diff options
context:
space:
mode:
authorOcke Janssen <oj@openoffice.org>2002-02-19 12:48:54 +0000
committerOcke Janssen <oj@openoffice.org>2002-02-19 12:48:54 +0000
commit67f559b726ad55d8e7dc1157e5eb2778ead4a546 (patch)
treee0329293d2ad8e752a8b2a3e08094aa0c5a075c1 /dbaccess/source/ui/browser/dataview.cxx
parent4256d150713007c1c0e3f7f5dd2b7a9ec21f6780 (diff)
#90580# enable F6 key for components
Diffstat (limited to 'dbaccess/source/ui/browser/dataview.cxx')
-rw-r--r--dbaccess/source/ui/browser/dataview.cxx59
1 files changed, 55 insertions, 4 deletions
diff --git a/dbaccess/source/ui/browser/dataview.cxx b/dbaccess/source/ui/browser/dataview.cxx
index f334f6b3d0ae..6c33cb5d0cd6 100644
--- a/dbaccess/source/ui/browser/dataview.cxx
+++ b/dbaccess/source/ui/browser/dataview.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: dataview.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: oj $ $Date: 2001-12-10 11:36:09 $
+ * last change: $Author: oj $ $Date: 2002-02-19 13:48:54 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -80,9 +80,13 @@
#ifndef _SV_FIXED_HXX
#include <vcl/fixed.hxx>
#endif
+#ifndef DBAUI_ICONTROLLER_HXX
+#include "IController.hxx"
+#endif
using namespace dbaui;
using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
using namespace ::com::sun::star::lang;
//.........................................................................
@@ -114,13 +118,18 @@ namespace dbaui
DBG_NAME(ODataView)
// -------------------------------------------------------------------------
- ODataView::ODataView(Window* pParent, const Reference< XMultiServiceFactory >& _rFactory, WinBits nStyle)
+ ODataView::ODataView( Window* pParent,
+ IController* _pController,
+ const Reference< XMultiServiceFactory >& _rFactory,
+ WinBits nStyle)
:Window(pParent,nStyle)
- ,m_pToolBox(NULL)
+ ,m_pToolBox( NULL )
,m_xServiceFactory(_rFactory)
,m_pSeparator( NULL )
+ ,m_pController( _pController )
{
DBG_CTOR(ODataView,NULL);
+ OSL_ENSURE(m_pController,"Controller must be not NULL!");
}
// -------------------------------------------------------------------------
@@ -235,6 +244,48 @@ namespace dbaui
if(aSize.Width() > 0 && aSize.Height() > 0)
resizeAll( Rectangle( Point( 0, 0), GetSizePixel() ) );
}
+ // -----------------------------------------------------------------------------
+ long ODataView::PreNotify( NotifyEvent& rNEvt )
+ {
+ BOOL bHandled = FALSE;
+ switch (rNEvt.GetType())
+ {
+ case EVENT_KEYINPUT:
+ {
+ const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent();
+ const KeyCode& aKeyCode = pKeyEvent->GetKeyCode();
+ ::rtl::OUString sCommand;
+
+ if ( aKeyCode.IsMod1() )
+ {
+ switch ( pKeyEvent->GetKeyCode().GetCode() )
+ {
+ case KEY_S:
+ {
+ sCommand = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Save"));
+ bHandled = TRUE;
+ break;
+ }
+ case KEY_Z:
+ {
+ sCommand = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Undo"));
+ bHandled = TRUE;
+ break;
+ }
+ }
+ }
+ if ( bHandled )
+ {
+ URL aCommand;
+ aCommand.Complete = sCommand;
+ m_pController->executeChecked( aCommand );
+ }
+ }
+ break;
+ }
+ return bHandled ? 1L : Window::PreNotify(rNEvt);
+ }
+ // -----------------------------------------------------------------------------
//.........................................................................
} // namespace dbaui