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 <strings.hrc>
23 #include <ObjectCatalog.hxx>
26 #include <vcl/taskpanelist.hxx>
30 ObjectCatalog::ObjectCatalog(vcl::Window
* pParent
)
31 : DockingWindow(pParent
, "modules/BasicIDE/ui/dockingorganizer.ui", "DockingOrganizer")
33 m_xTitle
= m_xBuilder
->weld_label("title");
34 m_xTree
.reset(new SbTreeListBox(m_xBuilder
->weld_tree_view("libraries"), GetFrameWeld()));
36 SetHelpId("basctl:FloatingWindow:RID_BASICIDE_OBJCAT");
37 SetText(IDEResId(RID_BASICIDE_OBJCAT
));
40 m_xTitle
->set_label(IDEResId(RID_BASICIDE_OBJCAT
));
43 weld::TreeView
& rWidget
= m_xTree
->get_widget();
45 rWidget
.set_help_id(HID_BASICIDE_OBJECTCAT
);
46 m_xTree
->ScanAllEntries();
49 // make object catalog keyboard accessible
50 GetParent()->GetSystemWindow()->GetTaskPaneList()->AddWindow(this);
53 ObjectCatalog::~ObjectCatalog() { disposeOnce(); }
55 void ObjectCatalog::dispose()
57 GetParent()->GetSystemWindow()->GetTaskPaneList()->RemoveWindow(this);
60 DockingWindow::dispose();
63 // ToggleFloatingMode() -- called by DockingWindow when IsFloatingMode() changes
64 void ObjectCatalog::ToggleFloatingMode()
67 DockingWindow::ToggleFloatingMode();
69 bool const bFloating
= IsFloatingMode();
70 // tdf#152154: m_xTitle will be null during disposing
72 m_xTitle
->set_visible(!bFloating
);
75 void ObjectCatalog::SetCurrentEntry(BaseWindow
* pCurWin
)
77 EntryDescriptor aDescriptor
;
79 aDescriptor
= pCurWin
->CreateEntryDescriptor();
80 m_xTree
->SetCurrentEntry(aDescriptor
);
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */