summaryrefslogtreecommitdiff
path: root/basctl/source/basicide
diff options
context:
space:
mode:
Diffstat (limited to 'basctl/source/basicide')
-rw-r--r--basctl/source/basicide/objdlg.cxx41
-rw-r--r--basctl/source/basicide/objdlg.hxx2
2 files changed, 30 insertions, 13 deletions
diff --git a/basctl/source/basicide/objdlg.cxx b/basctl/source/basicide/objdlg.cxx
index b9c85ee1246b..a2431a686494 100644
--- a/basctl/source/basicide/objdlg.cxx
+++ b/basctl/source/basicide/objdlg.cxx
@@ -66,26 +66,41 @@ void ObjectTreeListBox::MouseButtonDown( const MouseEvent& rMEvt )
if ( rMEvt.IsLeft() && ( rMEvt.GetClicks() == 2 ) )
{
- BasicEntryDescriptor aDesc( GetEntryDescriptor( GetCurEntry() ) );
+ OpenCurrent();
+ }
+}
+
+void ObjectTreeListBox::KeyInput( const KeyEvent& rEvt )
+{
+ if ( rEvt.GetKeyCode() == KEY_RETURN && OpenCurrent() )
+ {
+ return;
+ }
+ BasicTreeListBox::KeyInput( rEvt );
+}
+
+bool ObjectTreeListBox::OpenCurrent()
+{
+ BasicEntryDescriptor aDesc( GetEntryDescriptor( GetCurEntry() ) );
- if ( aDesc.GetType() == OBJ_TYPE_METHOD )
+ if ( aDesc.GetType() == OBJ_TYPE_METHOD )
+ {
+ BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
+ SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
+ if( pDispatcher )
{
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
- SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
- SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
- if( pDispatcher )
- {
- SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, aDesc.GetDocument(), aDesc.GetLibName(), aDesc.GetName(),
- aDesc.GetMethodName(), ConvertType( aDesc.GetType() ) );
- pDispatcher->Execute( SID_BASICIDE_SHOWSBX,
- SFX_CALLMODE_SYNCHRON, &aSbxItem, 0L );
- }
+ SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, aDesc.GetDocument(), aDesc.GetLibName(), aDesc.GetName(),
+ aDesc.GetMethodName(), ConvertType( aDesc.GetType() ) );
+ pDispatcher->Execute( SID_BASICIDE_SHOWSBX,
+ SFX_CALLMODE_SYNCHRON, &aSbxItem, 0L );
+ return true;
}
}
+ return false;
}
-
ObjectCatalog::ObjectCatalog( Window * pParent )
:FloatingWindow( pParent, IDEResId( RID_BASICIDE_OBJCAT ) )
,aMacroTreeList( this, IDEResId( RID_TLB_MACROS ) )
diff --git a/basctl/source/basicide/objdlg.hxx b/basctl/source/basicide/objdlg.hxx
index feda77309b63..273b3239a77b 100644
--- a/basctl/source/basicide/objdlg.hxx
+++ b/basctl/source/basicide/objdlg.hxx
@@ -40,7 +40,9 @@ private:
virtual void Command( const CommandEvent& rCEvt );
virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void KeyInput( const KeyEvent& rEvt );
+ bool OpenCurrent();
public:
ObjectTreeListBox( Window* pParent, const ResId& rRes );
~ObjectTreeListBox();