2024-12-27 11:04:40 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Scenario/Document/Interval/IntervalModel.hpp>
|
|
|
|
#include <Process/Style/ScenarioStyle.hpp>
|
|
|
|
#include <base_widget.hpp>
|
|
|
|
|
|
|
|
namespace Hardware
|
|
|
|
{
|
2024-12-28 17:53:59 +00:00
|
|
|
struct IntervalWidget final : bugui::base_widget
|
2024-12-27 11:04:40 +00:00
|
|
|
{
|
|
|
|
explicit IntervalWidget(base_widget* parent,
|
|
|
|
Scenario::IntervalModel& interval);
|
|
|
|
|
2024-12-28 17:53:59 +00:00
|
|
|
void paint(bugui::painter& painter) const override;
|
2024-12-29 23:23:03 +00:00
|
|
|
bool on_press(int x, int y, bool pressed) override;
|
|
|
|
bool on_double_press(int x, int y) override;
|
2024-12-30 12:32:54 +00:00
|
|
|
bool 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:
|
|
|
|
bool is_inside(int px, int py) const override;
|
|
|
|
|
2024-12-27 11:04:40 +00:00
|
|
|
private:
|
|
|
|
Scenario::IntervalModel& model;
|
|
|
|
const Process::Style& skin;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Hardware
|