1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include "browserpage.hxx"
24 #define LAYOUT_BORDER_LEFT 3
25 #define LAYOUT_BORDER_TOP 3
26 #define LAYOUT_BORDER_RIGHT 3
27 #define LAYOUT_BORDER_BOTTOM 3
29 OBrowserPage::OBrowserPage(vcl::Window
* pParent
)
31 ,m_aListBox(VclPtr
<OBrowserListBox
>::Create(this))
33 m_aListBox
->SetBackground(GetBackground());
34 m_aListBox
->SetPaintTransparent( true );
38 OBrowserPage::~OBrowserPage()
43 void OBrowserPage::dispose()
45 m_aListBox
.disposeAndClear();
49 void OBrowserPage::Resize()
51 Size
aSize( GetOutputSizePixel() );
52 aSize
.AdjustWidth( -(LAYOUT_BORDER_LEFT
+ LAYOUT_BORDER_RIGHT
) );
53 aSize
.AdjustHeight( -(LAYOUT_BORDER_TOP
+ LAYOUT_BORDER_BOTTOM
) );
54 m_aListBox
->SetPosSizePixel( Point( LAYOUT_BORDER_LEFT
, LAYOUT_BORDER_TOP
), aSize
);
57 void OBrowserPage::StateChanged(StateChangedType nType
)
59 Window::StateChanged( nType
);
60 if (StateChangedType::Visible
== nType
&& m_aListBox
)
61 m_aListBox
->ActivateListBox(IsVisible());
64 sal_Int32
OBrowserPage::getMinimumWidth() const
66 return m_aListBox
->GetMinimumWidth() + LAYOUT_BORDER_LEFT
+ LAYOUT_BORDER_RIGHT
;
69 sal_Int32
OBrowserPage::getMinimumHeight()
71 return m_aListBox
->GetMinimumHeight() + LAYOUT_BORDER_TOP
+ LAYOUT_BORDER_BOTTOM
;
76 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */