2024-12-27 11:04:40 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Scenario/Document/Interval/IntervalModel.hpp>
|
|
|
|
#include <Process/Style/ScenarioStyle.hpp>
|
2025-01-04 21:05:36 +00:00
|
|
|
#include <widgets/base_widget.hpp>
|
2024-12-27 11:04:40 +00:00
|
|
|
|
|
|
|
namespace Hardware
|
|
|
|
{
|
2025-01-04 21:05:36 +00:00
|
|
|
struct IntervalWidget final : bugui::base_widget
|
2024-12-27 11:04:40 +00:00
|
|
|
{
|
2025-01-03 23:27:19 +00:00
|
|
|
explicit IntervalWidget(Scenario::IntervalModel& interval,
|
2025-01-04 21:05:36 +00:00
|
|
|
bugui::container_widget* parent);
|
2024-12-27 11:04:40 +00:00
|
|
|
|
2024-12-28 17:53:59 +00:00
|
|
|
void paint(bugui::painter& painter) const override;
|
2025-01-04 21:05:36 +00:00
|
|
|
void on_press(int x, int y, bool pressed) override;
|
|
|
|
void on_double_press(int x, int y) override;
|
|
|
|
void on_drag(int from_x, int from_y, int to_x, int to_y) override;
|
2024-12-28 17:53:59 +00:00
|
|
|
|
2024-12-27 11:04:40 +00:00
|
|
|
int x() const override;
|
|
|
|
int y() const override;
|
|
|
|
int width() const override;
|
|
|
|
|
|
|
|
const Scenario::IntervalModel& get_model() const;
|
|
|
|
|
2024-12-29 23:23:03 +00:00
|
|
|
protected:
|
2025-01-03 23:27:19 +00:00
|
|
|
bool contains(int px, int py) const override;
|
2024-12-29 23:23:03 +00:00
|
|
|
|
2024-12-27 11:04:40 +00:00
|
|
|
private:
|
|
|
|
Scenario::IntervalModel& model;
|
|
|
|
const Process::Style& skin;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Hardware
|