summaryrefslogtreecommitdiff
path: root/svtools/source/toolpanel
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-03-16 13:36:35 +0100
committerFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-03-16 13:36:35 +0100
commit690f40246d237b8280cc1afc861d702fb344ee4f (patch)
tree7463ed80cb45d0e0e383e11130ed4ff82d964b1a /svtools/source/toolpanel
parent1412426cc9cf5234c3b60cc2f46153df624f2b15 (diff)
slidecopy: de/activate panels via the drawing framework
Instead of simply letting svtool's ToolPanelDeck decide on panel activation, requests are re-routed through the view's ConfigurationController. So, clicking onto a tab just requests the activation of the respective resource, which in turn - when the requested configuration becomes the active configuration - will activate the ToolPanel.
Diffstat (limited to 'svtools/source/toolpanel')
-rw-r--r--svtools/source/toolpanel/tablayouter.cxx12
-rw-r--r--svtools/source/toolpanel/toolpanelcollection.cxx15
-rw-r--r--svtools/source/toolpanel/toolpanelcollection.hxx2
-rw-r--r--svtools/source/toolpanel/toolpaneldeck.cxx14
4 files changed, 24 insertions, 19 deletions
diff --git a/svtools/source/toolpanel/tablayouter.cxx b/svtools/source/toolpanel/tablayouter.cxx
index 382b17e8ced7..523e2170eba2 100644
--- a/svtools/source/toolpanel/tablayouter.cxx
+++ b/svtools/source/toolpanel/tablayouter.cxx
@@ -47,10 +47,11 @@ namespace svt
::std::auto_ptr< PanelTabBar >
pTabBar;
- TabDeckLayouter_Data( ToolPanelDeck& i_rPanelDeck, const TabAlignment i_eAlignment, const TabItemContent i_eItemContent )
+ TabDeckLayouter_Data( Window& i_rParent, IToolPanelDeck& i_rPanels,
+ const TabAlignment i_eAlignment, const TabItemContent i_eItemContent )
:eAlignment( i_eAlignment )
- ,rPanels( i_rPanelDeck )
- ,pTabBar( new PanelTabBar( i_rPanelDeck, i_rPanelDeck, i_eAlignment, i_eItemContent ) )
+ ,rPanels( i_rPanels )
+ ,pTabBar( new PanelTabBar( i_rParent, i_rPanels, i_eAlignment, i_eItemContent ) )
{
pTabBar->Show();
}
@@ -82,8 +83,9 @@ namespace svt
//= TabDeckLayouter
//====================================================================
//--------------------------------------------------------------------
- TabDeckLayouter::TabDeckLayouter( ToolPanelDeck& i_rPanelDeck, const TabAlignment i_eAlignment, const TabItemContent i_eItemContent )
- :m_pData( new TabDeckLayouter_Data( i_rPanelDeck, i_eAlignment, i_eItemContent ) )
+ TabDeckLayouter::TabDeckLayouter( Window& i_rParent, IToolPanelDeck& i_rPanels,
+ const TabAlignment i_eAlignment, const TabItemContent i_eItemContent )
+ :m_pData( new TabDeckLayouter_Data( i_rParent, i_rPanels, i_eAlignment, i_eItemContent ) )
{
}
diff --git a/svtools/source/toolpanel/toolpanelcollection.cxx b/svtools/source/toolpanel/toolpanelcollection.cxx
index 61bdbe699566..baefbd92400f 100644
--- a/svtools/source/toolpanel/toolpanelcollection.cxx
+++ b/svtools/source/toolpanel/toolpanelcollection.cxx
@@ -76,17 +76,20 @@ namespace svt
}
//--------------------------------------------------------------------
- void ToolPanelCollection::ActivatePanel( const size_t i_nPanel )
+ void ToolPanelCollection::ActivatePanel( const ::boost::optional< size_t >& i_rPanel )
{
- OSL_ENSURE( i_nPanel < GetPanelCount(), "ToolPanelCollection::ActivatePanel: illegal panel no.!" );
- if ( i_nPanel >= GetPanelCount() )
- return;
+ if ( !!i_rPanel )
+ {
+ OSL_ENSURE( *i_rPanel < GetPanelCount(), "ToolPanelCollection::ActivatePanel: illegal panel no.!" );
+ if ( *i_rPanel >= GetPanelCount() )
+ return;
+ }
- if ( m_pData->aActivePanel == i_nPanel )
+ if ( m_pData->aActivePanel == i_rPanel )
return;
const ::boost::optional< size_t > aOldPanel( m_pData->aActivePanel );
- m_pData->aActivePanel = i_nPanel;
+ m_pData->aActivePanel = i_rPanel;
// notify listeners
m_pData->aListeners.ActivePanelChanged( aOldPanel, m_pData->aActivePanel );
diff --git a/svtools/source/toolpanel/toolpanelcollection.hxx b/svtools/source/toolpanel/toolpanelcollection.hxx
index 84389b4d6e01..2bdba38546c9 100644
--- a/svtools/source/toolpanel/toolpanelcollection.hxx
+++ b/svtools/source/toolpanel/toolpanelcollection.hxx
@@ -52,7 +52,7 @@ namespace svt
virtual PToolPanel GetPanel( const size_t i_nPos ) const;
virtual ::boost::optional< size_t >
GetActivePanel() const;
- virtual void ActivatePanel( const size_t i_nPanel );
+ virtual void ActivatePanel( const ::boost::optional< size_t >& i_rPanel );
virtual size_t InsertPanel( const PToolPanel& i_pPanel, const size_t i_nPosition );
virtual PToolPanel RemovePanel( const size_t i_nPosition );
virtual void AddListener( IToolPanelDeckListener& i_rListener );
diff --git a/svtools/source/toolpanel/toolpaneldeck.cxx b/svtools/source/toolpanel/toolpaneldeck.cxx
index 5791cd0ed9b1..22d8dc7d57a5 100644
--- a/svtools/source/toolpanel/toolpaneldeck.cxx
+++ b/svtools/source/toolpanel/toolpaneldeck.cxx
@@ -85,7 +85,7 @@ namespace svt
PToolPanel GetPanel( const size_t i_nPos ) const;
::boost::optional< size_t >
GetActivePanel() const;
- void ActivatePanel( const size_t i_nPanel );
+ void ActivatePanel( const ::boost::optional< size_t >& i_rPanel );
size_t InsertPanel( const PToolPanel& i_pPanel, const size_t i_nPosition );
PToolPanel RemovePanel( const size_t i_nPosition );
void AddListener( IToolPanelDeckListener& i_rListener );
@@ -158,9 +158,9 @@ namespace svt
}
//--------------------------------------------------------------------
- void ToolPanelDeck_Impl::ActivatePanel( const size_t i_nPanel )
+ void ToolPanelDeck_Impl::ActivatePanel( const ::boost::optional< size_t >& i_rPanel )
{
- m_aPanels.ActivatePanel( i_nPanel );
+ m_aPanels.ActivatePanel( i_rPanel );
}
//--------------------------------------------------------------------
@@ -249,7 +249,7 @@ namespace svt
if ( !!aActivatePanel )
{
- ActivatePanel( *aActivatePanel );
+ ActivatePanel( aActivatePanel );
}
}
@@ -310,7 +310,7 @@ namespace svt
,m_pImpl( new ToolPanelDeck_Impl( *this ) )
{
// use a default layouter
- SetLayouter( PDeckLayouter( new TabDeckLayouter( *this, TABS_RIGHT, TABITEM_IMAGE_AND_TEXT ) ) );
+ SetLayouter( PDeckLayouter( new TabDeckLayouter( *this, *this, TABS_RIGHT, TABITEM_IMAGE_AND_TEXT ) ) );
}
//--------------------------------------------------------------------
@@ -345,9 +345,9 @@ namespace svt
}
//--------------------------------------------------------------------
- void ToolPanelDeck::ActivatePanel( const size_t i_nPanel )
+ void ToolPanelDeck::ActivatePanel( const ::boost::optional< size_t >& i_rPanel )
{
- m_pImpl->ActivatePanel( i_nPanel );
+ m_pImpl->ActivatePanel( i_rPanel );
}
//--------------------------------------------------------------------