summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-03-19 10:28:04 +0100
committerFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-03-19 10:28:04 +0100
commit1644d80f7aa55a6b2e4a926215b105842c3ab242 (patch)
tree0e0e21b8ebcd8918825677af16317ec862a5510e /sd/source
parentcd3ef5819cb644515289776b8872970218c0ac65 (diff)
slidecopy: reworked the ToolPanelDeck to have a dedicated anchor window for the panel's windows. This will ease some later changes
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/ui/toolpanel/StandardToolPanel.cxx2
-rw-r--r--sd/source/ui/toolpanel/TaskPaneToolPanel.cxx26
-rw-r--r--sd/source/ui/toolpanel/TaskPaneToolPanel.hxx9
3 files changed, 18 insertions, 19 deletions
diff --git a/sd/source/ui/toolpanel/StandardToolPanel.cxx b/sd/source/ui/toolpanel/StandardToolPanel.cxx
index 5e4d35ee1729..1e2ba8f6308e 100644
--- a/sd/source/ui/toolpanel/StandardToolPanel.cxx
+++ b/sd/source/ui/toolpanel/StandardToolPanel.cxx
@@ -102,7 +102,7 @@ namespace sd { namespace toolpanel
return true;
if ( isDisposed() )
return false;
- m_pControl = m_pControlFactory->CreateRootControl( getPanelDeck() );
+ m_pControl = m_pControlFactory->CreateRootControl( getPanelWindowAnchor() );
return ( m_pControl.get() != NULL );
}
diff --git a/sd/source/ui/toolpanel/TaskPaneToolPanel.cxx b/sd/source/ui/toolpanel/TaskPaneToolPanel.cxx
index 92530bf9e5bc..5dc8498abbe4 100644
--- a/sd/source/ui/toolpanel/TaskPaneToolPanel.cxx
+++ b/sd/source/ui/toolpanel/TaskPaneToolPanel.cxx
@@ -71,6 +71,13 @@ namespace sd { namespace toolpanel
}
//------------------------------------------------------------------------------------------------------------------
+ Window& TaskPaneToolPanel::getPanelWindowAnchor()
+ {
+ OSL_ENSURE( !isDisposed(), "already disposed!" );
+ return m_pPanelDeck->GetPanelWindowAnchor();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
::rtl::OUString TaskPaneToolPanel::GetDisplayName() const
{
return m_sPanelName;
@@ -83,15 +90,16 @@ namespace sd { namespace toolpanel
}
//------------------------------------------------------------------------------------------------------------------
- void TaskPaneToolPanel::Show()
+ void TaskPaneToolPanel::Activate( ::Window& i_rParentWindow )
{
Window* pPanelWindow( getPanelWindow() );
ENSURE_OR_RETURN_VOID( pPanelWindow, "no window to show" );
+ pPanelWindow->SetPosSizePixel( Point(), i_rParentWindow.GetSizePixel() );
pPanelWindow->Show();
}
//------------------------------------------------------------------------------------------------------------------
- void TaskPaneToolPanel::Hide()
+ void TaskPaneToolPanel::Deactivate()
{
Window* pPanelWindow( getPanelWindow() );
ENSURE_OR_RETURN_VOID( pPanelWindow, "no window to hide" );
@@ -99,11 +107,11 @@ namespace sd { namespace toolpanel
}
//------------------------------------------------------------------------------------------------------------------
- void TaskPaneToolPanel::SetPosSizePixel( const Rectangle& i_rPanelPlayground )
+ void TaskPaneToolPanel::SetSizePixel( const Size& i_rPanelWindowSize )
{
Window* pPanelWindow( getPanelWindow() );
- ENSURE_OR_RETURN_VOID( pPanelWindow, "no window to position" );
- pPanelWindow->SetPosSizePixel( i_rPanelPlayground.TopLeft(), i_rPanelPlayground.GetSize() );
+ ENSURE_OR_RETURN_VOID( pPanelWindow, "no window to resize" );
+ pPanelWindow->SetSizePixel( i_rPanelWindowSize );
}
//------------------------------------------------------------------------------------------------------------------
@@ -115,14 +123,6 @@ namespace sd { namespace toolpanel
}
//------------------------------------------------------------------------------------------------------------------
- bool TaskPaneToolPanel::HasFocus() const
- {
- Window* pPanelWindow( getPanelWindow() );
- ENSURE_OR_RETURN_FALSE( pPanelWindow, "no window to ask" );
- return pPanelWindow->HasChildPathFocus();
- }
-
- //------------------------------------------------------------------------------------------------------------------
void TaskPaneToolPanel::Dispose()
{
ENSURE_OR_RETURN_VOID( m_pPanelDeck, "disposed twice" );
diff --git a/sd/source/ui/toolpanel/TaskPaneToolPanel.hxx b/sd/source/ui/toolpanel/TaskPaneToolPanel.hxx
index 8fad423d1c79..7cf60b10325e 100644
--- a/sd/source/ui/toolpanel/TaskPaneToolPanel.hxx
+++ b/sd/source/ui/toolpanel/TaskPaneToolPanel.hxx
@@ -65,11 +65,10 @@ namespace sd { namespace toolpanel
// IToolPanel overridables
virtual ::rtl::OUString GetDisplayName() const;
virtual Image GetImage() const;
- virtual void Show();
- virtual void Hide();
- virtual void SetPosSizePixel( const Rectangle& i_rPanelPlayground );
+ virtual void Activate( ::Window& i_rParentWindow );
+ virtual void Deactivate();
+ virtual void SetSizePixel( const Size& i_rPanelWindowSize );
virtual void GrabFocus();
- virtual bool HasFocus() const;
virtual void Dispose();
// own overridables
@@ -78,7 +77,7 @@ namespace sd { namespace toolpanel
protected:
bool isDisposed() const { return m_pPanelDeck == NULL; }
- ToolPanelDeck& getPanelDeck() { OSL_ENSURE( !isDisposed(), "already disposed!" ); return *m_pPanelDeck; }
+ Window& getPanelWindowAnchor();
private:
ToolPanelDeck* m_pPanelDeck;