Branch data 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 "browserpage.hxx"
21 : :
22 : : //............................................................................
23 : : namespace pcr
24 : : {
25 : : //............................................................................
26 : :
27 : : #define LAYOUT_BORDER_LEFT 3
28 : : #define LAYOUT_BORDER_TOP 3
29 : : #define LAYOUT_BORDER_RIGHT 3
30 : : #define LAYOUT_BORDER_BOTTOM 3
31 : :
32 : : //==================================================================
33 : : // class OBrowserPage
34 : : //==================================================================
35 : : //------------------------------------------------------------------
36 : 0 : OBrowserPage::OBrowserPage(Window* pParent,WinBits nWinStyle)
37 : : :TabPage(pParent,nWinStyle)
38 : 0 : ,m_aListBox(this)
39 : : {
40 : 0 : m_aListBox.SetBackground(GetBackground());
41 : 0 : m_aListBox.SetPaintTransparent( sal_True );
42 : 0 : m_aListBox.Show();
43 : 0 : }
44 : :
45 : : //------------------------------------------------------------------
46 : 0 : OBrowserPage::~OBrowserPage()
47 : : {
48 : 0 : }
49 : :
50 : : //------------------------------------------------------------------
51 : 0 : void OBrowserPage::Resize()
52 : : {
53 : 0 : Size aSize( GetOutputSizePixel() );
54 : 0 : aSize.Width() -= LAYOUT_BORDER_LEFT + LAYOUT_BORDER_RIGHT;
55 : 0 : aSize.Height() -= LAYOUT_BORDER_TOP + LAYOUT_BORDER_BOTTOM;
56 : 0 : m_aListBox.SetPosSizePixel( Point( LAYOUT_BORDER_LEFT, LAYOUT_BORDER_TOP ), aSize );
57 : 0 : }
58 : :
59 : : //------------------------------------------------------------------
60 : 0 : OBrowserListBox& OBrowserPage::getListBox()
61 : : {
62 : 0 : return m_aListBox;
63 : : }
64 : :
65 : : //------------------------------------------------------------------
66 : 0 : const OBrowserListBox& OBrowserPage::getListBox() const
67 : : {
68 : 0 : return m_aListBox;
69 : : }
70 : :
71 : : //------------------------------------------------------------------
72 : 0 : void OBrowserPage::StateChanged(StateChangedType nType)
73 : : {
74 : 0 : Window::StateChanged( nType);
75 : 0 : if (STATE_CHANGE_VISIBLE == nType)
76 : 0 : m_aListBox.ActivateListBox(IsVisible());
77 : 0 : }
78 : :
79 : : //------------------------------------------------------------------
80 : 0 : sal_Int32 OBrowserPage::getMinimumWidth()
81 : : {
82 : 0 : return m_aListBox.GetMinimumWidth() + LAYOUT_BORDER_LEFT + LAYOUT_BORDER_RIGHT;
83 : : }
84 : :
85 : : //------------------------------------------------------------------
86 : 0 : sal_Int32 OBrowserPage::getMinimumHeight()
87 : : {
88 : 0 : return m_aListBox.GetMinimumHeight() + LAYOUT_BORDER_TOP + LAYOUT_BORDER_BOTTOM;
89 : : }
90 : :
91 : : //............................................................................
92 : : } // namespace pcr
93 : : //............................................................................
94 : :
95 : :
96 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|