xref: /AOO41X/main/sfx2/source/sidebar/Deck.cxx (revision 52d13b840d5953d0e19a59e3804b0502534d8c83)
122de8995SAndre Fischer /**************************************************************
222de8995SAndre Fischer  *
322de8995SAndre Fischer  * Licensed to the Apache Software Foundation (ASF) under one
422de8995SAndre Fischer  * or more contributor license agreements.  See the NOTICE file
522de8995SAndre Fischer  * distributed with this work for additional information
622de8995SAndre Fischer  * regarding copyright ownership.  The ASF licenses this file
722de8995SAndre Fischer  * to you under the Apache License, Version 2.0 (the
822de8995SAndre Fischer  * "License"); you may not use this file except in compliance
922de8995SAndre Fischer  * with the License.  You may obtain a copy of the License at
1022de8995SAndre Fischer  *
1122de8995SAndre Fischer  *   http://www.apache.org/licenses/LICENSE-2.0
1222de8995SAndre Fischer  *
1322de8995SAndre Fischer  * Unless required by applicable law or agreed to in writing,
1422de8995SAndre Fischer  * software distributed under the License is distributed on an
1522de8995SAndre Fischer  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1622de8995SAndre Fischer  * KIND, either express or implied.  See the License for the
1722de8995SAndre Fischer  * specific language governing permissions and limitations
1822de8995SAndre Fischer  * under the License.
1922de8995SAndre Fischer  *
2022de8995SAndre Fischer  *************************************************************/
2122de8995SAndre Fischer 
2222de8995SAndre Fischer #include "precompiled_sfx2.hxx"
2322de8995SAndre Fischer 
2422de8995SAndre Fischer #include "Deck.hxx"
2522de8995SAndre Fischer #include "DeckDescriptor.hxx"
267a32b0c8SAndre Fischer #include "DeckLayouter.hxx"
27ff12d537SAndre Fischer #include "DrawHelper.hxx"
28ff12d537SAndre Fischer #include "DeckTitleBar.hxx"
29b9e67834SAndre Fischer #include "Paint.hxx"
30ff12d537SAndre Fischer #include "Panel.hxx"
317a32b0c8SAndre Fischer #include "ToolBoxBackground.hxx"
32f35c6d02SAndre Fischer #include "sfx2/sidebar/Tools.hxx"
33b9e67834SAndre Fischer #include "sfx2/sidebar/Theme.hxx"
34ff12d537SAndre Fischer 
357a32b0c8SAndre Fischer #include <vcl/dockwin.hxx>
367a32b0c8SAndre Fischer #include <vcl/scrbar.hxx>
3795a18594SAndre Fischer #include <tools/svborder.hxx>
3822de8995SAndre Fischer 
397a32b0c8SAndre Fischer #include <boost/bind.hpp>
407a32b0c8SAndre Fischer 
417a32b0c8SAndre Fischer using namespace ::com::sun::star;
427a32b0c8SAndre Fischer using namespace ::com::sun::star::uno;
437a32b0c8SAndre Fischer 
4422de8995SAndre Fischer 
45ff12d537SAndre Fischer namespace sfx2 { namespace sidebar {
46ff12d537SAndre Fischer 
47ff12d537SAndre Fischer 
48ff12d537SAndre Fischer namespace {
49ff12d537SAndre Fischer     static const sal_Int32 MinimalPanelHeight (25);
50ff12d537SAndre Fischer }
51ff12d537SAndre Fischer 
52ff12d537SAndre Fischer 
5322de8995SAndre Fischer Deck::Deck (
5422de8995SAndre Fischer     const DeckDescriptor& rDeckDescriptor,
557a32b0c8SAndre Fischer     Window* pParentWindow,
567a32b0c8SAndre Fischer     const ::boost::function<void(void)>& rCloserAction)
5765908a7eSAndre Fischer     : Window(pParentWindow, 0),
5822de8995SAndre Fischer       msId(rDeckDescriptor.msId),
59ff12d537SAndre Fischer       maIcon(),
60ff12d537SAndre Fischer       msIconURL(rDeckDescriptor.msIconURL),
61ff12d537SAndre Fischer       msHighContrastIconURL(rDeckDescriptor.msHighContrastIconURL),
62b9e67834SAndre Fischer       maPanels(),
637a32b0c8SAndre Fischer       mpTitleBar(new DeckTitleBar(rDeckDescriptor.msTitle, this, rCloserAction)),
647a32b0c8SAndre Fischer       mpScrollClipWindow(new Window(this)),
657a32b0c8SAndre Fischer       mpScrollContainer(new ScrollContainerWindow(mpScrollClipWindow.get())),
667a32b0c8SAndre Fischer       mpFiller(new Window(this)),
677a32b0c8SAndre Fischer       mpVerticalScrollBar(new ScrollBar(this))
6822de8995SAndre Fischer {
6922de8995SAndre Fischer     SetBackground(Wallpaper());
707a32b0c8SAndre Fischer 
717a32b0c8SAndre Fischer     mpScrollClipWindow->SetBackground(Wallpaper());
7265908a7eSAndre Fischer     mpScrollClipWindow->Show();
7365908a7eSAndre Fischer 
7465908a7eSAndre Fischer     mpScrollContainer->SetStyle(mpScrollContainer->GetStyle() | WB_DIALOGCONTROL);
757a32b0c8SAndre Fischer     mpScrollContainer->SetBackground(Wallpaper());
7665908a7eSAndre Fischer     mpScrollContainer->Show();
777a32b0c8SAndre Fischer 
787a32b0c8SAndre Fischer     mpVerticalScrollBar->SetScrollHdl(LINK(this, Deck, HandleVerticalScrollBarChange));
797a32b0c8SAndre Fischer 
807a32b0c8SAndre Fischer #ifdef DEBUG
817a32b0c8SAndre Fischer     SetText(A2S("Deck"));
827a32b0c8SAndre Fischer     mpScrollClipWindow->SetText(A2S("ScrollClipWindow"));
837a32b0c8SAndre Fischer     mpFiller->SetText(A2S("Filler"));
847a32b0c8SAndre Fischer     mpVerticalScrollBar->SetText(A2S("VerticalScrollBar"));
857a32b0c8SAndre Fischer #endif
8622de8995SAndre Fischer }
8722de8995SAndre Fischer 
8822de8995SAndre Fischer 
8922de8995SAndre Fischer 
9022de8995SAndre Fischer 
9122de8995SAndre Fischer Deck::~Deck (void)
9222de8995SAndre Fischer {
93ff12d537SAndre Fischer     Dispose();
94f120fe41SAndre Fischer 
95f120fe41SAndre Fischer     // We have to explicitly trigger the destruction of panels.
96f120fe41SAndre Fischer     // Otherwise that is done by one of our base class destructors
97f120fe41SAndre Fischer     // without updating maPanels.
98f120fe41SAndre Fischer     maPanels.clear();
99ff12d537SAndre Fischer }
100ff12d537SAndre Fischer 
101ff12d537SAndre Fischer 
102ff12d537SAndre Fischer 
103ff12d537SAndre Fischer 
104ff12d537SAndre Fischer void Deck::Dispose (void)
105ff12d537SAndre Fischer {
106f120fe41SAndre Fischer     SharedPanelContainer aPanels;
107ff12d537SAndre Fischer     aPanels.swap(maPanels);
108f120fe41SAndre Fischer     for (SharedPanelContainer::iterator
109ff12d537SAndre Fischer              iPanel(aPanels.begin()),
110ff12d537SAndre Fischer              iEnd(aPanels.end());
111ff12d537SAndre Fischer          iPanel!=iEnd;
112ff12d537SAndre Fischer          ++iPanel)
113ff12d537SAndre Fischer     {
114f120fe41SAndre Fischer 		if (*iPanel)
115f120fe41SAndre Fischer         {
116ff12d537SAndre Fischer 			(*iPanel)->Dispose();
117f120fe41SAndre Fischer             OSL_ASSERT(iPanel->unique());
118f120fe41SAndre Fischer             iPanel->reset();
119f120fe41SAndre Fischer         }
120ff12d537SAndre Fischer     }
1217a32b0c8SAndre Fischer 
1227a32b0c8SAndre Fischer     mpTitleBar.reset();
1237a32b0c8SAndre Fischer     mpFiller.reset();
1247a32b0c8SAndre Fischer     mpVerticalScrollBar.reset();
12522de8995SAndre Fischer }
12622de8995SAndre Fischer 
12722de8995SAndre Fischer 
12822de8995SAndre Fischer 
12922de8995SAndre Fischer 
13022de8995SAndre Fischer const ::rtl::OUString& Deck::GetId (void) const
13122de8995SAndre Fischer {
13222de8995SAndre Fischer     return msId;
13322de8995SAndre Fischer }
13422de8995SAndre Fischer 
13522de8995SAndre Fischer 
13622de8995SAndre Fischer 
13722de8995SAndre Fischer 
1387a32b0c8SAndre Fischer DeckTitleBar* Deck::GetTitleBar (void) const
13922de8995SAndre Fischer {
1407a32b0c8SAndre Fischer     return mpTitleBar.get();
14122de8995SAndre Fischer }
14222de8995SAndre Fischer 
14322de8995SAndre Fischer 
14422de8995SAndre Fischer 
14522de8995SAndre Fischer 
146ff12d537SAndre Fischer Rectangle Deck::GetContentArea (void) const
14722de8995SAndre Fischer {
148ff12d537SAndre Fischer     const Size aWindowSize (GetSizePixel());
149b9e67834SAndre Fischer     const int nBorderSize (Theme::GetInteger(Theme::Int_DeckBorderSize));
150ff12d537SAndre Fischer 
151ff12d537SAndre Fischer     return Rectangle(
152b9e67834SAndre Fischer         Theme::GetInteger(Theme::Int_DeckLeftPadding) + nBorderSize,
153b9e67834SAndre Fischer         Theme::GetInteger(Theme::Int_DeckTopPadding) + nBorderSize,
154b9e67834SAndre Fischer         aWindowSize.Width() - 1 - Theme::GetInteger(Theme::Int_DeckRightPadding) - nBorderSize,
155b9e67834SAndre Fischer         aWindowSize.Height() - 1 - Theme::GetInteger(Theme::Int_DeckBottomPadding) - nBorderSize);
15622de8995SAndre Fischer }
15722de8995SAndre Fischer 
15822de8995SAndre Fischer 
159ff12d537SAndre Fischer 
160ff12d537SAndre Fischer 
161ff12d537SAndre Fischer ::rtl::OUString Deck::GetIconURL (const bool bIsHighContrastModeActive) const
162ff12d537SAndre Fischer {
163ff12d537SAndre Fischer     if (bIsHighContrastModeActive)
164ff12d537SAndre Fischer         return msHighContrastIconURL;
165ff12d537SAndre Fischer     else
166ff12d537SAndre Fischer         return msIconURL;
167ff12d537SAndre Fischer }
168ff12d537SAndre Fischer 
169ff12d537SAndre Fischer 
170ff12d537SAndre Fischer 
171ff12d537SAndre Fischer 
172ff12d537SAndre Fischer void Deck::Paint (const Rectangle& rUpdateArea)
173ff12d537SAndre Fischer {
17495a18594SAndre Fischer     (void) rUpdateArea;
17595a18594SAndre Fischer 
176ff12d537SAndre Fischer     const Size aWindowSize (GetSizePixel());
177b9e67834SAndre Fischer     const SvBorder aPadding (
178b9e67834SAndre Fischer             Theme::GetInteger(Theme::Int_DeckLeftPadding),
179b9e67834SAndre Fischer             Theme::GetInteger(Theme::Int_DeckTopPadding),
180b9e67834SAndre Fischer             Theme::GetInteger(Theme::Int_DeckRightPadding),
181b9e67834SAndre Fischer             Theme::GetInteger(Theme::Int_DeckBottomPadding));
182ff12d537SAndre Fischer 
183ff12d537SAndre Fischer     // Paint deck background outside the border.
184b9e67834SAndre Fischer     Rectangle aBox(
185ff12d537SAndre Fischer         0,
186ff12d537SAndre Fischer         0,
187ff12d537SAndre Fischer         aWindowSize.Width() - 1,
188b9e67834SAndre Fischer         aWindowSize.Height() - 1);
189ff12d537SAndre Fischer     DrawHelper::DrawBorder(
190ff12d537SAndre Fischer         *this,
191b9e67834SAndre Fischer         aBox,
192b9e67834SAndre Fischer         aPadding,
193b9e67834SAndre Fischer         Theme::GetPaint(Theme::Paint_DeckBackground),
194b9e67834SAndre Fischer         Theme::GetPaint(Theme::Paint_DeckBackground));
195b9e67834SAndre Fischer 
196b9e67834SAndre Fischer     // Paint the border.
197b9e67834SAndre Fischer     const int nBorderSize (Theme::GetInteger(Theme::Int_DeckBorderSize));
198b9e67834SAndre Fischer     aBox.Left() += aPadding.Left();
199b9e67834SAndre Fischer     aBox.Top() += aPadding.Top();
200b9e67834SAndre Fischer     aBox.Right() -= aPadding.Right();
201b9e67834SAndre Fischer     aBox.Bottom() -= aPadding.Bottom();
202b9e67834SAndre Fischer     const sfx2::sidebar::Paint& rHorizontalBorderPaint (Theme::GetPaint(Theme::Paint_HorizontalBorder));
203b9e67834SAndre Fischer     DrawHelper::DrawBorder(
204b9e67834SAndre Fischer         *this,
205b9e67834SAndre Fischer         aBox,
206ff12d537SAndre Fischer         SvBorder(nBorderSize, nBorderSize, nBorderSize, nBorderSize),
207b9e67834SAndre Fischer         rHorizontalBorderPaint,
208b9e67834SAndre Fischer         Theme::GetPaint(Theme::Paint_VerticalBorder));
209b9e67834SAndre Fischer }
210b9e67834SAndre Fischer 
211b9e67834SAndre Fischer 
212b9e67834SAndre Fischer 
213b9e67834SAndre Fischer 
214b9e67834SAndre Fischer void Deck::DataChanged (const DataChangedEvent& rEvent)
215b9e67834SAndre Fischer {
216b9e67834SAndre Fischer     (void)rEvent;
217b9e67834SAndre Fischer     RequestLayout();
218ff12d537SAndre Fischer }
219ff12d537SAndre Fischer 
220ff12d537SAndre Fischer 
221ff12d537SAndre Fischer 
222ff12d537SAndre Fischer 
223f120fe41SAndre Fischer void Deck::SetPanels (const SharedPanelContainer& rPanels)
224ff12d537SAndre Fischer {
225f120fe41SAndre Fischer     maPanels = rPanels;
226ff12d537SAndre Fischer 
227ff12d537SAndre Fischer     RequestLayout();
228ff12d537SAndre Fischer }
229ff12d537SAndre Fischer 
230ff12d537SAndre Fischer 
231ff12d537SAndre Fischer 
232ff12d537SAndre Fischer 
233f120fe41SAndre Fischer const SharedPanelContainer& Deck::GetPanels (void) const
234f120fe41SAndre Fischer {
235f120fe41SAndre Fischer     return maPanels;
236f120fe41SAndre Fischer }
237f120fe41SAndre Fischer 
238f120fe41SAndre Fischer 
239f120fe41SAndre Fischer 
240f120fe41SAndre Fischer 
241ff12d537SAndre Fischer void Deck::RequestLayout (void)
242ff12d537SAndre Fischer {
2438403f08eSAndre Fischer     //    PrintWindowTree();
244ff12d537SAndre Fischer 
2457a32b0c8SAndre Fischer     DeckLayouter::LayoutDeck(
2467a32b0c8SAndre Fischer         GetContentArea(),
2477a32b0c8SAndre Fischer         maPanels,
2487a32b0c8SAndre Fischer         *GetTitleBar(),
2497a32b0c8SAndre Fischer         *mpScrollClipWindow,
2507a32b0c8SAndre Fischer         *mpScrollContainer,
2517a32b0c8SAndre Fischer         *mpFiller,
2527a32b0c8SAndre Fischer         *mpVerticalScrollBar);
253ff12d537SAndre Fischer 
254ff12d537SAndre Fischer     Invalidate();
255ff12d537SAndre Fischer }
256ff12d537SAndre Fischer 
257ff12d537SAndre Fischer 
258ff12d537SAndre Fischer 
259ff12d537SAndre Fischer 
2607a32b0c8SAndre Fischer ::Window* Deck::GetPanelParentWindow (void)
261ff12d537SAndre Fischer {
2627a32b0c8SAndre Fischer     return mpScrollContainer.get();
2637a32b0c8SAndre Fischer }
264ff12d537SAndre Fischer 
265b9e67834SAndre Fischer 
2667a32b0c8SAndre Fischer 
2677a32b0c8SAndre Fischer 
268*52d13b84SAndre Fischer void Deck::ShowPanel (const Panel& rPanel)
269*52d13b84SAndre Fischer {
270*52d13b84SAndre Fischer     if (mpVerticalScrollBar && mpVerticalScrollBar->IsVisible())
271*52d13b84SAndre Fischer     {
272*52d13b84SAndre Fischer         // Get vertical extent of the panel.
273*52d13b84SAndre Fischer         sal_Int32 nPanelTop (rPanel.GetPosPixel().Y());
274*52d13b84SAndre Fischer         const sal_Int32 nPanelBottom (nPanelTop + rPanel.GetSizePixel().Height() - 1);
275*52d13b84SAndre Fischer         // Add the title bar into the extent.
276*52d13b84SAndre Fischer         if (rPanel.GetTitleBar() != NULL && rPanel.GetTitleBar()->IsVisible())
277*52d13b84SAndre Fischer             nPanelTop = rPanel.GetTitleBar()->GetPosPixel().Y();
278*52d13b84SAndre Fischer 
279*52d13b84SAndre Fischer 
280*52d13b84SAndre Fischer         // Determine what the new thumb position should be like.
281*52d13b84SAndre Fischer         // When the whole panel does not fit then make its top visible
282*52d13b84SAndre Fischer         // and it off at the bottom.
283*52d13b84SAndre Fischer         sal_Int32 nNewThumbPos (mpVerticalScrollBar->GetThumbPos());
284*52d13b84SAndre Fischer         if (nPanelBottom >= nNewThumbPos+mpVerticalScrollBar->GetVisibleSize())
285*52d13b84SAndre Fischer             nNewThumbPos = nPanelBottom - mpVerticalScrollBar->GetVisibleSize();
286*52d13b84SAndre Fischer         if (nPanelTop < nNewThumbPos)
287*52d13b84SAndre Fischer             nNewThumbPos = nPanelTop;
288*52d13b84SAndre Fischer 
289*52d13b84SAndre Fischer         mpVerticalScrollBar->SetThumbPos(nNewThumbPos);
290*52d13b84SAndre Fischer         mpScrollContainer->SetPosPixel(
291*52d13b84SAndre Fischer             Point(
292*52d13b84SAndre Fischer                 mpScrollContainer->GetPosPixel().X(),
293*52d13b84SAndre Fischer                 -nNewThumbPos));
294*52d13b84SAndre Fischer 
295*52d13b84SAndre Fischer     }
296*52d13b84SAndre Fischer }
297*52d13b84SAndre Fischer 
298*52d13b84SAndre Fischer 
299*52d13b84SAndre Fischer 
300*52d13b84SAndre Fischer 
3017a32b0c8SAndre Fischer const char* GetWindowClassification (const Window* pWindow)
302ff12d537SAndre Fischer {
3037a32b0c8SAndre Fischer     const String& rsName (pWindow->GetText());
3047a32b0c8SAndre Fischer     if (rsName.Len() > 0)
3057a32b0c8SAndre Fischer     {
3067a32b0c8SAndre Fischer         return ::rtl::OUStringToOString(rsName, RTL_TEXTENCODING_ASCII_US).getStr();
307ff12d537SAndre Fischer     }
308ff12d537SAndre Fischer     else
309ff12d537SAndre Fischer     {
3107a32b0c8SAndre Fischer         static char msWindow[] = "window";
3117a32b0c8SAndre Fischer         return msWindow;
312ff12d537SAndre Fischer     }
313ff12d537SAndre Fischer }
314ff12d537SAndre Fischer 
315ff12d537SAndre Fischer 
3167a32b0c8SAndre Fischer void Deck::PrintWindowSubTree (Window* pRoot, int nIndentation)
317ff12d537SAndre Fischer {
31845da7d5eSAndre Fischer     static const char* sIndentation = "                                                                  ";
3197a32b0c8SAndre Fischer     const Point aLocation (pRoot->GetPosPixel());
3207a32b0c8SAndre Fischer     const Size aSize (pRoot->GetSizePixel());
3217a32b0c8SAndre Fischer     const char* sClassification = GetWindowClassification(pRoot);
3227a32b0c8SAndre Fischer     const char* sVisible = pRoot->IsVisible() ? "visible" : "hidden";
3237a32b0c8SAndre Fischer     OSL_TRACE("%s%x %s %s +%d+%d x%dx%d",
3247a32b0c8SAndre Fischer         sIndentation+strlen(sIndentation)-nIndentation*4,
3257a32b0c8SAndre Fischer         pRoot,
3267a32b0c8SAndre Fischer         sClassification,
3277a32b0c8SAndre Fischer         sVisible,
3287a32b0c8SAndre Fischer         aLocation.X(),aLocation.Y(),
3297a32b0c8SAndre Fischer         aSize.Width(),aSize.Height());
330b9e67834SAndre Fischer 
3317a32b0c8SAndre Fischer     const sal_uInt16 nChildCount (pRoot->GetChildCount());
3327a32b0c8SAndre Fischer     for (sal_uInt16 nIndex=0; nIndex<nChildCount; ++nIndex)
3337a32b0c8SAndre Fischer         PrintWindowSubTree(pRoot->GetChild(nIndex), nIndentation+1);
3347a32b0c8SAndre Fischer }
335ff12d537SAndre Fischer 
3367a32b0c8SAndre Fischer 
3377a32b0c8SAndre Fischer 
3387a32b0c8SAndre Fischer 
3397a32b0c8SAndre Fischer void Deck::PrintWindowTree (void)
340ff12d537SAndre Fischer {
3417a32b0c8SAndre Fischer     PrintWindowSubTree(this, 0);
3427a32b0c8SAndre Fischer }
34395a18594SAndre Fischer 
344ff12d537SAndre Fischer 
345ff12d537SAndre Fischer 
3467a32b0c8SAndre Fischer 
3477a32b0c8SAndre Fischer void Deck::PrintWindowTree (const ::std::vector<Panel*>& rPanels)
348ff12d537SAndre Fischer {
3497a32b0c8SAndre Fischer     (void)rPanels;
3507a32b0c8SAndre Fischer 
3517a32b0c8SAndre Fischer     PrintWindowTree();
3527a32b0c8SAndre Fischer }
3537a32b0c8SAndre Fischer 
3547a32b0c8SAndre Fischer 
3557a32b0c8SAndre Fischer 
3567a32b0c8SAndre Fischer 
3577a32b0c8SAndre Fischer IMPL_LINK(Deck, HandleVerticalScrollBarChange,void*, EMPTYARG)
358ff12d537SAndre Fischer {
3597a32b0c8SAndre Fischer     const sal_Int32 nYOffset (-mpVerticalScrollBar->GetThumbPos());
3607a32b0c8SAndre Fischer     mpScrollContainer->SetPosPixel(
3617a32b0c8SAndre Fischer         Point(
3627a32b0c8SAndre Fischer             mpScrollContainer->GetPosPixel().X(),
3637a32b0c8SAndre Fischer             nYOffset));
3647a32b0c8SAndre Fischer     return sal_True;
3657a32b0c8SAndre Fischer }
3667a32b0c8SAndre Fischer 
3677a32b0c8SAndre Fischer 
3687a32b0c8SAndre Fischer 
3697a32b0c8SAndre Fischer 
3707a32b0c8SAndre Fischer //----- Deck::ScrollContainerWindow -------------------------------------------
3717a32b0c8SAndre Fischer 
3727a32b0c8SAndre Fischer Deck::ScrollContainerWindow::ScrollContainerWindow (Window* pParentWindow)
3737a32b0c8SAndre Fischer     : Window(pParentWindow),
3747a32b0c8SAndre Fischer       maSeparators()
37595a18594SAndre Fischer {
3767a32b0c8SAndre Fischer #ifdef DEBUG
3777a32b0c8SAndre Fischer     SetText(A2S("ScrollContainerWindow"));
3787a32b0c8SAndre Fischer #endif
379ff12d537SAndre Fischer }
3807a32b0c8SAndre Fischer 
3817a32b0c8SAndre Fischer 
3827a32b0c8SAndre Fischer 
3837a32b0c8SAndre Fischer 
3847a32b0c8SAndre Fischer Deck::ScrollContainerWindow::~ScrollContainerWindow (void)
385ff12d537SAndre Fischer {
38695a18594SAndre Fischer }
3877a32b0c8SAndre Fischer 
3887a32b0c8SAndre Fischer 
3897a32b0c8SAndre Fischer 
3907a32b0c8SAndre Fischer 
3917a32b0c8SAndre Fischer void Deck::ScrollContainerWindow::Paint (const Rectangle& rUpdateArea)
39295a18594SAndre Fischer {
3937a32b0c8SAndre Fischer     (void)rUpdateArea;
394ff12d537SAndre Fischer 
3957a32b0c8SAndre Fischer     // Paint the separators.
3967a32b0c8SAndre Fischer     const sal_Int32 nSeparatorHeight (Theme::GetInteger(Theme::Int_DeckSeparatorHeight));
3977a32b0c8SAndre Fischer     const sal_Int32 nLeft  (0);
3987a32b0c8SAndre Fischer     const sal_Int32 nRight (GetSizePixel().Width()-1);
3997a32b0c8SAndre Fischer     const sfx2::sidebar::Paint& rHorizontalBorderPaint (Theme::GetPaint(Theme::Paint_HorizontalBorder));
4007a32b0c8SAndre Fischer     for (::std::vector<sal_Int32>::const_iterator iY(maSeparators.begin()), iEnd(maSeparators.end());
4017a32b0c8SAndre Fischer          iY!=iEnd;
4027a32b0c8SAndre Fischer          ++iY)
403ff12d537SAndre Fischer     {
4047a32b0c8SAndre Fischer         DrawHelper::DrawHorizontalLine(
4057a32b0c8SAndre Fischer             *this,
4067a32b0c8SAndre Fischer             nLeft,
4077a32b0c8SAndre Fischer             nRight,
4087a32b0c8SAndre Fischer             *iY,
4097a32b0c8SAndre Fischer             nSeparatorHeight,
4107a32b0c8SAndre Fischer             rHorizontalBorderPaint);
4117a32b0c8SAndre Fischer     }
412ff12d537SAndre Fischer }
413ff12d537SAndre Fischer 
4147a32b0c8SAndre Fischer 
4157a32b0c8SAndre Fischer 
4167a32b0c8SAndre Fischer 
4177a32b0c8SAndre Fischer void Deck::ScrollContainerWindow::SetSeparators (const ::std::vector<sal_Int32>& rSeparators)
418ff12d537SAndre Fischer {
4197a32b0c8SAndre Fischer     maSeparators = rSeparators;
420ff12d537SAndre Fischer }
421ff12d537SAndre Fischer 
422ff12d537SAndre Fischer } } // end of namespace sfx2::sidebar
423