| 1 |
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
| 2 |
/* |
| 3 |
* This file is part of the LibreOffice project. |
| 4 |
* |
| 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/. |
| 8 |
* |
| 9 |
* This file incorporates work covered by the following license notice: |
| 10 |
* |
| 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 . |
| 18 |
*/ |
| 19 |
|
| 20 |
#include <res_BarGeometry.hxx> |
| 21 |
#include <ResId.hxx> |
| 22 |
#include <chart.hrc> |
| 23 |
|
| 24 |
namespace chart |
| 25 |
{ |
| 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)) |
| 29 |
{ |
| 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))); |
| 33 |
} |
| 34 |
|
| 35 |
void BarGeometryResources::connect_changed(const Link<weld::TreeView&, void>& rLink) |
| 36 |
{ |
| 37 |
m_xLB_Geometry->connect_selection_changed(rLink); |
| 38 |
} |
| 39 |
|
| 40 |
void BarGeometryResources::set_visible(bool bShow) |
| 41 |
{ |
| 42 |
m_xFT_Geometry->set_visible(bShow); |
| 43 |
m_xLB_Geometry->set_visible(bShow); |
| 44 |
} |
| 45 |
|
| 46 |
void BarGeometryResources::set_sensitive(bool bEnable) |
| 47 |
{ |
| 48 |
m_xFT_Geometry->set_sensitive(bEnable); |
| 49 |
m_xLB_Geometry->set_sensitive(bEnable); |
| 50 |
} |
| 51 |
|
| 52 |
sal_Int32 BarGeometryResources::get_selected_index() const |
| 53 |
{ |
| 54 |
return m_xLB_Geometry->get_selected_index(); |
| 55 |
} |
| 56 |
|
| 57 |
void BarGeometryResources::select(sal_Int32 nPos) |
| 58 |
{ |
| 59 |
if (nPos < m_xLB_Geometry->n_children()) |
| 60 |
m_xLB_Geometry->select(nPos); |
| 61 |
} |
| 62 |
|
| 63 |
} //namespace chart |
| 64 |
|
| 65 |
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |