summaryrefslogtreecommitdiff
path: root/sfx2/source/inet/inettbc.cxx
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2005-03-23 15:25:21 +0000
committerVladimir Glazounov <vg@openoffice.org>2005-03-23 15:25:21 +0000
commit33c0da8e8c61ee4e04a24fc4d4ff5d1a777e4ec5 (patch)
tree72f15cbd2c7482b0c014e02e2581492a076b9285 /sfx2/source/inet/inettbc.cxx
parent84d80badd70fd3a1b3d12ef011f8ce4e04a6dda8 (diff)
INTEGRATION: CWS fwkfinal2 (1.28.94); FILE MERGED
2005/03/15 11:57:04 cd 1.28.94.1: #i42261# Support keyboard shortcuts in url box
Diffstat (limited to 'sfx2/source/inet/inettbc.cxx')
-rw-r--r--sfx2/source/inet/inettbc.cxx34
1 files changed, 31 insertions, 3 deletions
diff --git a/sfx2/source/inet/inettbc.cxx b/sfx2/source/inet/inettbc.cxx
index 046988648282..c8a170dfbcc7 100644
--- a/sfx2/source/inet/inettbc.cxx
+++ b/sfx2/source/inet/inettbc.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: inettbc.cxx,v $
*
- * $Revision: 1.28 $
+ * $Revision: 1.29 $
*
- * last change: $Author: rt $ $Date: 2005-01-27 10:18:43 $
+ * last change: $Author: vg $ $Date: 2005-03-23 16:25:21 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -109,6 +109,7 @@
#include <svtools/inettbc.hxx>
#include <unotools/localfilehelper.hxx>
+#include <comphelper/processfactory.hxx>
#include "sfx.hrc"
#include "dispatch.hxx"
@@ -132,11 +133,17 @@ using namespace ::com::sun::star::task;
SFX_IMPL_TOOLBOX_CONTROL(SfxURLToolBoxControl_Impl,SfxStringItem)
SfxURLToolBoxControl_Impl::SfxURLToolBoxControl_Impl( USHORT nSlotId, USHORT nId, ToolBox& rBox )
- : SfxToolBoxControl( nSlotId, nId, rBox )
+ : SfxToolBoxControl( nSlotId, nId, rBox ),
+ pAccExec( 0 )
{
addStatusListener( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:CurrentURL" )));
}
+SfxURLToolBoxControl_Impl::~SfxURLToolBoxControl_Impl()
+{
+ delete pAccExec;
+}
+
SvtURLBox* SfxURLToolBoxControl_Impl::GetURLBox() const
{
return (SvtURLBox*)GetToolBox().GetItemWindow( GetId() );
@@ -223,6 +230,11 @@ Window* SfxURLToolBoxControl_Impl::CreateItemWindow( Window* pParent )
SvtURLBox* pURLBox = new SvtURLBox( pParent );
pURLBox->SetOpenHdl( LINK( this, SfxURLToolBoxControl_Impl, OpenHdl ) );
pURLBox->SetSelectHdl( LINK( this, SfxURLToolBoxControl_Impl, SelectHdl ) );
+
+ pURLBox->AddEventListener( LINK( this, SfxURLToolBoxControl_Impl, WindowEventListener ));
+ pAccExec = ::svt::AcceleratorExecute::createAcceleratorHelper();
+ pAccExec->init(::comphelper::getProcessServiceFactory(), getFrameInterface() );
+
return pURLBox;
}
@@ -262,6 +274,22 @@ IMPL_LINK( SfxURLToolBoxControl_Impl, OpenHdl, void*, pVoid )
return 1L;
}
+IMPL_LINK( SfxURLToolBoxControl_Impl, WindowEventListener, VclSimpleEvent*, pEvent )
+{
+ if ( pAccExec &&
+ pEvent &&
+ pEvent->ISA( VclWindowEvent ) &&
+ ( pEvent->GetId() == VCLEVENT_WINDOW_KEYINPUT ))
+ {
+ VclWindowEvent* pWinEvent = static_cast< VclWindowEvent* >( pEvent );
+ KeyEvent* pKeyEvent = static_cast< KeyEvent* >( pWinEvent->GetData() );
+
+ pAccExec->execute( pKeyEvent->GetKeyCode() );
+ }
+
+ return 1;
+}
+
//***************************************************************************
void SfxURLToolBoxControl_Impl::StateChanged