Wt examples  3.3.12
ChartConfig.h
Go to the documentation of this file.
1 // This may look like C code, but it's really -*- C++ -*-
2 /*
3  * Copyright (C) 2008 Emweb bvba, Kessel-Lo, Belgium.
4  *
5  * See the LICENSE file for terms of use.
6  */
7 #ifndef CHART_CONFIG_H_
8 #define CHART_CONFIG_H_
9 
10 #include <Wt/WContainerWidget>
11 #include <Wt/Chart/WDataSeries>
12 
13 namespace Wt {
14  class WCheckBox;
15  class WComboBox;
16  class WFormWidget;
17  class WLineEdit;
18  class WStandardItemModel;
19  class WTable;
20  class WValidator;
21 
22  namespace Chart {
23  class WAxis;
24  class WCartesianChart;
25  }
26 }
27 
32 
40 class ChartConfig : public Wt::WContainerWidget
41 {
42 public:
45  ChartConfig(Wt::Chart::WCartesianChart *chart, Wt::WContainerWidget *parent);
46 
47  void setValueFill(Wt::Chart::FillRangeType fill);
48 
49 private:
50  Wt::Chart::WCartesianChart *chart_;
51  Wt::Chart::FillRangeType fill_;
52 
54  struct SeriesControl {
55  Wt::WCheckBox *enabledEdit;
56  Wt::WComboBox *typeEdit;
57  Wt::WComboBox *markerEdit;
58  Wt::WComboBox *axisEdit;
59  Wt::WCheckBox *legendEdit;
60  Wt::WCheckBox *shadowEdit;
61  Wt::WComboBox *labelsEdit;
62  };
63 
65  std::vector<SeriesControl> seriesControls_;
66 
68  struct AxisControl {
69  Wt::WCheckBox *visibleEdit;
70  Wt::WComboBox *scaleEdit;
71  Wt::WCheckBox *autoEdit;
72  Wt::WLineEdit *minimumEdit;
73  Wt::WLineEdit *maximumEdit;
74  Wt::WCheckBox *gridLinesEdit;
75  Wt::WLineEdit *labelAngleEdit;
76  Wt::WLineEdit *titleEdit;
77  Wt::WComboBox *titleOrientationEdit;
78  Wt::WComboBox *tickDirectionEdit;
79  Wt::WComboBox *locationEdit;
80  };
81 
83  std::vector<AxisControl> axisControls_;
84 
85  Wt::WLineEdit *titleEdit_;
86  Wt::WLineEdit *chartWidthEdit_;
87  Wt::WLineEdit *chartHeightEdit_;
88  Wt::WComboBox *chartOrientationEdit_;
89  Wt::WComboBox *legendLocationEdit_;
90  Wt::WComboBox *legendSideEdit_;
91  Wt::WComboBox *legendAlignmentEdit_;
92  Wt::WCheckBox *borderEdit_;
93 
94  Wt::WStandardItemModel *yAxesModel_, *xScales_, *yScales_;
95  Wt::WTable *axisConfig_;
97 
98  void connectSignals(Wt::WFormWidget *w);
99  void update();
100  void addYAxis();
101  void addAxis(Wt::Chart::Axis axis, int yAxis);
102  void removeYAxis(const Wt::Chart::WAxis *axis);
103  void clearYAxes();
104 
105  static bool validate(Wt::WFormWidget *w);
106 };
107 
110 #endif // CHARTS_EXAMPLE_H_
ChartConfig::AxisControl::visibleEdit
Wt::WCheckBox * visibleEdit
Definition: ChartConfig.h:69
ChartConfig::anyNumberValidator_
Wt::WValidator * anyNumberValidator_
Definition: ChartConfig.h:96
ChartConfig::SeriesControl::axisEdit
Wt::WComboBox * axisEdit
Definition: ChartConfig.h:58
ChartConfig::ChartConfig
ChartConfig(Wt::Chart::WCartesianChart *chart, Wt::WContainerWidget *parent)
Constructor.
Definition: ChartConfig.C:77
ChartConfig::AxisControl::autoEdit
Wt::WCheckBox * autoEdit
Definition: ChartConfig.h:71
ChartConfig::AxisControl::titleEdit
Wt::WLineEdit * titleEdit
Definition: ChartConfig.h:76
Wt
Definition: AddresseeEdit.h:16
ChartConfig::AxisControl::minimumEdit
Wt::WLineEdit * minimumEdit
Definition: ChartConfig.h:72
ChartConfig::xScales_
Wt::WStandardItemModel * xScales_
Definition: ChartConfig.h:94
ChartConfig::connectSignals
void connectSignals(Wt::WFormWidget *w)
Definition: ChartConfig.C:642
ChartConfig::titleEdit_
Wt::WLineEdit * titleEdit_
Definition: ChartConfig.h:85
ChartConfig::SeriesControl::markerEdit
Wt::WComboBox * markerEdit
Definition: ChartConfig.h:57
ChartConfig::SeriesControl::typeEdit
Wt::WComboBox * typeEdit
Definition: ChartConfig.h:56
ChartConfig::fill_
Wt::Chart::FillRangeType fill_
Definition: ChartConfig.h:51
ChartConfig::SeriesControl::enabledEdit
Wt::WCheckBox * enabledEdit
Definition: ChartConfig.h:55
ChartConfig::AxisControl::scaleEdit
Wt::WComboBox * scaleEdit
Definition: ChartConfig.h:70
ChartConfig::chart_
Wt::Chart::WCartesianChart * chart_
Definition: ChartConfig.h:50
ChartConfig::yAxesModel_
Wt::WStandardItemModel * yAxesModel_
Definition: ChartConfig.h:94
ChartConfig::axisConfig_
Wt::WTable * axisConfig_
Definition: ChartConfig.h:95
ChartConfig::chartWidthEdit_
Wt::WLineEdit * chartWidthEdit_
Definition: ChartConfig.h:86
ChartConfig::AxisControl::titleOrientationEdit
Wt::WComboBox * titleOrientationEdit
Definition: ChartConfig.h:77
ChartConfig::seriesControls_
std::vector< SeriesControl > seriesControls_
Controls for series.
Definition: ChartConfig.h:65
ChartConfig::legendSideEdit_
Wt::WComboBox * legendSideEdit_
Definition: ChartConfig.h:90
ChartConfig::update
void update()
Definition: ChartConfig.C:375
ChartConfig
A class that allows configuration of a cartesian chart.
Definition: ChartConfig.h:40
ChartConfig::AxisControl::maximumEdit
Wt::WLineEdit * maximumEdit
Definition: ChartConfig.h:73
ChartConfig::removeYAxis
void removeYAxis(const Wt::Chart::WAxis *axis)
Definition: ChartConfig.C:757
ChartConfig::AxisControl
Struct that holds the controls for one axis.
Definition: ChartConfig.h:68
ChartConfig::SeriesControl::shadowEdit
Wt::WCheckBox * shadowEdit
Definition: ChartConfig.h:60
ChartConfig::chartOrientationEdit_
Wt::WComboBox * chartOrientationEdit_
Definition: ChartConfig.h:88
ChartConfig::SeriesControl
Struct that holds the controls for one series.
Definition: ChartConfig.h:54
ChartConfig::legendLocationEdit_
Wt::WComboBox * legendLocationEdit_
Definition: ChartConfig.h:89
ChartConfig::clearYAxes
void clearYAxes()
Definition: ChartConfig.C:771
ChartConfig::axisControls_
std::vector< AxisControl > axisControls_
Controls for axes.
Definition: ChartConfig.h:83
ChartConfig::addYAxis
void addYAxis()
Definition: ChartConfig.C:649
ChartConfig::legendAlignmentEdit_
Wt::WComboBox * legendAlignmentEdit_
Definition: ChartConfig.h:91
ChartConfig::yScales_
Wt::WStandardItemModel * yScales_
Definition: ChartConfig.h:94
ChartConfig::chartHeightEdit_
Wt::WLineEdit * chartHeightEdit_
Definition: ChartConfig.h:87
ChartConfig::SeriesControl::legendEdit
Wt::WCheckBox * legendEdit
Definition: ChartConfig.h:59
ChartConfig::SeriesControl::labelsEdit
Wt::WComboBox * labelsEdit
Definition: ChartConfig.h:61
ChartConfig::setValueFill
void setValueFill(Wt::Chart::FillRangeType fill)
Definition: ChartConfig.C:370
ChartConfig::AxisControl::gridLinesEdit
Wt::WCheckBox * gridLinesEdit
Definition: ChartConfig.h:74
ChartConfig::borderEdit_
Wt::WCheckBox * borderEdit_
Definition: ChartConfig.h:92
ChartConfig::validate
static bool validate(Wt::WFormWidget *w)
Definition: ChartConfig.C:630
ChartConfig::AxisControl::locationEdit
Wt::WComboBox * locationEdit
Definition: ChartConfig.h:79
ChartConfig::AxisControl::tickDirectionEdit
Wt::WComboBox * tickDirectionEdit
Definition: ChartConfig.h:78
ChartConfig::addAxis
void addAxis(Wt::Chart::Axis axis, int yAxis)
Definition: ChartConfig.C:658
ChartConfig::angleValidator_
Wt::WValidator * angleValidator_
Definition: ChartConfig.h:96
ChartConfig::AxisControl::labelAngleEdit
Wt::WLineEdit * labelAngleEdit
Definition: ChartConfig.h:75

Generated on Mon Sep 5 2022 for the C++ Web Toolkit (Wt) by doxygen 1.8.17