Horizon
tool_place_refdes_and_value.hpp
1 #pragma once
2 #include "core/tool.hpp"
3 
4 namespace horizon {
5 
7 public:
8  using ToolBase::ToolBase;
9  ToolResponse begin(const ToolArgs &args) override;
10  ToolResponse update(const ToolArgs &args) override;
11  bool can_begin() override;
12  std::set<InToolActionID> get_actions() const override
13  {
14  using I = InToolActionID;
15  return {
16  I::LMB,
17  I::CANCEL,
18  I::RMB,
19  };
20  }
21 
22 private:
23  class Text *text_refdes = nullptr;
24  Text *text_value = nullptr;
25 
26  void update_texts(const Coordi &c);
27 };
28 } // namespace horizon
Used wherever a user-editable text is needed.
Definition: text.hpp:18
This is what a Tool receives when the user did something.
Definition: tool.hpp:23
Common interface for all Tools.
Definition: tool.hpp:121
Definition: tool_place_refdes_and_value.hpp:6
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
Definition: tool_place_refdes_and_value.cpp:21
bool can_begin() override
Definition: tool_place_refdes_and_value.cpp:10
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
Definition: tool_place_refdes_and_value.cpp:40
To signal back to the core what the Tool did, a Tool returns a ToolResponse.
Definition: tool.hpp:42