looper/backends/ui/gtk/my_slider.hpp

39 lines
1.1 KiB
C++
Raw Normal View History

#pragma once
#include <gtkmm.h>
#include <glibmm.h>
class MySlider : public Gtk::Box {
double value;
double max_value;
double min_value;
bool text_valid = true;
bool text_editing;
Gtk::Button edit_btn;
Gtk::Entry text_entry;
Gtk::Scale slider;
Gtk::Label prefix_label;
Gtk::Label value_label;
Gtk::Label suffix_label;
bool update_occurring = false;
void update(bool force = false);
void update_text_entry(std::string text);
void update_slider(double value);
Glib::ustring prefix;
Glib::ustring suffix;
unsigned digits_after_decimal;
public:
double get_value();
void set_value(double value);
sigc::signal<void(double)> value_changed;
double get_max_value();
void set_max_value(double value);
double get_min_value();
void set_min_value(double value);
Glib::ustring get_prefix();
void set_prefix(Glib::ustring value);
Glib::ustring get_suffix();
void set_suffix(Glib::ustring value);
unsigned get_digits_after_decimal();
void set_digits_after_decimal(unsigned value);
MySlider();
};