light_on_list.cpp 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #include <gtkmm/box.h>
  2. #include <gtkmm/label.h>
  3. #include <gtkmm/frame.h>
  4. #include <gtkmm/button.h>
  5. #include <gtkmm/orientable.h>
  6. #include <string>
  7. #include "light_on_list.hpp"
  8. namespace cx_light {
  9. light_on_list::light_on_list(light target) {
  10. this->target = target.copy();
  11. this->center = new Gtk::Box();
  12. this->center->set_margin(5);
  13. this->center->set_spacing(10);
  14. this->center->set_orientation(Gtk::Orientation::HORIZONTAL);
  15. this->set_margin_bottom(5);
  16. this->set_child(*this->center);
  17. this->title = new Gtk::Label(this->target->get_name());
  18. this->center->append(*this->title);
  19. this->show = new Gtk::Button("Show");
  20. this->center->append(*this->show);
  21. this->edit = new Gtk::Button("Edit");
  22. this->center->append(*this->edit);
  23. }
  24. light_on_list::~light_on_list() {
  25. delete this->center;
  26. delete this->title;
  27. delete this->show;
  28. delete this->edit;
  29. delete this->target;
  30. }
  31. int light_on_list::width() {
  32. return 200;
  33. }
  34. int light_on_list::height() {
  35. return 40;
  36. }
  37. }