diff --git a/basctl/inc/basidesh.hrc b/basctl/inc/basidesh.hrc index ed610dc84865..3a5287e4adcd 100644 --- a/basctl/inc/basidesh.hrc +++ b/basctl/inc/basidesh.hrc @@ -2,9 +2,9 @@ * * $RCSfile: basidesh.hrc,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: tbe $ $Date: 2001-08-03 15:13:19 $ + * last change: $Author: tbe $ $Date: 2001-10-17 10:10:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -96,6 +96,7 @@ #define RID_DLG_LIBS ( RID_BASICIDE_START + 40 ) #define RID_IMG_LOCKED ( RID_BASICIDE_START + 41 ) #define RID_DLG_NEWLIB ( RID_BASICIDE_START + 42 ) +#define RID_POPUP_DLGED ( RID_BASICIDE_START + 62 ) #define RID_STR_CANNOTCLOSE ( RID_BASICIDE_START + 13 ) #define RID_STR_IDENAME ( RID_BASICIDE_START + 14 ) diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx index b15007d7c446..5c9e97c1c045 100644 --- a/basctl/source/basicide/baside3.cxx +++ b/basctl/source/basicide/baside3.cxx @@ -2,9 +2,9 @@ * * $RCSfile: baside3.cxx,v $ * - * $Revision: 1.18 $ + * $Revision: 1.19 $ * - * last change: $Author: tbe $ $Date: 2001-09-25 09:08:45 $ + * last change: $Author: tbe $ $Date: 2001-10-17 10:12:29 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -94,6 +94,10 @@ #include #include +#ifndef _SVDVIEW_HXX +#include +#endif + #ifndef _COMPHELPER_PROCESSFACTORY_HXX_ #include #endif @@ -237,6 +241,17 @@ void DialogWindow::Command( const CommandEvent& rCEvt ) { HandleScrollCommand( rCEvt, GetHScrollBar(), GetVScrollBar() ); } + else if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU ) + { + Point aPos( rCEvt.IsMouseEvent() ? rCEvt.GetMousePosPixel() : Point(1,1) ); + BasicIDEShell* pIDEShell = IDE_DLL()->GetShell(); + SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL; + SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL; + if ( pDispatcher ) + { + pDispatcher->ExecutePopup( IDEResId(RID_POPUP_DLGED), this, &aPos ); + } + } else IDEBaseWindow::Command( rCEvt ); } @@ -282,13 +297,19 @@ void __EXPORT DialogWindow::GetState( SfxItemSet& rSet ) switch ( nWh ) { case SID_PASTE: + { + if ( !pEditor->IsPasteAllowed() ) + rSet.DisableItem( nWh ); + } break; case SID_CUT: case SID_COPY: case SID_DELETE: case SID_BACKSPACE: { - // Object selektiert? + // any object selected? + if ( !pEditor->GetView()->HasMarkedObj() ) + rSet.DisableItem( nWh ); } break; case SID_REDO: diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx index 558fc146ff5d..5c44dd394439 100644 --- a/basctl/source/basicide/basidesh.cxx +++ b/basctl/source/basicide/basidesh.cxx @@ -2,9 +2,9 @@ * * $RCSfile: basidesh.cxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * - * last change: $Author: tbe $ $Date: 2001-10-10 16:22:03 $ + * last change: $Author: tbe $ $Date: 2001-10-17 10:12:29 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -136,6 +136,7 @@ SFX_IMPL_INTERFACE( BasicIDEShell, SfxViewShell, IDEResId( RID_STR_IDENAME ) ) | SFX_VISIBILITY_FULLSCREEN | SFX_VISIBILITY_CLIENT, IDEResId( RID_BASICIDE_OBJECTBAR ) ); SFX_CHILDWINDOW_REGISTRATION( SID_SEARCH_DLG ); SFX_FEATURED_CHILDWINDOW_REGISTRATION(SID_SHOW_BROWSER, BASICIDE_UI_FEATURE_SHOW_BROWSER); + SFX_POPUPMENU_REGISTRATION( IDEResId( RID_POPUP_DLGED ) ); } diff --git a/basctl/source/basicide/basidesh.src b/basctl/source/basicide/basidesh.src index 214e32833466..d142d98c6872 100644 --- a/basctl/source/basicide/basidesh.src +++ b/basctl/source/basicide/basidesh.src @@ -2,9 +2,9 @@ * * $RCSfile: basidesh.src,v $ * - * $Revision: 1.41 $ + * $Revision: 1.42 $ * - * last change: $Author: kz $ $Date: 2001-10-11 21:15:36 $ + * last change: $Author: tbe $ $Date: 2001-10-17 10:12:29 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -2784,6 +2784,20 @@ Menu RID_POPUP_TABBAR }; }; }; +Menu RID_POPUP_DLGED +{ + DefaultItemId = SID_SHOW_BROWSER ; + ItemList = + { + MenuItem + { + Identifier = SID_SHOW_BROWSER ; + HelpId = SID_SHOW_BROWSER ; + Text = "Eigenschaften..." ; + Text [ ENGLISH ] = "Properties..." ; + }; + }; +}; ImageList RID_IMGLST_OBJECTS { ImageBitmap = Bitmap { FILE = "images.bmp" ; }; diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx index 16707c579f2c..16e8bd94d6d3 100644 --- a/basctl/source/dlged/dlged.cxx +++ b/basctl/source/dlged/dlged.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dlged.cxx,v $ * - * $Revision: 1.17 $ + * $Revision: 1.18 $ * - * last change: $Author: tbe $ $Date: 2001-09-25 11:06:10 $ + * last change: $Author: tbe $ $Date: 2001-10-17 10:14:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -83,6 +83,13 @@ #include "dlgedclip.hxx" #endif +#ifndef _BASCTL_DLGEDDEF_HXX +#include +#endif + +#include +#include + #ifndef _SV_SCRBAR_HXX #include #endif @@ -95,6 +102,22 @@ #include #endif +#ifndef _SFXVIEWFRM_HXX +#include +#endif + +#ifndef _SVX_SVXIDS_HRC +#include +#endif + +#ifndef _XMLSCRIPT_XML_HELPER_HXX_ +#include +#endif + +#ifndef _XMLSCRIPT_XMLDLG_IMEXP_HXX_ +#include +#endif + #ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_ #include #endif @@ -119,18 +142,6 @@ #include #endif -#ifndef _XMLSCRIPT_XML_HELPER_HXX_ -#include -#endif - -#ifndef _XMLSCRIPT_XMLDLG_IMEXP_HXX_ -#include -#endif - -#ifndef _BASCTL_DLGEDDEF_HXX -#include -#endif - using namespace comphelper; using namespace ::com::sun::star; @@ -827,6 +838,42 @@ void DlgEditor::Delete() //---------------------------------------------------------------------------- +BOOL DlgEditor::IsPasteAllowed() const +{ + BOOL bIsPasteAllowed = FALSE; + + // get clipboard + Reference< datatransfer::clipboard::XClipboard > xClipboard = GetWindow()->GetClipboard(); + if ( xClipboard.is() ) + { + // get clipboard content + const sal_uInt32 nRef = Application::ReleaseSolarMutex(); + Reference< datatransfer::XTransferable > xTransf = xClipboard->getContents(); + Application::AcquireSolarMutex( nRef ); + if ( xTransf.is() ) + { + if ( xTransf->isDataFlavorSupported( m_ClipboardDataFlavors[0] ) ) + { + bIsPasteAllowed = TRUE; + } + } + } + + return bIsPasteAllowed; +} + +//---------------------------------------------------------------------------- + +void DlgEditor::ShowProperties() +{ + BasicIDEShell* pIDEShell = IDE_DLL()->GetShell(); + SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL; + if ( pViewFrame && !pViewFrame->HasChildWindow( SID_SHOW_BROWSER ) ) + pViewFrame->ToggleChildWindow( SID_SHOW_BROWSER ); +} + +//---------------------------------------------------------------------------- + BOOL DlgEditor::IsModified() const { return pSdrModel->IsChanged() || bDialogModelChanged; diff --git a/basctl/source/dlged/dlgedfunc.cxx b/basctl/source/dlged/dlgedfunc.cxx index 5fd5e35fe41c..f450cb92c2ff 100644 --- a/basctl/source/dlged/dlgedfunc.cxx +++ b/basctl/source/dlged/dlgedfunc.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dlgedfunc.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: tbe $ $Date: 2001-04-10 15:14:45 $ + * last change: $Author: tbe $ $Date: 2001-10-17 10:14:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -83,6 +83,7 @@ #include #endif + //---------------------------------------------------------------------------- IMPL_LINK_INLINE_START( DlgEdFunc, ScrollTimeout, Timer *, pTimer ) @@ -230,18 +231,26 @@ BOOL DlgEdFuncInsert::MouseButtonDown( const MouseEvent& rMEvt ) #endif pWindow->CaptureMouse(); - SdrHdl* pHdl = pView->HitHandle(aPos, *pWindow); + if ( rMEvt.IsLeft() && rMEvt.GetClicks() == 1 ) + { + SdrHdl* pHdl = pView->HitHandle(aPos, *pWindow); - // if selected object was hit, drag object - if ( pHdl!=NULL || pView->IsMarkedHit(aPos, nHitLog) ) - pView->BegDragObj(aPos, (OutputDevice*) NULL, pHdl, nDrgLog); - else - if ( pView->HasMarkedObj() ) - pView->UnmarkAll(); + // if selected object was hit, drag object + if ( pHdl!=NULL || pView->IsMarkedHit(aPos, nHitLog) ) + pView->BegDragObj(aPos, (OutputDevice*) NULL, pHdl, nDrgLog); + else if ( pView->HasMarkedObj() ) + pView->UnmarkAll(); - // if no action, create object - if ( rMEvt.IsLeft() && !pView->IsAction() ) - pView->BegCreateObj(aPos); + // if no action, create object + if ( !pView->IsAction() ) + pView->BegCreateObj(aPos); + } + else if ( rMEvt.IsLeft() && rMEvt.GetClicks() == 2 ) + { + // if object was hit, show property browser + if ( pView->IsMarkedHit(aPos, nHitLog) ) + pParent->ShowProperties(); + } return TRUE; } @@ -349,7 +358,7 @@ BOOL DlgEdFuncSelect::MouseButtonDown( const MouseEvent& rMEvt ) USHORT nHitLog = USHORT ( pWindow->PixelToLogic(Size(3,0)).Width() ); Point aMDPos = pWindow->PixelToLogic( rMEvt.GetPosPixel() ); - if ( rMEvt.IsLeft() ) + if ( rMEvt.IsLeft() && rMEvt.GetClicks() == 1 ) { #ifdef MAC pWindow->GrabFocus(); @@ -393,6 +402,12 @@ BOOL DlgEdFuncSelect::MouseButtonDown( const MouseEvent& rMEvt ) } } } + else if ( rMEvt.IsLeft() && rMEvt.GetClicks() == 2 ) + { + // if object was hit, show property browser + if ( pView->IsMarkedHit(aMDPos, nHitLog) ) + pParent->ShowProperties(); + } return TRUE; } diff --git a/basctl/source/inc/dlged.hxx b/basctl/source/inc/dlged.hxx index 0a2e49902f22..5745a2d0981e 100644 --- a/basctl/source/inc/dlged.hxx +++ b/basctl/source/inc/dlged.hxx @@ -2,9 +2,9 @@ * * $RCSfile: dlged.hxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: tbe $ $Date: 2001-09-25 11:05:22 $ + * last change: $Author: tbe $ $Date: 2001-10-17 10:17:18 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -179,6 +179,9 @@ public: void Copy(); void Paste(); void Delete(); + BOOL IsPasteAllowed() const; + + void ShowProperties(); void PrintData( Printer*, const String& rTitle ); // not working yet };