summaryrefslogtreecommitdiff
path: root/sd/source/ui/dlg
diff options
context:
space:
mode:
authorChristian Lippka <christian.lippka@sun.com>2009-12-08 17:33:39 +0100
committerChristian Lippka <christian.lippka@sun.com>2009-12-08 17:33:39 +0100
commitdada72080460ab3a1bf4228a38454339b1d5f204 (patch)
treec9d9fc732e58f1e7ebab52a2452510ca01310030 /sd/source/ui/dlg
parentf0efe6abc4156df0834f8e6953a8bcee9ead9506 (diff)
renaissance01: #i107213# more work on layout popup
Diffstat (limited to 'sd/source/ui/dlg')
-rw-r--r--sd/source/ui/dlg/layoutdialog.cxx61
-rw-r--r--sd/source/ui/dlg/layoutdialog.hrc2
-rw-r--r--sd/source/ui/dlg/layoutdialog.src5
3 files changed, 51 insertions, 17 deletions
diff --git a/sd/source/ui/dlg/layoutdialog.cxx b/sd/source/ui/dlg/layoutdialog.cxx
index 6a1a4db12413..c431db29d651 100644
--- a/sd/source/ui/dlg/layoutdialog.cxx
+++ b/sd/source/ui/dlg/layoutdialog.cxx
@@ -31,6 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sd.hxx"
+#include <com/sun/star/frame/XFrame.hpp>
#include "layoutdialog.hxx"
#include <sfx2/dockwin.hxx>
#include "app.hrc"
@@ -46,6 +47,8 @@ SFX_IMPL_DOCKINGWINDOW(LayoutDialogChildWindow, SID_LAYOUT_DIALOG_WIN)
#include <vcl/image.hxx>
#include <sfx2/dispatch.hxx>
+#include <sfx2/imagemgr.hxx>
+#include <sfx2/tbxctrl.hxx>
#include <svtools/languageoptions.hxx>
#include <svtools/valueset.hxx>
@@ -69,14 +72,15 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::text;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::frame;
namespace sd {
///
-class SdLayoutDialogContent : public SfxDockingWindow
+class SdLayoutDialogContent : public SfxPopupWindow
{
public:
- SdLayoutDialogContent( SfxBindings* pBindings, SfxChildWindow *pCW, ::Window* pParent, ViewShellBase& rBase);
+ SdLayoutDialogContent( ViewShellBase& rBase, Window* pParent);
virtual ~SdLayoutDialogContent();
protected:
@@ -97,14 +101,26 @@ LayoutDialogChildWindow::LayoutDialogChildWindow(::Window* _pParent, USHORT nId,
: SfxChildWindow (_pParent, nId)
{
ViewShellBase& rBase (*ViewShellBase::GetViewShellBase(pBindings->GetDispatcher()->GetFrame()));
- SdLayoutDialogContent* pContent = new SdLayoutDialogContent (pBindings, this, _pParent, rBase);
+ SdLayoutDialogContent* pContent = new SdLayoutDialogContent (rBase, _pParent);
pWindow = pContent;
eChildAlignment = SFX_ALIGN_NOALIGNMENT;
- pContent->Initialize(pInfo);
+// pContent->Initialize(pInfo);
}
LayoutDialogChildWindow::~LayoutDialogChildWindow (void)
{
+
+}
+
+SfxPopupWindow* LayoutDialogChildWindow::createChildWindow(SfxViewFrame& rViewFrame, ::Window* pParent)
+{
+ SfxPopupWindow* pWin = 0;
+ sd::ViewShellBase* pViewShellBase = sd::ViewShellBase::GetViewShellBase( &rViewFrame );
+ if( pViewShellBase )
+ {
+ pWin = new SdLayoutDialogContent( *pViewShellBase, pParent );
+ }
+ return pWin;
}
// -----------------------------------------------------------------------
@@ -143,11 +159,15 @@ static snewfoil_value_info standard[] =
// -----------------------------------------------------------------------
-SdLayoutDialogContent::SdLayoutDialogContent( SfxBindings* pInBindings, SfxChildWindow *pCW, Window* pParent, ViewShellBase& rBase)
-: SfxDockingWindow(pInBindings, pCW, pParent, SdResId( FLT_WIN_LAYOUT_DIALOG ))
+SdLayoutDialogContent::SdLayoutDialogContent( ViewShellBase& rBase, Window* pParent )
+: SfxPopupWindow(SID_ASSIGN_LAYOUT, rBase.GetFrame()->GetTopFrame()->GetFrameInterface(), pParent, SdResId( FLT_WIN_LAYOUT_DIALOG ))
, meCurrentLayout( AUTOLAYOUT_NONE )
, mrBase(rBase)
{
+ String sResetSlideLayout( SdResId( STR_RESET_LAYOUT ) );
+
+ FreeResource();
+
// SetHelpId( HID_POPUP_LAYOUT );
const Color aMenuColor( GetSettings().GetStyleSettings().GetMenuColor() );
@@ -194,7 +214,17 @@ SdLayoutDialogContent::SdLayoutDialogContent( SfxBindings* pInBindings, SfxChild
mpToolbarMenu->appendEntry( -1, String( SdResId( STR_UNDO_MODIFY_PAGE ) ) );
mpToolbarMenu->appendEntry( 0, mpLayoutSet );
mpToolbarMenu->appendSeparator();
- mpToolbarMenu->appendEntry( 1, String( RTL_CONSTASCII_USTRINGPARAM("Reset Slide Layout") ));
+
+ Reference< XFrame > xFrame( GetFrame(), UNO_QUERY );
+ if( xFrame.is() )
+ {
+ Image aImg( ::GetImage( xFrame, OUString( RTL_CONSTASCII_USTRINGPARAM(".uno:Undo") ), FALSE, FALSE ) );
+ mpToolbarMenu->appendEntry( 1, sResetSlideLayout, aImg);
+ }
+ else
+ {
+ mpToolbarMenu->appendEntry( 1, sResetSlideLayout);
+ }
SetOutputSizePixel( mpToolbarMenu->getMenuSize() );
mpToolbarMenu->SetOutputSizePixel( GetOutputSizePixel() );
@@ -202,13 +232,15 @@ SdLayoutDialogContent::SdLayoutDialogContent( SfxBindings* pInBindings, SfxChild
mpToolbarMenu->Show();
// AddStatusListener( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:AssignLayout" )));
+}
- FreeResource();
+SdLayoutDialogContent::~SdLayoutDialogContent()
+{
}
void SdLayoutDialogContent::Resize (void)
{
- SfxDockingWindow::Resize();
+ SfxPopupWindow::Resize();
mpToolbarMenu->SetPosSizePixel( Point(0,0), GetSizePixel() );
}
@@ -247,21 +279,16 @@ void SdLayoutDialogContent::StateChanged( USHORT nSID, SfxItemState eState, cons
IMPL_LINK( SdLayoutDialogContent, SelectHdl, void *, pControl )
{
-/*
if ( IsInPopupMode() )
EndPopupMode();
+/*
AutoLayout eLayout = meCurrentLayout;
if( pControl == mpLayoutSet )
eLayout = static_cast< AutoLayout >(mpLayoutSet->GetSelectItemId()-1);
- const rtl::OUString aCommand( RTL_CONSTASCII_USTRINGPARAM( ".uno:AssignLayout" ));
-
- Sequence< PropertyValue > aArgs( 1 );
- aArgs[0].Name = OUString( RTL_CONSTASCII_USTRINGPARAM("WhatLayout") );
- aArgs[0].Value <<= static_cast<sal_Int32>(eLayout);
-
- SfxToolBoxControl::Dispatch( Reference< ::com::sun::star::frame::XDispatchProvider >( mxFrame->getController(), UNO_QUERY ), aCommand, aArgs );
+ const SfxUInt32Item aItem(ID_VAL_WHATLAYOUT, eLayout);
+ GetBindings().GetDispatcher()->Execute(SID_ASSIGN_LAYOUT,SFX_CALLMODE_ASYNCHRON,&aItem,0);
*/
return 0;
}
diff --git a/sd/source/ui/dlg/layoutdialog.hrc b/sd/source/ui/dlg/layoutdialog.hrc
index 6fd97b2d09cc..c53f5342f2b5 100644
--- a/sd/source/ui/dlg/layoutdialog.hrc
+++ b/sd/source/ui/dlg/layoutdialog.hrc
@@ -29,3 +29,5 @@
************************************************************************/
#define FLT_WIN_LAYOUT_DIALOG 795
+
+#define STR_RESET_LAYOUT 1
diff --git a/sd/source/ui/dlg/layoutdialog.src b/sd/source/ui/dlg/layoutdialog.src
index 21477e8db993..a9a3d315faf0 100644
--- a/sd/source/ui/dlg/layoutdialog.src
+++ b/sd/source/ui/dlg/layoutdialog.src
@@ -44,5 +44,10 @@ DockingWindow FLT_WIN_LAYOUT_DIALOG
Zoomable = TRUE ;
Dockable = TRUE ;
EnableResizing = TRUE ;
+
+ String STR_RESET_LAYOUT
+ {
+ Text[ en-US ] = "Reset Slide Layout";
+ };
};