[Libreoffice-commits] core.git: 6 commits - sd/source sd/uiconfig sd/UIConfig_simpress.mk
Katarina Behrens
bubli at bubli.org
Wed Jul 31 12:02:58 PDT 2013
sd/UIConfig_simpress.mk | 1
sd/source/ui/animations/CustomAnimationCreateDialog.cxx | 4
sd/source/ui/animations/CustomAnimationDialog.cxx | 14
sd/source/ui/animations/CustomAnimationDialog.hxx | 1
sd/source/ui/animations/CustomAnimationList.cxx | 12
sd/source/ui/animations/CustomAnimationList.hxx | 6
sd/source/ui/animations/CustomAnimationPane.cxx | 337 +----------
sd/source/ui/animations/CustomAnimationPane.hxx | 17
sd/source/ui/sidebar/CustomAnimationPanel.cxx | 14
sd/source/ui/sidebar/CustomAnimationPanel.hxx | 8
sd/source/ui/sidebar/PanelFactory.cxx | 2
sd/source/ui/toolpanel/controls/CustomAnimationPanel.cxx | 5
sd/uiconfig/simpress/ui/customanimationspanel.ui | 425 +++++++++++++++
13 files changed, 529 insertions(+), 317 deletions(-)
New commits:
commit 83ff6c0f4101fe4f25c2b4a58c70b40de8cc2ff2
Author: Katarina Behrens <bubli at bubli.org>
Date: Wed Jul 31 20:54:00 2013 +0200
sidebar: fix widget positioning when replacing controls
by introducing placeholder VclHBox
Sadly, I've been unable to do away w/ the original ugly code
that draws replacement widget over the original one :(
(SetPosPixel, SetZOrder etc.)
It is still being done, but now in correct position on screen.
Change-Id: I51bd1f411621081b42da25b52f1a4d6b56c1e7f6
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx
index 347f960..10bb39d 100644
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -174,6 +174,7 @@ CustomAnimationPane::CustomAnimationPane( ::Window* pParent, ViewShellBase& rBas
get(mpFTStart, "start_effect");
get(mpLBStart, "start_effect_list");
get(mpFTProperty, "effect_property");
+ get(mpPlaceholderBox, "placeholder");
get(mpLBProperty, "effect_property_list");
get(mpPBPropertyMore, "more_properties");
@@ -538,7 +539,7 @@ void CustomAnimationPane::updateControls()
pSubControl = mpLBProperty->getSubControl();
if( !pSubControl || (pSubControl->getControlType() != mnPropertyType) )
{
- pSubControl = PropertySubControl::create( mnPropertyType, this, aValue, pEffect->getPresetId(), LINK( this, CustomAnimationPane, implPropertyHdl ) );
+ pSubControl = PropertySubControl::create( mnPropertyType, mpPlaceholderBox, aValue, pEffect->getPresetId(), LINK( this, CustomAnimationPane, implPropertyHdl ) );
mpLBProperty->setSubControl( pSubControl );
}
else
diff --git a/sd/source/ui/animations/CustomAnimationPane.hxx b/sd/source/ui/animations/CustomAnimationPane.hxx
index ed8cc56..e00d3c5 100644
--- a/sd/source/ui/animations/CustomAnimationPane.hxx
+++ b/sd/source/ui/animations/CustomAnimationPane.hxx
@@ -23,6 +23,7 @@
#include <com/sun/star/drawing/XDrawView.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <vcl/dialog.hxx>
+#include <vcl/layout.hxx>
#include <svx/sidebar/PanelLayout.hxx>
#include <sfx2/sidebar/ControlFactory.hxx>
#include "CustomAnimationPreset.hxx"
@@ -133,6 +134,7 @@ private:
FixedText* mpFTStart;
ListBox* mpLBStart;
FixedText* mpFTProperty;
+ VclHBox* mpPlaceholderBox;
PropertyControl* mpLBProperty;
PushButton* mpPBPropertyMore;
FixedText* mpFTSpeed;
diff --git a/sd/uiconfig/simpress/ui/customanimationspanel.ui b/sd/uiconfig/simpress/ui/customanimationspanel.ui
index 81f6b5e..eb887ef 100644
--- a/sd/uiconfig/simpress/ui/customanimationspanel.ui
+++ b/sd/uiconfig/simpress/ui/customanimationspanel.ui
@@ -171,11 +171,18 @@
</packing>
</child>
<child>
- <object class="sdlo-PropertyControl" id="effect_property_list">
+ <object class="GtkBox" id="placeholder">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <property name="vexpand">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="sdlo-PropertyControl" id="effect_property_list">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ </object>
+ </child>
</object>
<packing>
<property name="left_attach">1</property>
commit a90c2e73ea4788ee58e9dab2b0f44467306d67dd
Author: Katarina Behrens <bubli at bubli.org>
Date: Tue Jun 25 20:53:38 2013 +0200
sidebar: prevent segfault caused by double delete
VclBuilder cleans up after itself, no need to delete those widgets
here
Change-Id: I7ed504f8721587264bc24660359e4491a83f3ea1
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx
index 40be7b1..347f960 100644
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -246,23 +246,6 @@ CustomAnimationPane::~CustomAnimationPane()
for( aIter = aTags.begin(); aIter != aTags.end(); ++aIter )
(*aIter)->Dispose();
- delete mpPBAddEffect;
- delete mpPBChangeEffect;
- delete mpPBRemoveEffect;
- delete mpFTStart;
- delete mpLBStart;
- delete mpFTProperty;
- delete mpLBProperty;
- delete mpPBPropertyMore;
- delete mpFTSpeed;
- delete mpCBSpeed;
- delete mpCustomAnimationList;
- delete mpFTChangeOrder;
- delete mpPBMoveUp;
- delete mpPBMoveDown;
- delete mpPBPlay;
- delete mpPBSlideShow;
- delete mpCBAutoPreview;
}
void CustomAnimationPane::addUndo()
commit 7d2330b6d25617631cb536950151aee0b8b306a6
Author: Katarina Behrens <bubli at bubli.org>
Date: Wed Jun 19 23:28:15 2013 +0200
sidebar: Removed overloaded function & adjusted toolbar code
Change-Id: I491e621a2a8d10ed1743cc8802816c3910784b26
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx
index 9c5e36d..40be7b1 100644
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -2319,25 +2319,6 @@ void CustomAnimationPane::updatePathFromMotionPathTag( const rtl::Reference< Mot
// ====================================================================
-::Window * createCustomAnimationPanel( ::Window* pParent, ViewShellBase& rBase )
-{
- DialogListBox* pWindow = 0;
-
- DrawDocShell* pDocSh = rBase.GetDocShell();
- if( pDocSh )
- {
- pWindow = new DialogListBox( pParent, WB_CLIPCHILDREN|WB_TABSTOP|WB_AUTOHSCROLL );
- const Size aMinSize( pWindow->LogicToPixel( Size( 80, 256 ), MAP_APPFONT ) );
- pWindow->SetSizePixel(aMinSize);
- pWindow->SetBackground(Wallpaper(Color(COL_BLUE)));
-
- ::Window* pPaneWindow = new CustomAnimationPane( pWindow, rBase, NULL, aMinSize );
- pWindow->SetChildWindow( pPaneWindow, aMinSize );
- pWindow->SetText( pPaneWindow->GetText() );
- }
-
- return pWindow;
-}
::Window * createCustomAnimationPanel( ::Window* pParent, ViewShellBase& rBase, const cssu::Reference<css::frame::XFrame>& rxFrame )
{
diff --git a/sd/source/ui/toolpanel/controls/CustomAnimationPanel.cxx b/sd/source/ui/toolpanel/controls/CustomAnimationPanel.cxx
index 73af7f4..d090708 100644
--- a/sd/source/ui/toolpanel/controls/CustomAnimationPanel.cxx
+++ b/sd/source/ui/toolpanel/controls/CustomAnimationPanel.cxx
@@ -30,7 +30,8 @@ namespace sd
{
class ViewShellBase;
- extern ::Window * createCustomAnimationPanel( ::Window* pParent, ViewShellBase& rBase );
+ extern ::Window * createCustomAnimationPanel( ::Window* pParent, ViewShellBase& rBase,
+ const cssu::Reference<css::frame::XFrame>& rxFrame );
namespace toolpanel { namespace controls {
@@ -39,7 +40,7 @@ CustomAnimationPanel::CustomAnimationPanel(Window& i_rParentWindow, ToolPanelVie
:SubToolPanel( i_rParentWindow )
,m_pPanelViewShell( &i_rPanelViewShell )
{
- mpWrappedControl = createCustomAnimationPanel( &i_rParentWindow, i_rPanelViewShell.GetViewShellBase() );
+ mpWrappedControl = createCustomAnimationPanel( &i_rParentWindow, i_rPanelViewShell.GetViewShellBase(), NULL );
mpWrappedControl->Show();
}
commit aa98c3060e133d785c0ed2d30da3b32cdb745750
Author: Katarina Behrens <bubli at bubli.org>
Date: Wed Jun 19 23:08:26 2013 +0200
sidebar: Feeble attempt to resurrect setting frame label
( putting effect name into it )
Change-Id: If8561ab55a59790bd54646c173adab225e346026
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx
index 382f9d3..9c5e36d 100644
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -169,6 +169,8 @@ CustomAnimationPane::CustomAnimationPane( ::Window* pParent, ViewShellBase& rBas
get(mpPBChangeEffect, "change_effect");
get(mpPBRemoveEffect, "remove_effect");
+ get(mpFTEffect, "effect_label");
+
get(mpFTStart, "start_effect");
get(mpLBStart, "start_effect_list");
get(mpFTProperty, "effect_property");
@@ -192,7 +194,6 @@ CustomAnimationPane::CustomAnimationPane( ::Window* pParent, ViewShellBase& rBas
maStrProperty = mpFTProperty->GetText();
- fillDurationComboBox( mpCBSpeed );
mpPBMoveUp->SetSymbol( SYMBOL_ARROW_UP );
mpPBMoveDown->SetSymbol( SYMBOL_ARROW_DOWN );
@@ -208,7 +209,7 @@ CustomAnimationPane::CustomAnimationPane( ::Window* pParent, ViewShellBase& rBas
mpPBSlideShow->SetClickHdl( LINK( this, CustomAnimationPane, implControlHdl ) );
mpCBAutoPreview->SetClickHdl( LINK( this, CustomAnimationPane, implControlHdl ) );
- //maStrModify = mpFLEffect->GetText();
+ maStrModify = mpFTEffect->GetText();
// get current controller and initialize listeners
try
@@ -529,6 +530,7 @@ void CustomAnimationPane::updateControls()
{
aTemp += OUString( (sal_Unicode)' ' );
aTemp += aUIName;
+ mpFTEffect->SetText( aTemp );
}
CustomAnimationPresetPtr pDescriptor = getPresets().getEffectDescriptor( pEffect->getPresetId() );
@@ -629,6 +631,7 @@ void CustomAnimationPane::updateControls()
mpFTChangeOrder->Enable( sal_False );
mpLBStart->SetNoSelection();
mpCBSpeed->SetNoSelection();
+ mpFTEffect->SetText( maStrModify );
}
bool bEnableUp = true;
diff --git a/sd/source/ui/animations/CustomAnimationPane.hxx b/sd/source/ui/animations/CustomAnimationPane.hxx
index 6b0685e..ed8cc56 100644
--- a/sd/source/ui/animations/CustomAnimationPane.hxx
+++ b/sd/source/ui/animations/CustomAnimationPane.hxx
@@ -129,6 +129,7 @@ private:
PushButton* mpPBAddEffect;
PushButton* mpPBChangeEffect;
PushButton* mpPBRemoveEffect;
+ FixedText* mpFTEffect;
FixedText* mpFTStart;
ListBox* mpLBStart;
FixedText* mpFTProperty;
diff --git a/sd/uiconfig/simpress/ui/customanimationspanel.ui b/sd/uiconfig/simpress/ui/customanimationspanel.ui
index 068af80..81f6b5e 100644
--- a/sd/uiconfig/simpress/ui/customanimationspanel.ui
+++ b/sd/uiconfig/simpress/ui/customanimationspanel.ui
@@ -308,7 +308,7 @@
</object>
</child>
<child type="label">
- <object class="GtkLabel" id="label1">
+ <object class="GtkLabel" id="effect_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Effect</property>
commit ffa2dab31e794f5bd11af798191d57a8e5b0f74f
Author: Katarina Behrens <bubli at bubli.org>
Date: Wed Jun 19 18:30:02 2013 +0200
sidebar: Removed now dead (widget placement) code
no longer needed after conversion to .ui
Change-Id: Icc3d99a03d680d86777d5c12843795a6308f4819
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx
index bb11022..382f9d3 100644
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -192,12 +192,6 @@ CustomAnimationPane::CustomAnimationPane( ::Window* pParent, ViewShellBase& rBas
maStrProperty = mpFTProperty->GetText();
- // use bold font for group headings (same font for all fixed lines):
- /*Font font( mpFLEffect->GetFont() );
- font.SetWeight( WEIGHT_BOLD );
- mpFLEffect->SetFont( font );
- mpFLModify->SetFont( font );*/
-
fillDurationComboBox( mpCBSpeed );
mpPBMoveUp->SetSymbol( SYMBOL_ARROW_UP );
mpPBMoveDown->SetSymbol( SYMBOL_ARROW_DOWN );
@@ -216,9 +210,6 @@ CustomAnimationPane::CustomAnimationPane( ::Window* pParent, ViewShellBase& rBas
//maStrModify = mpFLEffect->GetText();
- // resize controls according to current size
- //updateLayout();
-
// get current controller and initialize listeners
try
{
@@ -284,12 +275,6 @@ void CustomAnimationPane::addUndo()
}
}
-void CustomAnimationPane::Resize()
-{
- //updateLayout();
- return;
-}
-
void CustomAnimationPane::StateChanged( StateChangedType nStateChange )
{
Control::StateChanged( nStateChange );
@@ -370,213 +355,6 @@ IMPL_LINK(CustomAnimationPane,EventMultiplexerListener,
return 0;
}
-
-void CustomAnimationPane::updateLayout()
-{
- Size aPaneSize( GetSizePixel() );
- if( aPaneSize.Width() < maMinSize.Width() )
- aPaneSize.Width() = maMinSize.Width();
-
- if( aPaneSize.Height() < maMinSize.Height() )
- aPaneSize.Height() = maMinSize.Height();
-
- Point aOffset( LogicToPixel( Point(3,3), MAP_APPFONT ) );
- Point aCursor( aOffset );
-
- // place the modify fixed line
-
- // place the "modify effect" fixed line
- Size aSize;/*( mpFLModify->GetSizePixel() );*/
- aSize.Width() = aPaneSize.Width() - 2 * aOffset.X();
-
- //mpFLModify->SetPosSizePixel( aCursor, aSize );
-
- aCursor.Y() += aSize.Height() + aOffset.Y();
-
- const int nButtonExtraWidth = 4 * aOffset.X();
-
- // the "add effect" button is placed top-left
- Size aCtrlSize( mpPBAddEffect->GetSizePixel() );
- aCtrlSize.setWidth( mpPBAddEffect->CalcMinimumSize( aSize.Width() ).getWidth() + nButtonExtraWidth );
- mpPBAddEffect->SetPosSizePixel( aCursor, aCtrlSize );
-
- aCursor.X() += aOffset.X() + aCtrlSize.Width();
-
- // place the "change effect" button
-
- // if the "change" button does not fit right of the "add effect", put it on the next line
- aCtrlSize = mpPBChangeEffect->GetSizePixel();
- aCtrlSize.setWidth( mpPBChangeEffect->CalcMinimumSize( aSize.Width() ).getWidth() + nButtonExtraWidth );
- if( ( aCursor.X() + aCtrlSize.Width() + aOffset.X() ) > aPaneSize.Width() )
- {
- aCursor.X() = aOffset.X();
- aCursor.Y() += aCtrlSize.Height() + aOffset.Y();
- }
- mpPBChangeEffect->SetPosSizePixel( aCursor, aCtrlSize );
-
- aCursor.X() += aOffset.X() + aCtrlSize.Width();
-
- // place the "remove effect" button
-
- // if the "remove" button does not fit right of the "add effect", put it on the next line
- aCtrlSize = mpPBRemoveEffect->GetSizePixel();
- aCtrlSize.setWidth( mpPBRemoveEffect->CalcMinimumSize( aSize.Width() ).getWidth() + nButtonExtraWidth );
- if( ( aCursor.X() + aCtrlSize.Width() + aOffset.X() ) > aPaneSize.Width() )
- {
- aCursor.X() = aOffset.X();
- aCursor.Y() += aCtrlSize.Height() + aOffset.Y();
- }
-
- mpPBRemoveEffect->SetPosSizePixel( aCursor, aCtrlSize );
-
- aCursor.X() = aOffset.X();
- aCursor.Y() += aCtrlSize.Height() + 2 * aOffset.Y();
-
- // place the "modify effect" fixed line
- /*aSize = mpFLEffect->GetSizePixel();
- aSize.Width() = aPaneSize.Width() - 2 * aOffset.X();*/
-
- //mpFLEffect->SetPosSizePixel( aCursor, aSize );
-
- aCursor.Y() += aSize.Height() + aOffset.Y();
-
- // ---------------------------------------------------------------------------
- // place the properties controls
-
- // calc minimum width for fixedtext
-
- Size aFixedTextSize( mpFTStart->CalcMinimumSize() );
- long nWidth = aFixedTextSize.Width();
- aFixedTextSize = mpFTProperty->CalcMinimumSize();
- nWidth = std::max( nWidth, aFixedTextSize.Width() );
- aFixedTextSize = mpFTSpeed->CalcMinimumSize();
- aFixedTextSize.Width() = std::max( nWidth, aFixedTextSize.Width() ) + aOffset.X();
- mpFTStart->SetSizePixel(aFixedTextSize);
- mpFTProperty->SetSizePixel(aFixedTextSize);
- mpFTSpeed->SetSizePixel(aFixedTextSize);
-
- aSize = mpPBPropertyMore->GetSizePixel();
-
- // place the "start" fixed text
-
- Point aFTPos( aCursor );
- Point aLBPos( aCursor );
- Size aListBoxSize( LogicToPixel( Size( 60, 12 ), MAP_APPFONT ) );
- long nDeltaY = aListBoxSize.Height() + aOffset.Y();
-
- // linebreak?
- if( (aFixedTextSize.Width() + aListBoxSize.Width() + aSize.Width() + 4 * aOffset.X()) > aPaneSize.Width() )
- {
- // y position for list box is below fixed text
- aLBPos.Y() += aFixedTextSize.Height() + aOffset.Y();
-
- // height of fixed text + list box + something = 2 * list box
- nDeltaY = aListBoxSize.Height() + aFixedTextSize.Height() + 2*aOffset.Y();
- }
- else
- {
- // x position for list box is right of fixed text
- aLBPos.X() += aFixedTextSize.Width() + aOffset.X();
-
- if( aListBoxSize.Height() > aFixedTextSize.Height() )
- aFTPos.Y() = aLBPos.Y() + ((aListBoxSize.Height() - aFixedTextSize.Height()) >> 1);
- else
- aLBPos.Y() = aFTPos.Y() + ((aFixedTextSize.Height() - aListBoxSize.Height()) >> 1);
- }
-
- // width of the listbox is from its left side until end of pane
- aListBoxSize.Width() = aPaneSize.Width() - aLBPos.X() - aSize.Width() - 2 * aOffset.X();
-
- mpFTStart->SetPosPixel( aFTPos );
- mpLBStart->SetPosSizePixel( aLBPos, aListBoxSize );
-
- aFTPos.Y() += nDeltaY; aLBPos.Y() += nDeltaY;
-
- mpFTProperty->SetPosPixel( aFTPos );
- mpLBProperty->SetPosSizePixel( aLBPos, aListBoxSize );
- mpLBProperty->Resize();
-
- Point aMorePos( aLBPos );
- aMorePos.X() += aListBoxSize.Width() + aOffset.X();
- mpPBPropertyMore->SetPosPixel( aMorePos );
-
- aFTPos.Y() += nDeltaY; aLBPos.Y() += nDeltaY;
-
- mpFTSpeed->SetPosPixel( aFTPos );
- mpCBSpeed->SetPosSizePixel( aLBPos, aListBoxSize );
-
- aFTPos.Y() += nDeltaY + aOffset.Y();
-
- Point aListPos( aFTPos );
-
- // positionate the buttons on the bottom
-
- // place the auto preview checkbox
- aCursor = Point( aOffset.X(), aPaneSize.Height() - mpCBAutoPreview->GetSizePixel().Height() - aOffset.Y() );
- mpCBAutoPreview->SetPosPixel( aCursor );
-
- // place the separator 2 fixed line
- /* aCursor.Y() -= aOffset.Y() + mpFLSeparator2->GetSizePixel().Height();
- aSize = mpFLSeparator2->GetSizePixel();
- aSize.Width() = aPaneSize.Width() - 2 * aOffset.X();
- mpFLSeparator2->SetPosSizePixel( aCursor, aSize );*/
-
- // next, layout and place the play and slide show buttons
- aCtrlSize = mpPBSlideShow->GetSizePixel();
- aCtrlSize.setWidth( mpPBSlideShow->CalcMinimumSize( aSize.Width() ).getWidth() + nButtonExtraWidth );
-
- Size aPlaySize( mpPBPlay->GetSizePixel() );
- aPlaySize.setWidth( mpPBPlay->CalcMinimumSize( aSize.Width() ).getWidth() + nButtonExtraWidth );
-
- aCursor.Y() -= aCtrlSize.Height() /* + aOffset.Y() */;
-
- // do we need two lines for the buttons?
- int aTestWidth = aCursor.X() + mpPBPlay->GetSizePixel().Width() + 2 * aOffset.X() + mpPBSlideShow->GetSizePixel().Width();
- if( aTestWidth > aPaneSize.Width() )
- {
- mpPBSlideShow->SetPosSizePixel( aCursor, aCtrlSize );
- aCursor.Y() -= aCtrlSize.Height() + aOffset.Y();
- mpPBPlay->SetPosSizePixel( aCursor, aPlaySize );
- }
- else
- {
- mpPBPlay->SetPosSizePixel( aCursor, aPlaySize );
- aCursor.X() += aPlaySize.Width() + aOffset.X();
- mpPBSlideShow->SetPosSizePixel( aCursor, aCtrlSize );
- }
-
- // place the separator 1 fixed line
- aCursor.X() = aOffset.X();
- /* aCursor.Y() -= aOffset.Y() + mpFLSeparator1->GetSizePixel().Height();
- aSize = mpFLSeparator1->GetSizePixel();
- aSize.Width() = aPaneSize.Width() - 2 * aOffset.X();
- mpFLSeparator1->SetPosSizePixel( aCursor, aSize ); */
-
- // place the move down button
- aSize = mpPBMoveDown->GetSizePixel();
-
- aCursor.X() = aPaneSize.Width() - aOffset.X() - aSize.Width();
- aCursor.Y() -= aOffset.Y() + aSize.Height();
- mpPBMoveDown->SetPosPixel( aCursor );
-
- aCursor.X() -= aOffset.X() + aSize.Width();
- mpPBMoveUp->SetPosPixel( aCursor );
-
- // Place the change order label.
- // Its width has to be calculated dynamically so that is can be
- // displayed flush right without having too much space to the buttons
- // with some languages or truncated text with others.
- mpFTChangeOrder->SetSizePixel(mpFTChangeOrder->CalcMinimumSize());
-
- aCursor.X() -= aOffset.X() + mpFTChangeOrder->GetSizePixel().Width();
- aCursor.Y() += (aSize.Height() - mpFTChangeOrder->GetSizePixel().Height()) >> 1;
- mpFTChangeOrder->SetPosPixel( aCursor );
-
- // positionate the custom animation list control
- Size aCustomAnimationListSize( aPaneSize.Width() - aListPos.X() - aOffset.X(), aCursor.Y() - aListPos.Y() - 2 * aOffset.Y() );
- mpCustomAnimationList->SetPosSizePixel( aListPos, aCustomAnimationListSize );
-}
-
static sal_Int32 getPropertyType( const OUString& rProperty )
{
if ( rProperty == "Direction" )
@@ -701,17 +479,14 @@ OUString getPropertyName( sal_Int32 nPropertyType )
void CustomAnimationPane::updateControls()
{
- //mpFLModify->Enable( mxView.is() );
mpFTSpeed->Enable( mxView.is() );
mpCBSpeed->Enable( mxView.is() );
mpCustomAnimationList->Enable( mxView.is() );
mpFTChangeOrder->Enable( mxView.is() );
mpPBMoveUp->Enable( mxView.is() );
mpPBMoveDown->Enable( mxView.is() );
- //mpFLSeparator1->Enable( mxView.is() );
mpPBPlay->Enable( mxView.is() );
mpPBSlideShow->Enable( mxView.is() );
- //mpFLSeparator2->Enable( mxView.is() );
mpCBAutoPreview->Enable( mxView.is() );
if( !mxView.is() )
@@ -719,7 +494,6 @@ void CustomAnimationPane::updateControls()
mpPBAddEffect->Enable( sal_False );
mpPBChangeEffect->Enable( sal_False );
mpPBRemoveEffect->Enable( sal_False );
- //mpFLEffect->Enable( sal_False );
mpFTStart->Enable( sal_False );
mpLBStart->Enable( sal_False );
mpPBPropertyMore->Enable( sal_False );
@@ -735,7 +509,6 @@ void CustomAnimationPane::updateControls()
mpPBChangeEffect->Enable( nSelectionCount);
mpPBRemoveEffect->Enable(nSelectionCount);
- //mpFLEffect->Enable(nSelectionCount > 0);
mpFTStart->Enable(nSelectionCount > 0);
mpLBStart->Enable(nSelectionCount > 0);
mpPBPropertyMore->Enable(nSelectionCount > 0);
@@ -757,7 +530,6 @@ void CustomAnimationPane::updateControls()
aTemp += OUString( (sal_Unicode)' ' );
aTemp += aUIName;
}
- //mpFLEffect->SetText( aTemp );
CustomAnimationPresetPtr pDescriptor = getPresets().getEffectDescriptor( pEffect->getPresetId() );
if( pDescriptor.get() )
@@ -857,7 +629,6 @@ void CustomAnimationPane::updateControls()
mpFTChangeOrder->Enable( sal_False );
mpLBStart->SetNoSelection();
mpCBSpeed->SetNoSelection();
- //mpFLEffect->SetText( maStrModify );
}
bool bEnableUp = true;
diff --git a/sd/source/ui/animations/CustomAnimationPane.hxx b/sd/source/ui/animations/CustomAnimationPane.hxx
index 325995b..6b0685e 100644
--- a/sd/source/ui/animations/CustomAnimationPane.hxx
+++ b/sd/source/ui/animations/CustomAnimationPane.hxx
@@ -81,7 +81,6 @@ public:
void remove( CustomAnimationEffectPtr& pEffect );
// Control
- virtual void Resize();
virtual void StateChanged( StateChangedType nStateChange );
virtual void KeyInput( const KeyEvent& rKEvt );
@@ -100,7 +99,6 @@ public:
private:
void addListener();
void removeListener();
- void updateLayout();
void updateControls();
void updateMotionPathTags();
void markShapesFromSelectedEffects();
commit 4438fca46a16a59f9a24fc6c8221beaf4b039c57
Author: Katarina Behrens <bubli at bubli.org>
Date: Wed Jun 19 18:08:11 2013 +0200
sidebar: Converted custom animations pane to .ui
Change-Id: I50b38c984b0f4b179dff84281033a328e30c3275
diff --git a/sd/UIConfig_simpress.mk b/sd/UIConfig_simpress.mk
index 16d0cae..eb3953c 100644
--- a/sd/UIConfig_simpress.mk
+++ b/sd/UIConfig_simpress.mk
@@ -79,6 +79,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/simpress,\
sd/uiconfig/simpress/ui/customslideshows \
sd/uiconfig/simpress/ui/optimpressgeneralpage \
sd/uiconfig/simpress/ui/prntopts \
+ sd/uiconfig/simpress/ui/customanimationspanel \
))
# vim: set noet sw=4 ts=4:
diff --git a/sd/source/ui/animations/CustomAnimationCreateDialog.cxx b/sd/source/ui/animations/CustomAnimationCreateDialog.cxx
index b24b8ef..22dff09 100644
--- a/sd/source/ui/animations/CustomAnimationCreateDialog.cxx
+++ b/sd/source/ui/animations/CustomAnimationCreateDialog.cxx
@@ -64,7 +64,7 @@ const int EXIT = 2;
const int MOTIONPATH = 3;
const int MISCEFFECTS = 4;
-extern void fillDurationComboBox( ComboBox* pBox );
+//extern void fillDurationComboBox( ComboBox* pBox );
// --------------------------------------------------------------------
@@ -286,7 +286,7 @@ CustomAnimationCreateTabPage::CustomAnimationCreateTabPage( Window* pParent, Cus
mpLBEffects->SelectEntryPos( nFirstEffect );
- fillDurationComboBox( mpCBSpeed );
+ //fillDurationComboBox( mpCBSpeed );
if( nFirstEffect != LISTBOX_ENTRY_NOTFOUND )
onSelectEffect();
diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx
index 6f1ca05..0ce986c 100644
--- a/sd/source/ui/animations/CustomAnimationDialog.cxx
+++ b/sd/source/ui/animations/CustomAnimationDialog.cxx
@@ -1848,8 +1848,8 @@ CustomAnimationDurationTabPage::CustomAnimationDurationTabPage(Window* pParent,
mpRBInteractive.reset( new RadioButton( this, SdResId( RB_INTERACTIVE ) ) );
mpLBTrigger.reset( new ListBox( this, SdResId( LB_TRIGGER ) ) );
- fillRepeatComboBox( mpCBRepeat.get() );
- fillDurationComboBox( mpCBDuration.get() );
+ //fillRepeatComboBox( mpCBRepeat.get() );
+ //fillDurationComboBox( mpCBDuration.get() );
FreeResource();
@@ -2483,6 +2483,16 @@ PropertyControl::PropertyControl( Window* pParent, const ResId& rResId )
{
}
+PropertyControl::PropertyControl( Window* pParent )
+: ListBox( pParent, WB_TABSTOP | WB_BORDER | WB_DROPDOWN ), mpSubControl(0)
+{
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makePropertyControl( Window *pParent )
+{
+ return new PropertyControl( pParent );
+}
+
PropertyControl::~PropertyControl()
{
if( mpSubControl )
diff --git a/sd/source/ui/animations/CustomAnimationDialog.hxx b/sd/source/ui/animations/CustomAnimationDialog.hxx
index 38fd8df..2ac374c 100644
--- a/sd/source/ui/animations/CustomAnimationDialog.hxx
+++ b/sd/source/ui/animations/CustomAnimationDialog.hxx
@@ -129,6 +129,7 @@ class PropertyControl : public ListBox
{
public:
PropertyControl( Window* pParent, const ResId& rResId );
+ PropertyControl( Window* pParent );
~PropertyControl();
void setSubControl( PropertySubControl* pSubControl );
diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx
index d0e6d76..40d759a 100644
--- a/sd/source/ui/animations/CustomAnimationList.cxx
+++ b/sd/source/ui/animations/CustomAnimationList.cxx
@@ -469,6 +469,18 @@ CustomAnimationList::CustomAnimationList( ::Window* pParent, const ResId& rResId
SetNodeDefaultImages();
}
+CustomAnimationList::CustomAnimationList( ::Window* pParent )
+: SvTreeListBox( pParent, WB_TABSTOP | WB_BORDER ),
+ mpController(0)
+{
+
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeCustomAnimationList( ::Window *pParent )
+{
+ return new CustomAnimationList( pParent );
+}
+
// --------------------------------------------------------------------
const Image& CustomAnimationList::getImage( sal_uInt16 nId )
diff --git a/sd/source/ui/animations/CustomAnimationList.hxx b/sd/source/ui/animations/CustomAnimationList.hxx
index d063d69..da4dae1 100644
--- a/sd/source/ui/animations/CustomAnimationList.hxx
+++ b/sd/source/ui/animations/CustomAnimationList.hxx
@@ -47,6 +47,7 @@ class CustomAnimationList : public SvTreeListBox, public ISequenceListener
public:
CustomAnimationList( ::Window* pParent, const ResId& rResId, ICustomAnimationListController* pController );
+ CustomAnimationList( ::Window* pParent );
virtual ~CustomAnimationList();
// methods
@@ -87,6 +88,11 @@ public:
/// clears all entries from the listbox
void clear();
+ void setController( ICustomAnimationListController* pController )
+ {
+ mpController = pController;
+ };
+
private:
bool mbIgnorePaint;
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx
index 6da8a82..bb11022 100644
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -108,7 +108,7 @@ namespace sd {
// --------------------------------------------------------------------
-void fillDurationComboBox( ComboBox* pBox )
+void fillDurationComboBox( ListBox* pBox )
{
static const double gdVerySlow = 5.0;
static const double gdSlow = 3.0;
@@ -132,7 +132,7 @@ void fillDurationComboBox( ComboBox* pBox )
pBox->SetEntryData( pBox->InsertEntry( aVeryFast ), (void*)&gdVeryFast );
}
-void fillRepeatComboBox( ComboBox* pBox )
+void fillRepeatComboBox( ListBox* pBox )
{
String aNone( SdResId( STR_CUSTOMANIMATION_REPEAT_NONE ) );
pBox->SetEntryData( pBox->InsertEntry( aNone ), (void*)((sal_Int32)0) );
@@ -152,8 +152,11 @@ void fillRepeatComboBox( ComboBox* pBox )
// --------------------------------------------------------------------
-CustomAnimationPane::CustomAnimationPane( ::Window* pParent, ViewShellBase& rBase, const Size& rMinSize )
-: Control( pParent, SdResId(DLG_CUSTOMANIMATIONPANE) ),
+
+CustomAnimationPane::CustomAnimationPane( ::Window* pParent, ViewShellBase& rBase,
+ const cssu::Reference<css::frame::XFrame>& rxFrame,
+ const Size& rMinSize )
+: PanelLayout( pParent, "CustomAnimationsPanel", "modules/simpress/ui/customanimationspanel.ui", rxFrame ),
mrBase( rBase ),
mpCustomAnimationPresets(NULL),
mnPropertyType( nPropertyTypeNone ),
@@ -162,43 +165,38 @@ CustomAnimationPane::CustomAnimationPane( ::Window* pParent, ViewShellBase& rBas
maLateInitTimer()
{
// load resources
- mpFLEffect = new FixedLine( this, SdResId( FL_EFFECT ) );
-
- mpPBAddEffect = new PushButton( this, SdResId( PB_ADD_EFFECT ) );
- mpPBChangeEffect = new PushButton( this, SdResId( PB_CHANGE_EFFECT ) );
- mpPBRemoveEffect = new PushButton( this, SdResId( PB_REMOVE_EFFECT ) );
-
- mpFLModify = new FixedLine( this, SdResId( FL_MODIFY ) );
-
- mpFTStart = new FixedText( this, SdResId( FT_START ) );
- mpLBStart = new ListBox( this, SdResId( LB_START ) );
- mpFTProperty = new FixedText( this, SdResId( FT_PROPERTY ) );
- mpLBProperty = new PropertyControl( this, SdResId( LB_PROPERTY ) );
- mpPBPropertyMore = new PushButton( this, SdResId( PB_PROPERTY_MORE ) );
-
- mpFTSpeed = new FixedText( this, SdResId( FT_SPEED ) );
- mpCBSpeed = new ComboBox( this, SdResId( CB_SPEED ) );
-
- mpCustomAnimationList = new CustomAnimationList( this, SdResId( CT_CUSTOM_ANIMATION_LIST ), this );
-
- mpPBMoveUp = new PushButton( this, SdResId( PB_MOVE_UP ) );
- mpPBMoveDown = new PushButton( this, SdResId( PB_MOVE_DOWN ) );
- mpFTChangeOrder = new FixedText( this, SdResId( FT_CHANGE_ORDER ) );
- mpFLSeparator1 = new FixedLine( this, SdResId( FL_SEPARATOR1 ) );
- mpPBPlay = new PushButton( this, SdResId( PB_PLAY ) );
- mpPBSlideShow = new PushButton( this, SdResId( PB_SLIDE_SHOW ) );
- mpFLSeparator2 = new FixedLine( this, SdResId( FL_SEPARATOR2 ) );
- mpCBAutoPreview = new CheckBox( this, SdResId( CB_AUTOPREVIEW ) );
+ get(mpPBAddEffect, "add_effect");
+ get(mpPBChangeEffect, "change_effect");
+ get(mpPBRemoveEffect, "remove_effect");
+
+ get(mpFTStart, "start_effect");
+ get(mpLBStart, "start_effect_list");
+ get(mpFTProperty, "effect_property");
+ get(mpLBProperty, "effect_property_list");
+ get(mpPBPropertyMore, "more_properties");
+
+ get(mpFTSpeed, "effect_speed");
+ get(mpCBSpeed, "effect_speed_list");
+
+ get(mpCustomAnimationList, "custom_animation_list");
+ mpCustomAnimationList->setController( dynamic_cast<ICustomAnimationListController*> ( this ) );
+ mpCustomAnimationList->set_width_request(mpCustomAnimationList->approximate_char_width() * 16);
+ mpCustomAnimationList->set_height_request(mpCustomAnimationList->GetTextHeight() * 16);
+
+ get(mpPBMoveUp, "move_up");
+ get(mpPBMoveDown, "move_down");
+ get(mpFTChangeOrder, "change_order");
+ get(mpPBPlay, "play");
+ get(mpPBSlideShow, "slideshow");
+ get(mpCBAutoPreview,"auto_preview");
maStrProperty = mpFTProperty->GetText();
- FreeResource();
-
// use bold font for group headings (same font for all fixed lines):
- Font font( mpFLEffect->GetFont() );
+ /*Font font( mpFLEffect->GetFont() );
font.SetWeight( WEIGHT_BOLD );
mpFLEffect->SetFont( font );
- mpFLModify->SetFont( font );
+ mpFLModify->SetFont( font );*/
fillDurationComboBox( mpCBSpeed );
mpPBMoveUp->SetSymbol( SYMBOL_ARROW_UP );
@@ -216,10 +214,10 @@ CustomAnimationPane::CustomAnimationPane( ::Window* pParent, ViewShellBase& rBas
mpPBSlideShow->SetClickHdl( LINK( this, CustomAnimationPane, implControlHdl ) );
mpCBAutoPreview->SetClickHdl( LINK( this, CustomAnimationPane, implControlHdl ) );
- maStrModify = mpFLEffect->GetText();
+ //maStrModify = mpFLEffect->GetText();
// resize controls according to current size
- updateLayout();
+ //updateLayout();
// get current controller and initialize listeners
try
@@ -256,11 +254,9 @@ CustomAnimationPane::~CustomAnimationPane()
for( aIter = aTags.begin(); aIter != aTags.end(); ++aIter )
(*aIter)->Dispose();
- delete mpFLModify;
delete mpPBAddEffect;
delete mpPBChangeEffect;
delete mpPBRemoveEffect;
- delete mpFLEffect;
delete mpFTStart;
delete mpLBStart;
delete mpFTProperty;
@@ -272,10 +268,8 @@ CustomAnimationPane::~CustomAnimationPane()
delete mpFTChangeOrder;
delete mpPBMoveUp;
delete mpPBMoveDown;
- delete mpFLSeparator1;
delete mpPBPlay;
delete mpPBSlideShow;
- delete mpFLSeparator2;
delete mpCBAutoPreview;
}
@@ -292,7 +286,8 @@ void CustomAnimationPane::addUndo()
void CustomAnimationPane::Resize()
{
- updateLayout();
+ //updateLayout();
+ return;
}
void CustomAnimationPane::StateChanged( StateChangedType nStateChange )
@@ -391,10 +386,10 @@ void CustomAnimationPane::updateLayout()
// place the modify fixed line
// place the "modify effect" fixed line
- Size aSize( mpFLModify->GetSizePixel() );
+ Size aSize;/*( mpFLModify->GetSizePixel() );*/
aSize.Width() = aPaneSize.Width() - 2 * aOffset.X();
- mpFLModify->SetPosSizePixel( aCursor, aSize );
+ //mpFLModify->SetPosSizePixel( aCursor, aSize );
aCursor.Y() += aSize.Height() + aOffset.Y();
@@ -438,10 +433,10 @@ void CustomAnimationPane::updateLayout()
aCursor.Y() += aCtrlSize.Height() + 2 * aOffset.Y();
// place the "modify effect" fixed line
- aSize = mpFLEffect->GetSizePixel();
- aSize.Width() = aPaneSize.Width() - 2 * aOffset.X();
+ /*aSize = mpFLEffect->GetSizePixel();
+ aSize.Width() = aPaneSize.Width() - 2 * aOffset.X();*/
- mpFLEffect->SetPosSizePixel( aCursor, aSize );
+ //mpFLEffect->SetPosSizePixel( aCursor, aSize );
aCursor.Y() += aSize.Height() + aOffset.Y();
@@ -521,10 +516,10 @@ void CustomAnimationPane::updateLayout()
mpCBAutoPreview->SetPosPixel( aCursor );
// place the separator 2 fixed line
- aCursor.Y() -= /* aOffset.Y() + */ mpFLSeparator2->GetSizePixel().Height();
+ /* aCursor.Y() -= aOffset.Y() + mpFLSeparator2->GetSizePixel().Height();
aSize = mpFLSeparator2->GetSizePixel();
aSize.Width() = aPaneSize.Width() - 2 * aOffset.X();
- mpFLSeparator2->SetPosSizePixel( aCursor, aSize );
+ mpFLSeparator2->SetPosSizePixel( aCursor, aSize );*/
// next, layout and place the play and slide show buttons
aCtrlSize = mpPBSlideShow->GetSizePixel();
@@ -552,10 +547,10 @@ void CustomAnimationPane::updateLayout()
// place the separator 1 fixed line
aCursor.X() = aOffset.X();
- aCursor.Y() -= /* aOffset.Y() + */ mpFLSeparator1->GetSizePixel().Height();
+ /* aCursor.Y() -= aOffset.Y() + mpFLSeparator1->GetSizePixel().Height();
aSize = mpFLSeparator1->GetSizePixel();
aSize.Width() = aPaneSize.Width() - 2 * aOffset.X();
- mpFLSeparator1->SetPosSizePixel( aCursor, aSize );
+ mpFLSeparator1->SetPosSizePixel( aCursor, aSize ); */
// place the move down button
aSize = mpPBMoveDown->GetSizePixel();
@@ -706,17 +701,17 @@ OUString getPropertyName( sal_Int32 nPropertyType )
void CustomAnimationPane::updateControls()
{
- mpFLModify->Enable( mxView.is() );
+ //mpFLModify->Enable( mxView.is() );
mpFTSpeed->Enable( mxView.is() );
mpCBSpeed->Enable( mxView.is() );
mpCustomAnimationList->Enable( mxView.is() );
mpFTChangeOrder->Enable( mxView.is() );
mpPBMoveUp->Enable( mxView.is() );
mpPBMoveDown->Enable( mxView.is() );
- mpFLSeparator1->Enable( mxView.is() );
+ //mpFLSeparator1->Enable( mxView.is() );
mpPBPlay->Enable( mxView.is() );
mpPBSlideShow->Enable( mxView.is() );
- mpFLSeparator2->Enable( mxView.is() );
+ //mpFLSeparator2->Enable( mxView.is() );
mpCBAutoPreview->Enable( mxView.is() );
if( !mxView.is() )
@@ -724,7 +719,7 @@ void CustomAnimationPane::updateControls()
mpPBAddEffect->Enable( sal_False );
mpPBChangeEffect->Enable( sal_False );
mpPBRemoveEffect->Enable( sal_False );
- mpFLEffect->Enable( sal_False );
+ //mpFLEffect->Enable( sal_False );
mpFTStart->Enable( sal_False );
mpLBStart->Enable( sal_False );
mpPBPropertyMore->Enable( sal_False );
@@ -740,7 +735,7 @@ void CustomAnimationPane::updateControls()
mpPBChangeEffect->Enable( nSelectionCount);
mpPBRemoveEffect->Enable(nSelectionCount);
- mpFLEffect->Enable(nSelectionCount > 0);
+ //mpFLEffect->Enable(nSelectionCount > 0);
mpFTStart->Enable(nSelectionCount > 0);
mpLBStart->Enable(nSelectionCount > 0);
mpPBPropertyMore->Enable(nSelectionCount > 0);
@@ -762,7 +757,7 @@ void CustomAnimationPane::updateControls()
aTemp += OUString( (sal_Unicode)' ' );
aTemp += aUIName;
}
- mpFLEffect->SetText( aTemp );
+ //mpFLEffect->SetText( aTemp );
CustomAnimationPresetPtr pDescriptor = getPresets().getEffectDescriptor( pEffect->getPresetId() );
if( pDescriptor.get() )
@@ -862,7 +857,7 @@ void CustomAnimationPane::updateControls()
mpFTChangeOrder->Enable( sal_False );
mpLBStart->SetNoSelection();
mpCBSpeed->SetNoSelection();
- mpFLEffect->SetText( maStrModify );
+ //mpFLEffect->SetText( maStrModify );
}
bool bEnableUp = true;
@@ -1080,10 +1075,10 @@ void CustomAnimationPane::UpdateLook (void)
::sfx2::sidebar::Theme::GetWallpaper(
::sfx2::sidebar::Theme::Paint_PanelBackground));
SetBackground(aBackground);
- if (mpFLModify != NULL)
+ /*if (mpFLModify != NULL)
mpFLModify->SetBackground(aBackground);
if (mpFLEffect != NULL)
- mpFLEffect->SetBackground(aBackground);
+ mpFLEffect->SetBackground(aBackground);*/
if (mpFTStart != NULL)
mpFTStart->SetBackground(aBackground);
if (mpFTProperty != NULL)
@@ -1092,10 +1087,10 @@ void CustomAnimationPane::UpdateLook (void)
mpFTSpeed->SetBackground(aBackground);
if (mpFTChangeOrder != NULL)
mpFTChangeOrder->SetBackground(aBackground);
- if (mpFLSeparator1 != NULL)
+ /*if (mpFLSeparator1 != NULL)
mpFLSeparator1->SetBackground(aBackground);
if (mpFLSeparator2 != NULL)
- mpFLSeparator2->SetBackground(aBackground);
+ mpFLSeparator2->SetBackground(aBackground);*/
}
@@ -2562,7 +2557,7 @@ void CustomAnimationPane::updatePathFromMotionPathTag( const rtl::Reference< Mot
pWindow->SetSizePixel(aMinSize);
pWindow->SetBackground(Wallpaper(Color(COL_BLUE)));
- ::Window* pPaneWindow = new CustomAnimationPane( pWindow, rBase, aMinSize );
+ ::Window* pPaneWindow = new CustomAnimationPane( pWindow, rBase, NULL, aMinSize );
pWindow->SetChildWindow( pPaneWindow, aMinSize );
pWindow->SetText( pPaneWindow->GetText() );
}
@@ -2570,6 +2565,25 @@ void CustomAnimationPane::updatePathFromMotionPathTag( const rtl::Reference< Mot
return pWindow;
}
+::Window * createCustomAnimationPanel( ::Window* pParent, ViewShellBase& rBase, const cssu::Reference<css::frame::XFrame>& rxFrame )
+{
+ DialogListBox* pWindow = 0;
+
+ DrawDocShell* pDocSh = rBase.GetDocShell();
+ if( pDocSh )
+ {
+ pWindow = new DialogListBox( pParent, WB_CLIPCHILDREN|WB_TABSTOP|WB_AUTOHSCROLL );
+ const Size aMinSize( pWindow->LogicToPixel( Size( 80, 256 ), MAP_APPFONT ) );
+ pWindow->SetSizePixel(aMinSize);
+ pWindow->SetBackground(Wallpaper(Color(COL_BLUE)));
+
+ ::Window* pPaneWindow = new CustomAnimationPane( pWindow, rBase, rxFrame, aMinSize );
+ pWindow->SetChildWindow( pPaneWindow, aMinSize );
+ pWindow->SetText( pPaneWindow->GetText() );
+ }
+
+ return pWindow;
+}
diff --git a/sd/source/ui/animations/CustomAnimationPane.hxx b/sd/source/ui/animations/CustomAnimationPane.hxx
index a95b14e..325995b 100644
--- a/sd/source/ui/animations/CustomAnimationPane.hxx
+++ b/sd/source/ui/animations/CustomAnimationPane.hxx
@@ -23,6 +23,8 @@
#include <com/sun/star/drawing/XDrawView.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <vcl/dialog.hxx>
+#include <svx/sidebar/PanelLayout.hxx>
+#include <sfx2/sidebar/ControlFactory.hxx>
#include "CustomAnimationPreset.hxx"
#include "CustomAnimationList.hxx"
#include "CustomAnimationCreateDialog.hxx"
@@ -57,11 +59,11 @@ typedef std::vector< rtl::Reference< MotionPathTag > > MotionPathTagVector;
// --------------------------------------------------------------------
-class CustomAnimationPane : public Control, public ICustomAnimationListController
+class CustomAnimationPane : public PanelLayout, public ICustomAnimationListController
{
friend class MotionPathTag;
public:
- CustomAnimationPane( ::Window* pParent, ViewShellBase& rBase, const Size& rMinSize );
+ CustomAnimationPane( ::Window* pParent, ViewShellBase& rBase, const cssu::Reference<css::frame::XFrame>& rxFrame, const Size& rMinSize );
virtual ~CustomAnimationPane();
// callbacks
@@ -126,26 +128,22 @@ private:
const CustomAnimationPresets* mpCustomAnimationPresets;
- FixedLine* mpFLModify;
PushButton* mpPBAddEffect;
PushButton* mpPBChangeEffect;
PushButton* mpPBRemoveEffect;
- FixedLine* mpFLEffect;
FixedText* mpFTStart;
ListBox* mpLBStart;
FixedText* mpFTProperty;
PropertyControl* mpLBProperty;
PushButton* mpPBPropertyMore;
FixedText* mpFTSpeed;
- ComboBox* mpCBSpeed;
+ ListBox* mpCBSpeed;
CustomAnimationList* mpCustomAnimationList;
FixedText* mpFTChangeOrder;
PushButton* mpPBMoveUp;
PushButton* mpPBMoveDown;
- FixedLine* mpFLSeparator1;
PushButton* mpPBPlay;
PushButton* mpPBSlideShow;
- FixedLine* mpFLSeparator2;
CheckBox* mpCBAutoPreview;
String maStrModify;
diff --git a/sd/source/ui/sidebar/CustomAnimationPanel.cxx b/sd/source/ui/sidebar/CustomAnimationPanel.cxx
index c2f8350..f2b38af 100644
--- a/sd/source/ui/sidebar/CustomAnimationPanel.cxx
+++ b/sd/source/ui/sidebar/CustomAnimationPanel.cxx
@@ -22,22 +22,22 @@
namespace sd {
- extern ::Window * createCustomAnimationPanel (::Window* pParent, ViewShellBase& rBase);
+ extern ::Window * createCustomAnimationPanel (::Window* pParent, ViewShellBase& rBase, const cssu::Reference<css::frame::XFrame>& rxFrame);
extern sal_Int32 getCustomAnimationPanelMinimumHeight (::Window* pParent);
}
-
-
-
namespace sd { namespace sidebar {
CustomAnimationPanel::CustomAnimationPanel (
::Window* pParentWindow,
- ViewShellBase& rViewShellBase)
+ ViewShellBase& rViewShellBase,
+ const cssu::Reference<css::frame::XFrame>& rxFrame
+ )
: PanelBase(
pParentWindow,
- rViewShellBase)
+ rViewShellBase),
+ mxFrame( rxFrame )
{
#ifdef DEBUG
SetText(OUString("sd:CustomAnimationPanel"));
@@ -58,7 +58,7 @@ CustomAnimationPanel::~CustomAnimationPanel (void)
::Window* pParentWindow,
ViewShellBase& rViewShellBase)
{
- return createCustomAnimationPanel(pParentWindow, rViewShellBase);
+ return createCustomAnimationPanel(pParentWindow, rViewShellBase, mxFrame);
}
diff --git a/sd/source/ui/sidebar/CustomAnimationPanel.hxx b/sd/source/ui/sidebar/CustomAnimationPanel.hxx
index 2fb71c1..9c2732b 100644
--- a/sd/source/ui/sidebar/CustomAnimationPanel.hxx
+++ b/sd/source/ui/sidebar/CustomAnimationPanel.hxx
@@ -19,7 +19,7 @@
#define SD_SIDEBAR_CUSTOM_ANIMATION_PANEL_HXX
#include "PanelBase.hxx"
-
+#include <sfx2/sidebar/ControlFactory.hxx>
namespace sd { namespace sidebar {
@@ -29,7 +29,8 @@ class CustomAnimationPanel
public:
CustomAnimationPanel (
::Window* pParentWindow,
- ViewShellBase& rViewShellBase);
+ ViewShellBase& rViewShellBase,
+ const cssu::Reference<css::frame::XFrame>& rxFrame);
virtual ~CustomAnimationPanel (void);
// ILayoutableWindow
@@ -39,6 +40,9 @@ protected:
virtual ::Window* CreateWrappedControl (
::Window* pParentWindow,
ViewShellBase& rViewShellBase);
+
+private:
+ cssu::Reference<css::frame::XFrame> mxFrame;
};
} } // end of namespace sd::sidebar
diff --git a/sd/source/ui/sidebar/PanelFactory.cxx b/sd/source/ui/sidebar/PanelFactory.cxx
index c2f0a74..f1677f3 100644
--- a/sd/source/ui/sidebar/PanelFactory.cxx
+++ b/sd/source/ui/sidebar/PanelFactory.cxx
@@ -180,7 +180,7 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement (
#define EndsWith(s,t) s.endsWithAsciiL(t,strlen(t))
if (EndsWith(rsUIElementResourceURL, gsResourceNameCustomAnimations))
- pControl = new CustomAnimationPanel(pParentWindow, *pBase);
+ pControl = new CustomAnimationPanel(pParentWindow, *pBase, xFrame);
else if (EndsWith(rsUIElementResourceURL, gsResourceNameLayouts))
pControl = new LayoutMenu(pParentWindow, *pBase, xSidebar);
else if (EndsWith(rsUIElementResourceURL, gsResourceNameAllMasterPages))
diff --git a/sd/uiconfig/simpress/ui/customanimationspanel.ui b/sd/uiconfig/simpress/ui/customanimationspanel.ui
new file mode 100644
index 0000000..068af80
--- /dev/null
+++ b/sd/uiconfig/simpress/ui/customanimationspanel.ui
@@ -0,0 +1,418 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkBox" id="CustomAnimationPanel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkFrame" id="frame1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkBox" id="box2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkButton" id="add_effect">
+ <property name="label" translatable="yes">_Add...</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="change_effect">
+ <property name="label" translatable="yes">_Change...</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="remove_effect">
+ <property name="label" translatable="yes">_Remove</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Modify effect</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="frame2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkBox" id="box3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkGrid" id="grid1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="start_effect">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_Start:</property>
+ <property name="use_underline">True</property>
+ <property name="halign">end</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="effect_property">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_Direction:</property>
+ <property name="use_underline">True</property>
+ <property name="halign">end</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="effect_speed">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Sp_eed:</property>
+ <property name="use_underline">True</property>
+ <property name="halign">end</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBoxText" id="start_effect_list">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="entry_text_column">0</property>
+ <property name="id_column">1</property>
+ <property name="hexpand">True</property>
+ <items>
+ <item translatable="yes">On click</item>
+ <item translatable="yes">With previous</item>
+ <item translatable="yes">After previous</item>
+ </items>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="sdlo-PropertyControl" id="effect_property_list">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="more_properties">
+ <property name="label" translatable="yes">_...</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBoxText" id="effect_speed_list">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="entry_text_column">0</property>
+ <property name="id_column">1</property>
+ <property name="hexpand">True</property>
+ <items>
+ <item translatable="yes">Very slow</item>
+ <item translatable="yes">Slow</item>
+ <item translatable="yes">Normal</item>
+ <item translatable="yes">Fast</item>
+ <item translatable="yes">Very fast</item>
+ </items>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="sdlo-CustomAnimationList" id="custom_animation_list">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="halign">end</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="change_order">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Change order:</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="move_up">
+ <property name="label">gtk-go-up</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="move_down">
+ <property name="label">gtk-go-down</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Effect</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="frame3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkBox" id="box5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkButton" id="play">
+ <property name="label" translatable="yes">_Play</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="slideshow">
+ <property name="label" translatable="yes">S_lide Show</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label7">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="frame4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkCheckButton" id="auto_preview">
+ <property name="label" translatable="yes">Automatic pre_view</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label8">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </object>
+</interface>
More information about the Libreoffice-commits
mailing list