Android release v6.7_preview1
[xcsoar.git] / src / Dialogs / Settings / WindSettingsPanel.hpp
blobd63febe0bd65f783cd9f4c04824bc4cc70e653ba
1 /*
2 Copyright_License {
4 XCSoar Glide Computer - http://www.xcsoar.org/
5 Copyright (C) 2000-2013 The XCSoar Project
6 A detailed list of copyright holders can be found in the file "AUTHORS".
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 #ifndef XCSOAR_WIND_SETTINGS_PANEL_HPP
25 #define XCSOAR_WIND_SETTINGS_PANEL_HPP
27 #include "Widget/RowFormWidget.hpp"
28 #include "Form/ActionListener.hpp"
29 #include "Form/DataField/Listener.hpp"
30 #include "Blackboard/BlackboardListener.hpp"
32 class WindSettingsPanel final
33 : public RowFormWidget, public ActionListener,
34 private DataFieldListener, private NullBlackboardListener {
35 enum ControlIndex {
36 AutoWind,
37 ExternalWind,
38 TrailDrift,
39 SOURCE,
40 Speed,
41 Direction,
42 CLEAR_MANUAL_BUTTON,
45 const bool edit_manual_wind, clear_manual_button, edit_trail_drift;
47 /**
48 * Has the user modified the manual wind?
50 bool manual_modified;
52 public:
53 enum Buttons {
54 /**
55 * Clears the manual wind.
57 CLEAR_MANUAL,
60 /**
61 * @param manual_wind edit the manual wind setting
62 * @param clear_manual_button add a "Clear" button
64 WindSettingsPanel(bool edit_manual_wind, bool clear_manual_button,
65 bool edit_trail_drift);
67 /* virtual methods from Widget */
68 virtual void Prepare(ContainerWindow &parent, const PixelRect &rc) override;
69 virtual bool Save(bool &changed) override;
70 virtual void Show(const PixelRect &rc) override;
71 virtual void Hide() override;
73 /* virtual methods from ActionListener */
74 virtual void OnAction(int id) override;
76 private:
77 void UpdateVector();
79 /* methods from DataFieldListener */
80 virtual void OnModified(DataField &df) override;
82 /* virtual methods from class BlackboardListener */
83 virtual void OnCalculatedUpdate(const MoreData &basic,
84 const DerivedInfo &calculated) override;
87 #endif