Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #include "TabBar.hxx"
21 : #include <sfx2/sidebar/SidebarChildWindow.hxx>
22 : #include "SidebarDockingWindow.hxx"
23 : #include <sfx2/sfxsids.hrc>
24 : #include "helpid.hrc"
25 : #include <sfx2/dockwin.hxx>
26 : #include <sfx2/sidebar/ResourceDefinitions.hrc>
27 :
28 :
29 : namespace sfx2 { namespace sidebar {
30 :
31 :
32 0 : SFX_IMPL_DOCKINGWINDOW_WITHID(SidebarChildWindow, SID_SIDEBAR);
33 :
34 :
35 0 : SidebarChildWindow::SidebarChildWindow (
36 : Window* pParentWindow,
37 : sal_uInt16 nId,
38 : SfxBindings* pBindings,
39 : SfxChildWinInfo* pInfo)
40 0 : : SfxChildWindow(pParentWindow, nId)
41 : {
42 : this->pWindow = new SidebarDockingWindow(
43 : pBindings,
44 : *this,
45 : pParentWindow,
46 0 : WB_STDDOCKWIN | WB_OWNERDRAWDECORATION | WB_CLIPCHILDREN | WB_SIZEABLE | WB_3DLOOK | WB_ROLLABLE);
47 0 : eChildAlignment = SFX_ALIGN_RIGHT;
48 :
49 0 : this->pWindow->SetHelpId(HID_SIDEBAR_WINDOW);
50 0 : this->pWindow->SetOutputSizePixel(Size(GetDefaultWidth(this->pWindow), 450));
51 :
52 0 : SfxDockingWindow* pDockingParent = dynamic_cast<SfxDockingWindow*>(this->pWindow);
53 0 : if (pDockingParent != NULL)
54 0 : pDockingParent->Initialize(pInfo);
55 0 : SetHideNotDelete(true);
56 :
57 0 : this->pWindow->Show();
58 0 : }
59 :
60 :
61 :
62 :
63 0 : sal_Int32 SidebarChildWindow::GetDefaultWidth (Window* pWindow)
64 : {
65 0 : if (pWindow != NULL)
66 : {
67 : // Width of the paragraph panel.
68 : const static sal_Int32 nMaxPropertyPageWidth (115);
69 :
70 0 : return pWindow->LogicToPixel(Point(nMaxPropertyPageWidth,1), MAP_APPFONT).X()
71 0 : + TabBar::GetDefaultWidth() * pWindow->GetDPIScaleFactor();
72 : }
73 : else
74 0 : return 0;
75 : }
76 :
77 :
78 : } } // end of namespace sfx2::sidebar
79 :
80 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|