summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
authorTomcsik Bence <tomcsikbence@gmail.com>2012-03-01 13:33:04 +0100
committerAndras Timar <atimar@suse.com>2012-03-01 13:35:11 +0100
commit491592015bc937a7fa46215e0ebaa0962456359b (patch)
tree834c7bfebdefa15dbc13f08fbc74f7c33d8ef88a /basctl
parent4022a834b55c8db787916f1a6301f1402b149e4c (diff)
implement scrolling with mouse in Object Catalog dialog
I edited out the ObjectTreeListBox class because BasicTreeListBox contains the scroll function and all the other functions that the ObjectTreeListBox uses.
Diffstat (limited to 'basctl')
-rw-r--r--basctl/source/basicide/bastype2.cxx27
-rw-r--r--basctl/source/basicide/bastype2.hxx1
-rw-r--r--basctl/source/basicide/objdlg.cxx39
-rw-r--r--basctl/source/basicide/objdlg.hxx14
4 files changed, 28 insertions, 53 deletions
diff --git a/basctl/source/basicide/bastype2.cxx b/basctl/source/basicide/bastype2.cxx
index abacd01b802c..3703776ef9ef 100644
--- a/basctl/source/basicide/bastype2.cxx
+++ b/basctl/source/basicide/bastype2.cxx
@@ -33,7 +33,9 @@
#include <ide_pch.hxx>
-
+#include "basidesh.hxx"
+#include "iderdll.hxx"
+#include "iderdll2.hxx"
#include <basidesh.hrc>
#include <bastypes.hxx>
#include <bastype2.hxx>
@@ -879,4 +881,27 @@ void BasicTreeListBox::SetCurrentEntry( BasicEntryDescriptor& rDesc )
SetCurEntry( pCurEntry );
}
+void BasicTreeListBox::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ SvTreeListBox::MouseButtonDown( rMEvt );
+ if ( rMEvt.IsLeft() && ( rMEvt.GetClicks() == 2 ) )
+ {
+ BasicEntryDescriptor aDesc( GetEntryDescriptor( GetCurEntry() ) );
+
+ if ( aDesc.GetType() == OBJ_TYPE_METHOD )
+ {
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::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 );
+ }
+ }
+ }
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basctl/source/basicide/bastype2.hxx b/basctl/source/basicide/bastype2.hxx
index 6f1162774de1..20aa7c5d8c69 100644
--- a/basctl/source/basicide/bastype2.hxx
+++ b/basctl/source/basicide/bastype2.hxx
@@ -157,6 +157,7 @@ private:
::basctl::DocumentEventNotifier m_aNotifier;
void SetEntryBitmaps( SvLBoxEntry * pEntry, const Image& rImage );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
protected:
virtual void RequestingChildren( SvLBoxEntry* pParent );
diff --git a/basctl/source/basicide/objdlg.cxx b/basctl/source/basicide/objdlg.cxx
index 59172c1f7d8b..14355bffa4d0 100644
--- a/basctl/source/basicide/objdlg.cxx
+++ b/basctl/source/basicide/objdlg.cxx
@@ -43,45 +43,6 @@
#include <vcl/taskpanelist.hxx>
#include <vcl/sound.hxx>
-ObjectTreeListBox::ObjectTreeListBox( Window* pParent, const ResId& rRes )
- : BasicTreeListBox( pParent, rRes )
-{
-}
-
-ObjectTreeListBox::~ObjectTreeListBox()
-{
-}
-
-void ObjectTreeListBox::Command( const CommandEvent& )
-{
-}
-
-void ObjectTreeListBox::MouseButtonDown( const MouseEvent& rMEvt )
-{
- BasicTreeListBox::MouseButtonDown( rMEvt );
-
- if ( rMEvt.IsLeft() && ( rMEvt.GetClicks() == 2 ) )
- {
- BasicEntryDescriptor aDesc( GetEntryDescriptor( GetCurEntry() ) );
-
- if ( aDesc.GetType() == OBJ_TYPE_METHOD )
- {
- BasicIDEShell* pIDEShell = BasicIDEGlobals::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 );
- }
- }
- }
-}
-
-
-
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 c919fbcb927d..df77a64e360c 100644
--- a/basctl/source/basicide/objdlg.hxx
+++ b/basctl/source/basicide/objdlg.hxx
@@ -39,18 +39,6 @@
class StarBASIC;
-class ObjectTreeListBox : public BasicTreeListBox
-{
-private:
-
- virtual void Command( const CommandEvent& rCEvt );
- virtual void MouseButtonDown( const MouseEvent& rMEvt );
-
-public:
- ObjectTreeListBox( Window* pParent, const ResId& rRes );
- ~ObjectTreeListBox();
-};
-
class ObjectCatalogToolBox_Impl: public ToolBox
{
public:
@@ -67,7 +55,7 @@ private:
class ObjectCatalog : public FloatingWindow
{
private:
- ObjectTreeListBox aMacroTreeList;
+ BasicTreeListBox aMacroTreeList;
ObjectCatalogToolBox_Impl aToolBox;
FixedText aMacroDescr;
Link aCancelHdl;