LibreOffice Module chart2 (master) 1
ChartResourceGroupDlgs.cxx
Go to the documentation of this file.
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
22
23#include <strings.hrc>
24#include <ResId.hxx>
25
26namespace chart
27{
28using namespace ::com::sun::star;
29using namespace ::com::sun::star::chart2;
30
31const sal_uInt16 CUBIC_SPLINE_POS = 0;
32const sal_uInt16 B_SPLINE_POS = 1;
33
35 : GenericDialogController(pParent, "modules/schart/ui/smoothlinesdlg.ui", "SmoothLinesDialog")
36 , m_xLB_Spline_Type(m_xBuilder->weld_combo_box("SplineTypeComboBox"))
37 , m_xMF_SplineResolution(m_xBuilder->weld_spin_button("ResolutionSpinbutton"))
38 , m_xFT_SplineOrder(m_xBuilder->weld_label("PolynomialsLabel"))
39 , m_xMF_SplineOrder(m_xBuilder->weld_spin_button("PolynomialsSpinButton"))
40{
41 m_xDialog->set_title(SchResId(STR_DLG_SMOOTH_LINE_PROPERTIES));
42
43 m_xLB_Spline_Type->connect_changed(LINK(this, SplinePropertiesDialog, SplineTypeListBoxHdl));
44}
45
47{
48 switch (rParameter.eCurveStyle)
49 {
50 case CurveStyle_CUBIC_SPLINES:
52 break;
53 case CurveStyle_B_SPLINES:
55 break;
56 default:
58 break;
59 }
60 m_xMF_SplineOrder->set_value(rParameter.nSplineOrder);
61 m_xMF_SplineResolution->set_value(rParameter.nCurveResolution);
62
63 //dis/enabling
64 m_xFT_SplineOrder->set_sensitive(m_xLB_Spline_Type->get_active() == B_SPLINE_POS);
65 m_xMF_SplineOrder->set_sensitive(m_xLB_Spline_Type->get_active() == B_SPLINE_POS);
66}
67
69{
70 if (!bSmoothLines)
71 rParameter.eCurveStyle = CurveStyle_LINES;
72 else if (m_xLB_Spline_Type->get_active() == CUBIC_SPLINE_POS)
73 rParameter.eCurveStyle = CurveStyle_CUBIC_SPLINES;
74 else if (m_xLB_Spline_Type->get_active() == B_SPLINE_POS)
75 rParameter.eCurveStyle = CurveStyle_B_SPLINES;
76
77 rParameter.nCurveResolution = m_xMF_SplineResolution->get_value();
78 rParameter.nSplineOrder = m_xMF_SplineOrder->get_value();
79}
80
82{
83 m_xFT_SplineOrder->set_sensitive(m_xLB_Spline_Type->get_active() == B_SPLINE_POS);
84 m_xMF_SplineOrder->set_sensitive(m_xLB_Spline_Type->get_active() == B_SPLINE_POS);
85}
86
88 : GenericDialogController(pParent, "modules/schart/ui/steppedlinesdlg.ui", "SteppedLinesDialog")
89 , m_xRB_Start(m_xBuilder->weld_radio_button("step_start_rb"))
90 , m_xRB_End(m_xBuilder->weld_radio_button("step_end_rb"))
91 , m_xRB_CenterX(m_xBuilder->weld_radio_button("step_center_x_rb"))
92 , m_xRB_CenterY(m_xBuilder->weld_radio_button("step_center_y_rb"))
93{
94 m_xDialog->set_title(SchResId(STR_DLG_STEPPED_LINE_PROPERTIES));
95}
96
98{
99 switch (rParameter.eCurveStyle)
100 {
101 case CurveStyle_STEP_END:
102 m_xRB_End->set_active(true);
103 break;
104 case CurveStyle_STEP_CENTER_X:
105 m_xRB_CenterX->set_active(true);
106 break;
107 case CurveStyle_STEP_CENTER_Y:
108 m_xRB_CenterY->set_active(true);
109 break;
110 default: // includes CurveStyle_STEP_START
111 m_xRB_Start->set_active(true);
112 break;
113 }
114}
116{
117 if (!bSteppedLines)
118 rParameter.eCurveStyle = CurveStyle_LINES;
119 else if (m_xRB_CenterY->get_active())
120 rParameter.eCurveStyle = CurveStyle_STEP_CENTER_Y;
121 else if (m_xRB_Start->get_active())
122 rParameter.eCurveStyle = CurveStyle_STEP_START;
123 else if (m_xRB_End->get_active())
124 rParameter.eCurveStyle = CurveStyle_STEP_END;
125 else if (m_xRB_CenterX->get_active())
126 rParameter.eCurveStyle = CurveStyle_STEP_CENTER_X;
127}
128
129} //namespace chart
130
131/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::chart2::CurveStyle eCurveStyle
void fillControls(const ChartTypeParameter &rParameter)
std::unique_ptr< weld::SpinButton > m_xMF_SplineOrder
std::unique_ptr< weld::Label > m_xFT_SplineOrder
std::unique_ptr< weld::ComboBox > m_xLB_Spline_Type
std::unique_ptr< weld::SpinButton > m_xMF_SplineResolution
void fillParameter(ChartTypeParameter &rParameter, bool bSmoothLines)
SplinePropertiesDialog(weld::Window *pParent)
std::unique_ptr< weld::RadioButton > m_xRB_CenterY
std::unique_ptr< weld::RadioButton > m_xRB_End
SteppedPropertiesDialog(weld::Window *pParent)
void fillParameter(ChartTypeParameter &rParameter, bool bSteppedLines)
void fillControls(const ChartTypeParameter &rParameter)
std::unique_ptr< weld::RadioButton > m_xRB_CenterX
std::unique_ptr< weld::RadioButton > m_xRB_Start
std::shared_ptr< weld::Dialog > m_xDialog
const sal_uInt16 B_SPLINE_POS
const sal_uInt16 CUBIC_SPLINE_POS
OUString OOO_DLLPUBLIC_CHARTTOOLS SchResId(TranslateId aId)
Definition: ResId.cxx:24
IMPL_LINK_NOARG(SplinePropertiesDialog, SplineTypeListBoxHdl, weld::ComboBox &, void)