SBB Host
Host communication with the self balancing bike.
Loading...
Searching...
No Matches
EntryLabel.h
Go to the documentation of this file.
1
2#ifndef ENTRYLABEL_H
3#define ENTRYLABEL_H
4
5#include <gtkmm.h>
6#include <string>
7#include "config.h"
8
15class SpinEntryLabel : public Gtk::Box {
16public:
25 SpinEntryLabel(double val, double lower, double upper, double step, Glib::ustring lbl);
26
31 void set_value(double val);
32
37 double get_value();
38
39protected:
40 Gtk::Box box;
41 Gtk::Label label;
42 Gtk::SpinButton entry;
43};
44
45
52class TextEntryLabel : public Gtk::Box {
53public:
59 TextEntryLabel(Glib::ustring str, Glib::ustring lbl);
60
65 void set_text(Glib::ustring str);
66
71 Glib::ustring get_text();
72
73protected:
74 Gtk::Box box;
75 Gtk::Label label;
76 Gtk::Entry entry;
77};
78
79
86class ComboEntryLabel : public Gtk::Box {
87public:
93 ComboEntryLabel(std::vector<int> vals, Glib::ustring lbl);
94
99 void set_entries(std::vector<int> vals);
100
105 std::vector<int> get_entries();
106
112 bool set_selected(int val);
113
119
120protected:
121 Gtk::ComboBoxText entry;
122 Gtk::Box box;
123 Gtk::Label label;
124 std::vector<int> entries;
125};
126
134class ComboChoiceEntryLabel : public Gtk::Box {
135public:
140 ComboChoiceEntryLabel(Glib::ustring lbl);
141
146 ComboChoiceEntryLabel(std::vector<int> id_vec, std::vector<std::string> str_vec, Glib::ustring lbl);
147
148
154 void set_entries(std::vector<int> id_vec, std::vector<std::string> str_vec);
155
161 bool set_selected(int id);
162
168
173 Gtk::ComboBoxText* get_comboBoxText();
174 Gtk::ComboBoxText entry;
175
176protected:
177 Gtk::Box box;
178 Gtk::Label label;
179 std::vector<int> id;
180 std::vector<std::string> str;
181};
182
183#endif
184
A class with a Gtk::ComboBoxText and Gtk::Label. Slightly different from ComboEntryLabel.
Definition: EntryLabel.h:134
void set_entries(std::vector< int > id_vec, std::vector< std::string > str_vec)
Set the choices.
ComboChoiceEntryLabel(std::vector< int > id_vec, std::vector< std::string > str_vec, Glib::ustring lbl)
Constructor.
std::vector< std::string > str
Vector to store the choice name of the ComboBoxText.
Definition: EntryLabel.h:180
std::vector< int > id
Vector of ID for the item of the ComboBoxText.
Definition: EntryLabel.h:179
Gtk::Box box
Gtk::Box object of the widget.
Definition: EntryLabel.h:177
int get_selected()
Get the ID of the selected choice.
Gtk::ComboBoxText * get_comboBoxText()
Get the Gtk::ComboBoxText pointer.
bool set_selected(int id)
Set the selected choice.
Gtk::ComboBoxText entry
Gtk::ComboBoxText object.
Definition: EntryLabel.h:174
ComboChoiceEntryLabel(Glib::ustring lbl)
Constructor.
Gtk::Label label
label string variable.
Definition: EntryLabel.h:178
A class with a Gtk::ComboBoxText and Gtk::Label.
Definition: EntryLabel.h:86
ComboEntryLabel(std::vector< int > vals, Glib::ustring lbl)
Constructor.
bool set_selected(int val)
Set the selected value.
Gtk::ComboBoxText entry
Gtk::ComboBoxText object.
Definition: EntryLabel.h:121
Gtk::Label label
label string variable.
Definition: EntryLabel.h:123
std::vector< int > get_entries()
Get the values.
void set_entries(std::vector< int > vals)
Set the values.
std::vector< int > entries
Vector to store the values of the ComboBoxText.
Definition: EntryLabel.h:124
int get_selected()
Get the selected value.
Gtk::Box box
Gtk::Box object of the widget.
Definition: EntryLabel.h:122
A class with a Gtk::SpinButton and Gtk::Label.
Definition: EntryLabel.h:15
Gtk::SpinButton entry
Gtk::SpinButton object.
Definition: EntryLabel.h:42
SpinEntryLabel(double val, double lower, double upper, double step, Glib::ustring lbl)
Constructor.
Gtk::Label label
label string variable.
Definition: EntryLabel.h:41
Gtk::Box box
Gtk::Box object of the widget.
Definition: EntryLabel.h:40
double get_value()
Get the value.
void set_value(double val)
Set the value.
A class with a Gtk::Entry and Gtk::Label.
Definition: EntryLabel.h:52
Gtk::Label label
label string variable.
Definition: EntryLabel.h:75
Glib::ustring get_text()
Get the text.
TextEntryLabel(Glib::ustring str, Glib::ustring lbl)
Constructor.
void set_text(Glib::ustring str)
Set the text.
Gtk::Entry entry
Gtk::Entry object.
Definition: EntryLabel.h:76
Gtk::Box box
Gtk::Box object of the widget.
Definition: EntryLabel.h:74
A configuration file for the source code.