xref: /AOO41X/main/extensions/source/propctrlr/browserpage.cxx (revision 2a97ec55f1442d65917e8c8b82a55ab76c9ff676)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_extensions.hxx"
26 #include "browserpage.hxx"
27 
28 //............................................................................
29 namespace pcr
30 {
31 //............................................................................
32 
33     #define LAYOUT_BORDER_LEFT      3
34     #define LAYOUT_BORDER_TOP       3
35     #define LAYOUT_BORDER_RIGHT     3
36     #define LAYOUT_BORDER_BOTTOM    3
37 
38     //==================================================================
39     // class OBrowserPage
40     //==================================================================
41     //------------------------------------------------------------------
OBrowserPage(Window * pParent,WinBits nWinStyle)42     OBrowserPage::OBrowserPage(Window* pParent,WinBits nWinStyle)
43             :TabPage(pParent,nWinStyle)
44             ,m_aListBox(this)
45     {
46         m_aListBox.SetBackground(GetBackground());
47         m_aListBox.SetPaintTransparent( sal_True );
48         m_aListBox.Show();
49     }
50 
51     //------------------------------------------------------------------
~OBrowserPage()52     OBrowserPage::~OBrowserPage()
53     {
54     }
55 
56     //------------------------------------------------------------------
Resize()57     void OBrowserPage::Resize()
58     {
59         Size aSize( GetOutputSizePixel() );
60         aSize.Width() -= LAYOUT_BORDER_LEFT + LAYOUT_BORDER_RIGHT;
61         aSize.Height() -= LAYOUT_BORDER_TOP + LAYOUT_BORDER_BOTTOM;
62         m_aListBox.SetPosSizePixel( Point( LAYOUT_BORDER_LEFT, LAYOUT_BORDER_TOP ), aSize );
63     }
64 
65     //------------------------------------------------------------------
getListBox()66     OBrowserListBox& OBrowserPage::getListBox()
67     {
68         return m_aListBox;
69     }
70 
71     //------------------------------------------------------------------
getListBox() const72     const OBrowserListBox& OBrowserPage::getListBox() const
73     {
74         return m_aListBox;
75     }
76 
77     //------------------------------------------------------------------
StateChanged(StateChangedType nType)78     void OBrowserPage::StateChanged(StateChangedType nType)
79     {
80         Window::StateChanged( nType);
81         if (STATE_CHANGE_VISIBLE == nType)
82             m_aListBox.ActivateListBox(IsVisible());
83     }
84 
85     //------------------------------------------------------------------
getMinimumWidth()86     sal_Int32 OBrowserPage::getMinimumWidth()
87     {
88         return m_aListBox.GetMinimumWidth() + LAYOUT_BORDER_LEFT + LAYOUT_BORDER_RIGHT;
89     }
90 
91     //------------------------------------------------------------------
getMinimumHeight()92     sal_Int32 OBrowserPage::getMinimumHeight()
93     {
94         return m_aListBox.GetMinimumHeight() + LAYOUT_BORDER_TOP + LAYOUT_BORDER_BOTTOM;
95     }
96 
97 //............................................................................
98 } // namespace pcr
99 //............................................................................
100 
101 
102