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/bindings.hxx>
22 : #include <sfx2/sidebar/SidebarChildWindow.hxx>
23 : #include "SidebarDockingWindow.hxx"
24 : #include <sfx2/sfxsids.hrc>
25 : #include "helpid.hrc"
26 : #include <sfx2/dockwin.hxx>
27 : #include <sfx2/sidebar/ResourceDefinitions.hrc>
28 :
29 :
30 : namespace sfx2 { namespace sidebar {
31 :
32 :
33 9908 : SFX_IMPL_DOCKINGWINDOW_WITHID(SidebarChildWindow, SID_SIDEBAR);
34 :
35 :
36 4700 : SidebarChildWindow::SidebarChildWindow (
37 : vcl::Window* pParentWindow,
38 : sal_uInt16 nId,
39 : SfxBindings* pBindings,
40 : SfxChildWinInfo* pInfo)
41 4700 : : SfxChildWindow(pParentWindow, nId)
42 : {
43 : this->pWindow = new SidebarDockingWindow(
44 : pBindings,
45 : *this,
46 : pParentWindow,
47 4700 : WB_STDDOCKWIN | WB_OWNERDRAWDECORATION | WB_CLIPCHILDREN | WB_SIZEABLE | WB_3DLOOK | WB_ROLLABLE);
48 4700 : eChildAlignment = SFX_ALIGN_RIGHT;
49 :
50 4700 : this->pWindow->SetHelpId(HID_SIDEBAR_WINDOW);
51 4700 : this->pWindow->SetOutputSizePixel(Size(GetDefaultWidth(this->pWindow), 450));
52 :
53 4700 : SfxDockingWindow* pDockingParent = dynamic_cast<SfxDockingWindow*>(this->pWindow);
54 4700 : if (pDockingParent != NULL)
55 4700 : pDockingParent->Initialize(pInfo);
56 4700 : SetHideNotDelete(true);
57 :
58 4700 : this->pWindow->Show();
59 4700 : }
60 :
61 :
62 :
63 :
64 4700 : sal_Int32 SidebarChildWindow::GetDefaultWidth (vcl::Window* pWindow)
65 : {
66 4700 : if (pWindow != NULL)
67 : {
68 : // Width of the paragraph panel.
69 : const static sal_Int32 nMaxPropertyPageWidth (115);
70 :
71 9400 : return pWindow->LogicToPixel(Point(nMaxPropertyPageWidth,1), MAP_APPFONT).X()
72 4700 : + TabBar::GetDefaultWidth() * pWindow->GetDPIScaleFactor();
73 : }
74 : else
75 0 : return 0;
76 : }
77 :
78 :
79 951 : } } // end of namespace sfx2::sidebar
80 :
81 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|