33 lines
865 B
C++
33 lines
865 B
C++
#pragma once
|
|
|
|
#include <Scenario/Document/Interval/IntervalModel.hpp>
|
|
#include <Process/Style/ScenarioStyle.hpp>
|
|
#include <widgets/base_widget.hpp>
|
|
|
|
namespace Hardware
|
|
{
|
|
struct IntervalWidget final : bugui::base_widget
|
|
{
|
|
explicit IntervalWidget(Scenario::IntervalModel& interval,
|
|
bugui::container_widget* parent);
|
|
|
|
void paint(bugui::painter& painter) const override;
|
|
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;
|
|
|
|
int x() const override;
|
|
int y() const override;
|
|
int width() const override;
|
|
|
|
const Scenario::IntervalModel& get_model() const;
|
|
|
|
protected:
|
|
bool contains(int px, int py) const override;
|
|
|
|
private:
|
|
Scenario::IntervalModel& model;
|
|
const Process::Style& skin;
|
|
};
|
|
|
|
} // namespace Hardware
|