Author: af
Date: Wed Apr 3 15:42:30 2013
New Revision: 1464076
URL: http://svn.apache.org/r1464076
Log:
i121994: Added style list panel.
Modified:
openoffice/branches/sidebar/main/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
openoffice/branches/sidebar/main/sfx2/inc/sfx2/templdlg.hxx
openoffice/branches/sidebar/main/sfx2/source/dialog/templdlg.cxx
openoffice/branches/sidebar/main/sfx2/source/inc/templdgi.hxx
openoffice/branches/sidebar/main/svx/source/sidebar/PanelFactory.cxx
Modified: openoffice/branches/sidebar/main/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu?rev=1464076&r1=1464075&r2=1464076&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
(original)
+++ openoffice/branches/sidebar/main/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
Wed Apr 3 15:42:30 2013
@@ -34,6 +34,9 @@
<prop oor:name="IconURL" oor:type="xs:string">
<value>private:graphicrepository/sfx2/res/symphony/sidebar-property-large.png</value>
</prop>
+ <prop oor:name="HighContrastIconURL" oor:type="xs:string">
+ <value>private:graphicrepository/sfx2/res/symphony/sidebar-property-large-hc.png</value>
+ </prop>
<prop oor:name="ContextList">
<value oor:separator=";">
any, any, visible ;
@@ -54,6 +57,9 @@
<prop oor:name="IconURL" oor:type="xs:string">
<value>private:graphicrepository/sfx2/res/symphony/sidebar-gallery-large.png</value>
</prop>
+ <prop oor:name="HighContrastIconURL" oor:type="xs:string">
+ <value>private:graphicrepository/sfx2/res/symphony/sidebar-gallery-large-hc.png</value>
+ </prop>
<prop oor:name="ContextList">
<value oor:separator=";">
DrawImpress, any, visible ;
@@ -74,6 +80,9 @@
<prop oor:name="IconURL" oor:type="xs:string">
<value>private:graphicrepository/sfx2/res/symphony/sidebar-template-large.png</value>
</prop>
+ <prop oor:name="HighContrastIconURL" oor:type="xs:string">
+ <value>private:graphicrepository/sfx2/res/symphony/sidebar-template-large-hc.png</value>
+ </prop>
<prop oor:name="ContextList">
<value oor:separator=";">
Impress, any, visible ;
@@ -94,6 +103,9 @@
<prop oor:name="IconURL" oor:type="xs:string">
<value>private:graphicrepository/sfx2/res/symphony/sidebar-animation-large.png</value>
</prop>
+ <prop oor:name="HighContrastIconURL" oor:type="xs:string">
+ <value>private:graphicrepository/sfx2/res/symphony/sidebar-animation-large-hc.png</value>
+ </prop>
<prop oor:name="ContextList">
<value oor:separator=";">
Impress, any, visible ;
@@ -114,6 +126,9 @@
<prop oor:name="IconURL" oor:type="xs:string">
<value>private:graphicrepository/sfx2/res/symphony/sidebar-transition-large.png</value>
</prop>
+ <prop oor:name="HighContrastIconURL" oor:type="xs:string">
+ <value>private:graphicrepository/sfx2/res/symphony/sidebar-transition-large-hc.png</value>
+ </prop>
<prop oor:name="ContextList">
<value oor:separator=";">
Impress, any, visible ;
@@ -134,6 +149,32 @@
<prop oor:name="IconURL" oor:type="xs:string">
<value>private:graphicrepository/sfx2/res/symphony/sidebar-navigator-large.png</value>
</prop>
+ <prop oor:name="HighContrastIconURL" oor:type="xs:string">
+ <value>private:graphicrepository/sfx2/res/symphony/sidebar-navigator-large-hc.png</value>
+ </prop>
+ <prop oor:name="ContextList">
+ <value oor:separator=";">
+ any, any, visible ;
+ </value>
+ </prop>
+ <prop oor:name="OrderIndex" oor:type="xs:int">
+ <value>150</value>
+ </prop>
+ </node>
+
+ <node oor:name="StyleListDeck" oor:op="replace">
+ <prop oor:name="Title" oor:type="xs:string">
+ <value xml:lang="en-US">Styles and Formatting</value>
+ </prop>
+ <prop oor:name="Id" oor:type="xs:string">
+ <value>StyleListDeck</value>
+ </prop>
+ <prop oor:name="IconURL" oor:type="xs:string">
+ <value>private:graphicrepository/sfx2/res/symphony/sidebar-style-large.png</value>
+ </prop>
+ <prop oor:name="HighContrastIconURL" oor:type="xs:string">
+ <value>private:graphicrepository/sfx2/res/symphony/sidebar-style-large-hc.png</value>
+ </prop>
<prop oor:name="ContextList">
<value oor:separator=";">
any, any, visible ;
@@ -865,6 +906,32 @@
</prop>
</node>
+ <node oor:name="StyleListPanel" oor:op="replace">
+ <prop oor:name="Title" oor:type="xs:string">
+ <value xml:lang="en-US">Styles and Formatting</value>
+ </prop>
+ <prop oor:name="TitleBarIsOptional" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="Id" oor:type="xs:string">
+ <value>StyleListPanel</value>
+ </prop>
+ <prop oor:name="DeckId" oor:type="xs:string">
+ <value>StyleListDeck</value>
+ </prop>
+ <prop oor:name="ContextList">
+ <value oor:separator=";">
+ any, any, visible ;
+ </value>
+ </prop>
+ <prop oor:name="ImplementationURL" oor:type="xs:string">
+ <value>private:resource/toolpanel/SvxPanelFactory/StyleListPanel</value>
+ </prop>
+ <prop oor:name="OrderIndex" oor:type="xs:int">
+ <value>100</value>
+ </prop>
+ </node>
+
</node>
</node>
</oor:component-data>
Modified: openoffice/branches/sidebar/main/sfx2/inc/sfx2/templdlg.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/inc/sfx2/templdlg.hxx?rev=1464076&r1=1464075&r2=1464076&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sfx2/inc/sfx2/templdlg.hxx (original)
+++ openoffice/branches/sidebar/main/sfx2/inc/sfx2/templdlg.hxx Wed Apr 3 15:42:30 2013
@@ -25,7 +25,7 @@
#include "sal/config.h"
#include "sfx2/dllapi.h"
-
+#include <vcl/ctrl.hxx>
#include <rsc/rscsfx.hxx>
#include <sfx2/dockwin.hxx>
@@ -94,5 +94,29 @@ public:
void SetParagraphFamily();
};
+// class SfxTemplatePanelControl -----------------------------------------
+
+class SFX2_DLLPUBLIC SfxTemplatePanelControl : public DockingWindow
+{
+public:
+ SfxTemplatePanelControl (SfxBindings* pBindings, Window* pParentWindow);
+ ~SfxTemplatePanelControl (void);
+
+ virtual void Update();
+ virtual void DataChanged( const DataChangedEvent& _rDCEvt );
+ virtual void Resize();
+ virtual SfxChildAlignment CheckAlignment( SfxChildAlignment, SfxChildAlignment );
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void FreeResource (void);
+
+ ISfxTemplateCommon* GetISfxTemplateCommon();
+ void SetParagraphFamily();
+
+private:
+ SfxTemplateDialog_Impl* pImpl;
+ SfxBindings* mpBindings;
+};
+
+
#endif
Modified: openoffice/branches/sidebar/main/sfx2/source/dialog/templdlg.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/source/dialog/templdlg.cxx?rev=1464076&r1=1464075&r2=1464076&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sfx2/source/dialog/templdlg.cxx (original)
+++ openoffice/branches/sidebar/main/sfx2/source/dialog/templdlg.cxx Wed Apr 3 15:42:30 2013
@@ -122,7 +122,7 @@ SfxTemplateDialog::SfxTemplateDialog
*/
: SfxDockingWindow( pBind, pCW, pParent, SfxResId(DLG_STYLE_DESIGNER) ),
- pImpl( new SfxTemplateDialog_Impl( pParent, pBind, this ) )
+ pImpl( new SfxTemplateDialog_Impl( pBind, this ) )
{
pImpl->updateNonFamilyImages();
@@ -402,6 +402,135 @@ void SfxTemplateDialogWrapper::SetParagr
static_cast< SfxTemplateDialog* >( GetWindow() )->SetParagraphFamily();
}
+
+
+//===== SfxTemplatePanelControl ===============================================
+
+SfxTemplatePanelControl::SfxTemplatePanelControl (
+ SfxBindings* pBindings,
+ Window* pParentWindow)
+ : DockingWindow(pParentWindow, SfxResId(DLG_STYLE_DESIGNER) ),
+ pImpl(new SfxTemplateDialog_Impl(pBindings, this)),
+ mpBindings(pBindings)
+{
+ OSL_ASSERT(mpBindings!=NULL);
+
+ pImpl->updateNonFamilyImages();
+}
+
+
+
+
+SfxTemplatePanelControl::~SfxTemplatePanelControl (void)
+{
+ delete pImpl;
+}
+
+
+
+
+ISfxTemplateCommon* SfxTemplatePanelControl::GetISfxTemplateCommon()
+{
+ return pImpl->GetISfxTemplateCommon();
+}
+
+
+
+
+void SfxTemplatePanelControl::SetParagraphFamily()
+{
+ // first select the paragraph family
+ pImpl->FamilySelect( SFX_STYLE_FAMILY_PARA );
+ // then select the automatic filter
+ pImpl->SetAutomaticFilter();
+}
+
+
+
+
+void SfxTemplatePanelControl::DataChanged( const DataChangedEvent& _rDCEvt )
+{
+ if ( ( DATACHANGED_SETTINGS == _rDCEvt.GetType() ) &&
+ ( 0 != ( SETTINGS_STYLE & _rDCEvt.GetFlags() ) ) )
+ {
+ pImpl->updateFamilyImages();
+ pImpl->updateNonFamilyImages();
+ }
+
+ DockingWindow::DataChanged( _rDCEvt );
+}
+
+
+
+
+void SfxTemplatePanelControl::Update()
+{
+ pImpl->Update();
+}
+
+
+
+
+void SfxTemplatePanelControl::Resize()
+{
+ if(pImpl)
+ pImpl->Resize();
+ DockingWindow::Resize();
+}
+
+
+void SfxTemplatePanelControl::FreeResource (void)
+{
+ DockingWindow::FreeResource();
+}
+
+
+SfxChildAlignment SfxTemplatePanelControl::CheckAlignment(SfxChildAlignment eActAlign,SfxChildAlignment
eAlign)
+{
+ switch (eAlign)
+ {
+ case SFX_ALIGN_TOP:
+ case SFX_ALIGN_HIGHESTTOP:
+ case SFX_ALIGN_LOWESTTOP:
+ case SFX_ALIGN_BOTTOM:
+ case SFX_ALIGN_LOWESTBOTTOM:
+ case SFX_ALIGN_HIGHESTBOTTOM:
+ return eActAlign;
+
+ case SFX_ALIGN_LEFT:
+ case SFX_ALIGN_RIGHT:
+ case SFX_ALIGN_FIRSTLEFT:
+ case SFX_ALIGN_LASTLEFT:
+ case SFX_ALIGN_FIRSTRIGHT:
+ case SFX_ALIGN_LASTRIGHT:
+ return eAlign;
+
+ default:
+ return eAlign;
+ }
+}
+
+
+void SfxTemplatePanelControl::StateChanged( StateChangedType nStateChange )
+{
+ if ( nStateChange == STATE_CHANGE_INITSHOW )
+ {
+ SfxViewFrame *pFrame = mpBindings->GetDispatcher_Impl()->GetFrame();
+ Window* pEditWin = pFrame->GetViewShell()->GetWindow();
+
+ Size aSize = pEditWin->GetSizePixel();
+ Point aPoint = pEditWin->OutputToScreenPixel( pEditWin->GetPosPixel() );
+ aPoint = GetParent()->ScreenToOutputPixel( aPoint );
+ Size aWinSize = GetSizePixel();
+ aPoint.X() += aSize.Width() - aWinSize.Width() - 20;
+ aPoint.Y() += aSize.Height() / 2 - aWinSize.Height() / 2;
+ // SetFloatingPos( aPoint );
+ }
+
+ DockingWindow::StateChanged( nStateChange );
+}
+
+
//=========================================================================
SV_DECL_PTRARR_DEL(ExpandedEntries, StringPtr,16,8)
SV_IMPL_PTRARR(ExpandedEntries, StringPtr)
@@ -737,7 +866,7 @@ SvLBoxEntry* FillBox_Impl(SvTreeListBox
// Konstruktor
-SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, SfxDockingWindow*
pW ) :
+SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, Window* pW,
bool ) :
aISfxTemplateCommon ( this ),
pBindings ( pB ),
@@ -785,7 +914,7 @@ SfxCommonTemplateDialog_Impl::SfxCommonT
//-------------------------------------------------------------------------
-SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, ModalDialog*
pW ) :
+SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, Window* pW )
:
aISfxTemplateCommon ( this ),
pBindings ( pB ),
@@ -2309,10 +2438,11 @@ PopupMenu* SfxCommonTemplateDialog_Impl:
// ------------------------------------------------------------------------
+
SfxTemplateDialog_Impl::SfxTemplateDialog_Impl(
- Window* /*pParent*/, SfxBindings* pB, SfxTemplateDialog* pDlgWindow ) :
+ SfxBindings* pB, SfxTemplateDialog* pDlgWindow ) :
- SfxCommonTemplateDialog_Impl( pB, pDlgWindow ),
+ SfxCommonTemplateDialog_Impl( pB, pDlgWindow, true ),
m_pFloat ( pDlgWindow ),
m_bZoomIn ( sal_False ),
@@ -2320,8 +2450,25 @@ SfxTemplateDialog_Impl::SfxTemplateDialo
m_aActionTbR ( pDlgWindow, SfxResId( TB_ACTION ) )
{
- pDlgWindow->FreeResource();
+ pDlgWindow->FreeResource();
+ Initialize();
+}
+
+SfxTemplateDialog_Impl::SfxTemplateDialog_Impl(
+ SfxBindings* pB, SfxTemplatePanelControl* pDlgWindow )
+ : SfxCommonTemplateDialog_Impl( pB, pDlgWindow, true ),
+ m_pFloat ( pDlgWindow ),
+ m_bZoomIn ( sal_False ),
+ m_aActionTbL ( pDlgWindow, this ),
+ m_aActionTbR ( pDlgWindow, SfxResId( TB_ACTION ) )
+{
+ pDlgWindow->FreeResource();
Initialize();
+}
+
+void SfxTemplateDialog_Impl::Initialize (void)
+{
+ SfxCommonTemplateDialog_Impl::Initialize();
m_aActionTbL.SetSelectHdl(LINK(this, SfxTemplateDialog_Impl, ToolBoxLSelect));
m_aActionTbR.SetSelectHdl(LINK(this, SfxTemplateDialog_Impl, ToolBoxRSelect));
@@ -2376,7 +2523,11 @@ void SfxTemplateDialog_Impl::updateFamil
return;
// let the families collection update the images
- sal_Bool bIsHighContrast = m_pFloat->GetSettings().GetStyleSettings().GetHighContrastMode();
+ sal_Bool bIsHighContrast;
+ if (m_pFloat != NULL)
+ bIsHighContrast = m_pFloat->GetSettings().GetStyleSettings().GetHighContrastMode();
+ else
+ bIsHighContrast = false;
pStyleFamilies->updateImages( *m_pStyleFamiliesId, bIsHighContrast ? BMP_COLOR_HIGHCONTRAST
: BMP_COLOR_NORMAL );
// and set the new images on our toolbox
@@ -2392,8 +2543,9 @@ void SfxTemplateDialog_Impl::updateFamil
// ------------------------------------------------------------------------
void SfxTemplateDialog_Impl::updateNonFamilyImages()
{
- m_aActionTbR.SetImageList( ImageList( SfxResId(
- m_pFloat->GetSettings().GetStyleSettings().GetHighContrastMode() ? IMG_LST_STYLE_DESIGNER_HC
+ if (m_pFloat != NULL)
+ m_aActionTbR.SetImageList( ImageList( SfxResId(
+ m_pFloat->GetSettings().GetStyleSettings().GetHighContrastMode() ?
IMG_LST_STYLE_DESIGNER_HC
: DLG_STYLE_DESIGNER ) ) );
}
@@ -2448,7 +2600,8 @@ void SfxTemplateDialog_Impl::LoadedFamil
// Die Groesse der Listboxen wird angepasst
void SfxTemplateDialog_Impl::Resize()
{
- FloatingWindow *pF = m_pFloat->GetFloatingWindow();
+ SfxDockingWindow* pDockingWindow = dynamic_cast<SfxDockingWindow*>(m_pFloat);
+ FloatingWindow *pF = pDockingWindow!=NULL ? pDockingWindow->GetFloatingWindow() : NULL;
if ( pF )
{
// if(pF->IsZoomedIn() && m_bZoomIn==sal_False)
@@ -2460,6 +2613,8 @@ void SfxTemplateDialog_Impl::Resize()
return;
}
+ if (m_pFloat == NULL)
+ return;
Size aDlgSize=m_pFloat->PixelToLogic(m_pFloat->GetOutputSizePixel());
Size aSizeATL=m_pFloat->PixelToLogic(m_aActionTbL.CalcWindowSizePixel());
Size aSizeATR=m_pFloat->PixelToLogic(m_aActionTbR.CalcWindowSizePixel());
@@ -2522,23 +2677,29 @@ void SfxTemplateDialog_Impl::Resize()
Size SfxTemplateDialog_Impl::GetMinOutputSizePixel()
{
- Size aSizeATL=m_pFloat->PixelToLogic(m_aActionTbL.CalcWindowSizePixel());
- Size aSizeATR=m_pFloat->PixelToLogic(m_aActionTbR.CalcWindowSizePixel());
- Size aMinSize=Size(
- aSizeATL.Width()+aSizeATR.Width()+
- 2*SFX_TEMPLDLG_HFRAME + SFX_TEMPLDLG_MIDHSPACE,
- 4*aSizeATL.Height()+2*SFX_TEMPLDLG_MIDVSPACE);
- return aMinSize;
+ if (m_pFloat != NULL)
+ {
+ Size aSizeATL=m_pFloat->PixelToLogic(m_aActionTbL.CalcWindowSizePixel());
+ Size aSizeATR=m_pFloat->PixelToLogic(m_aActionTbR.CalcWindowSizePixel());
+ Size aMinSize=Size(
+ aSizeATL.Width()+aSizeATR.Width()+
+ 2*SFX_TEMPLDLG_HFRAME + SFX_TEMPLDLG_MIDHSPACE,
+ 4*aSizeATL.Height()+2*SFX_TEMPLDLG_MIDVSPACE);
+ return aMinSize;
+ }
+ else
+ return Size(0,0);
}
//-------------------------------------------------------------------------
void SfxTemplateDialog_Impl::Command( const CommandEvent& rCEvt )
{
- if(COMMAND_CONTEXTMENU == rCEvt.GetCommand())
- ExecuteContextMenu_Impl( rCEvt.GetMousePosPixel(), m_pFloat );
- else
- m_pFloat->Command(rCEvt);
+ if (m_pFloat != NULL)
+ if(COMMAND_CONTEXTMENU == rCEvt.GetCommand())
+ ExecuteContextMenu_Impl( rCEvt.GetMousePosPixel(), m_pFloat );
+ else
+ m_pFloat->Command(rCEvt);
}
//-------------------------------------------------------------------------
Modified: openoffice/branches/sidebar/main/sfx2/source/inc/templdgi.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/source/inc/templdgi.hxx?rev=1464076&r1=1464075&r2=1464076&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sfx2/source/inc/templdgi.hxx (original)
+++ openoffice/branches/sidebar/main/sfx2/source/inc/templdgi.hxx Wed Apr 3 15:42:30 2013
@@ -241,8 +241,8 @@ protected:
public:
TYPEINFO();
- SfxCommonTemplateDialog_Impl( SfxBindings* pB, SfxDockingWindow* );
- SfxCommonTemplateDialog_Impl( SfxBindings* pB, ModalDialog* );
+ SfxCommonTemplateDialog_Impl( SfxBindings* pB, Window*, bool );
+ SfxCommonTemplateDialog_Impl( SfxBindings* pB, Window* );
~SfxCommonTemplateDialog_Impl();
DECL_LINK( MenuSelectHdl, Menu * );
@@ -297,9 +297,10 @@ private:
friend class SfxTemplateControllerItem;
friend class SfxTemplateDialogWrapper;
friend class DropToolBox_Impl;
+ friend class SfxTemplatePanelControl;
- SfxTemplateDialog* m_pFloat;
- sal_Bool m_bZoomIn;
+ Window* m_pFloat;
+ sal_Bool m_bZoomIn;
DropToolBox_Impl m_aActionTbL;
ToolBox m_aActionTbR;
@@ -330,8 +331,11 @@ public:
friend class SfxTemplateDialog;
TYPEINFO();
- SfxTemplateDialog_Impl( Window* pParent, SfxBindings*, SfxTemplateDialog* pWindow );
+ SfxTemplateDialog_Impl( SfxBindings*, SfxTemplateDialog* pDlgWindow );
+ SfxTemplateDialog_Impl( SfxBindings*, SfxTemplatePanelControl* pDlgWindow );
~SfxTemplateDialog_Impl();
+
+ void Initialize (void);
};
// class SfxTemplateCatalog_Impl -----------------------------------------
Modified: openoffice/branches/sidebar/main/svx/source/sidebar/PanelFactory.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/PanelFactory.cxx?rev=1464076&r1=1464075&r2=1464076&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/PanelFactory.cxx (original)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/PanelFactory.cxx Wed Apr 3 15:42:30
2013
@@ -34,6 +34,7 @@
#include "EmptyPanel.hxx"
#include <sfx2/sidebar/SidebarPanelBase.hxx>
#include <sfx2/sfxbasecontroller.hxx>
+#include <sfx2/templdlg.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <vcl/window.hxx>
#include <rtl/ref.hxx>
@@ -199,6 +200,15 @@ Reference<ui::XUIElement> SAL_CALL Panel
pGalleryControl,
ui::LayoutSize(300,-1,400));
}
+ else if (DoesResourceEndWith("/StyleListPanel"))
+ {
+ Window* pControl = new SfxTemplatePanelControl(pBindings, pParentWindow);
+ xElement = sfx2::sidebar::SidebarPanelBase::Create(
+ rsResourceURL,
+ xFrame,
+ pControl,
+ ui::LayoutSize(0,-1,-1));
+ }
else if (DoesResourceEndWith("/Debug_ColorPanel"))
{
ColorPanel* pPanel = new ColorPanel(pParentWindow);
|