Razorbotz RMC 2021-2022 Documentation
Loading...
Searching...
No Matches
InfoItem.hpp
1#include <iostream>
2
3#include <gtkmm.h>
4#include <gdkmm.h>
5
6class InfoItem:public Gtk::Box{
7 private:
8 Gtk::Label* nameLabel;
9 Gtk::Label* valueLabel;
10 int order;
11
12 int decimalPlaces = 6;
13
14 public:
15 InfoItem(std::string name);
16
17 void setName(std::string name);
18 std::string getName();
19
20 void setDecimalPlaces(int places);
21
22
23 void setValue(long value);
24 void setValue(double value);
25 void setValue(float value);
26 void setValue(std::string value);
27 template<typename T>
28 void setValue(T value) {
29 std::string valueString = std::to_string(value);
30 setValue(valueString);
31 }
32
33 bool getValueAsBool();
34 int getValueAsInt();
35 long getValueAsLong();
36 float getValueAsFloat();
37 double getValueAsDouble();
38 std::string getValue();
39 void setBackground(std::string color);
40 void setTextColor(std::string color, bool bold);
41};