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 "browserview.hxx"
21 #include "propertyeditor.hxx"
23 #include <propctrlr.h>
24 #include <vcl/event.hxx>
25 #include <vcl/tabpage.hxx>
30 using namespace ::com::sun::star::uno
;
31 using namespace ::com::sun::star::lang
;
33 OPropertyBrowserView::OPropertyBrowserView(vcl::Window
* _pParent
)
34 :Window(_pParent
, WB_3DLOOK
)
37 m_pPropBox
= VclPtr
<OPropertyEditor
>::Create( this );
38 m_pPropBox
->SetHelpId(HID_FM_PROPDLG_TABCTR
);
39 m_pPropBox
->setPageActivationHandler(LINK(this, OPropertyBrowserView
, OnPageActivation
));
45 IMPL_LINK_NOARG(OPropertyBrowserView
, OnPageActivation
, LinkParamNone
*, void)
47 m_nActivePage
= m_pPropBox
->GetCurPage();
48 m_aPageActivationHandler
.Call(nullptr);
52 OPropertyBrowserView::~OPropertyBrowserView()
57 void OPropertyBrowserView::dispose()
61 sal_uInt16 nTmpPage
= m_pPropBox
->GetCurPage();
63 m_nActivePage
= nTmpPage
;
65 m_pPropBox
.disposeAndClear();
66 vcl::Window::dispose();
70 void OPropertyBrowserView::activatePage(sal_uInt16 _nPage
)
72 m_nActivePage
= _nPage
;
73 getPropertyBox().SetPage(m_nActivePage
);
77 void OPropertyBrowserView::GetFocus()
80 m_pPropBox
->GrabFocus();
86 bool OPropertyBrowserView::EventNotify( NotifyEvent
& _rNEvt
)
88 if ( MouseNotifyEvent::KEYINPUT
== _rNEvt
.GetType() )
90 sal_uInt16 nKey
= _rNEvt
.GetKeyEvent()->GetKeyCode().GetCode();
92 if ( ( KEY_DELETE
== nKey
) || ( KEY_BACKSPACE
== nKey
) )
93 // silence this, we don't want to propagate this outside the property
94 // browser, as it will probably do harm there
98 return Window::EventNotify(_rNEvt
);
102 void OPropertyBrowserView::Resize()
104 Size aSize
= GetOutputSizePixel();
105 m_pPropBox
->SetSizePixel(aSize
);
108 css::awt::Size
OPropertyBrowserView::getMinimumSize()
110 Size aSize
= GetOutputSizePixel();
113 aSize
.setHeight( m_pPropBox
->getMinimumHeight() );
114 aSize
.setWidth( m_pPropBox
->getMinimumWidth() );
116 return css::awt::Size( aSize
.Width(), aSize
.Height() );
123 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */