tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / chart2 / source / controller / dialogs / res_BarGeometry.cxx
blob927906b06915f66f4c8cdc0899559809424de300
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 <res_BarGeometry.hxx>
21 #include <ResId.hxx>
22 #include <chart.hrc>
24 namespace chart
26 BarGeometryResources::BarGeometryResources(weld::Builder* pBuilder)
27 : m_xFT_Geometry(pBuilder->weld_label(u"shapeft"_ustr))
28 , m_xLB_Geometry(pBuilder->weld_tree_view(u"shape"_ustr))
30 for (size_t i = 0; i < std::size(CHART_TYPE); ++i)
31 m_xLB_Geometry->append_text(SchResId(CHART_TYPE[i]));
32 m_xLB_Geometry->set_size_request(-1, m_xLB_Geometry->get_height_rows(std::size(CHART_TYPE)));
35 void BarGeometryResources::connect_changed(const Link<weld::TreeView&, void>& rLink)
37 m_xLB_Geometry->connect_selection_changed(rLink);
40 void BarGeometryResources::set_visible(bool bShow)
42 m_xFT_Geometry->set_visible(bShow);
43 m_xLB_Geometry->set_visible(bShow);
46 void BarGeometryResources::set_sensitive(bool bEnable)
48 m_xFT_Geometry->set_sensitive(bEnable);
49 m_xLB_Geometry->set_sensitive(bEnable);
52 sal_Int32 BarGeometryResources::get_selected_index() const
54 return m_xLB_Geometry->get_selected_index();
57 void BarGeometryResources::select(sal_Int32 nPos)
59 if (nPos < m_xLB_Geometry->n_children())
60 m_xLB_Geometry->select(nPos);
63 } //namespace chart
65 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */