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