MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / eventOccured

Method eventOccured

forms/textbutton.cpp:30–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28TextButton::~TextButton() = default;
29
30void TextButton::eventOccured(Event *e)
31{
32 Control::eventOccured(e);
33
34 if (e->type() == EVENT_FORM_INTERACTION && e->forms().RaisedBy == shared_from_this() &&
35 e->forms().EventFlag == FormEventType::MouseDown)
36 {
37 fw().soundBackend->playSample(buttonclick);
38 }
39
40 if (e->type() == EVENT_FORM_INTERACTION && e->forms().RaisedBy == shared_from_this() &&
41 e->forms().EventFlag == FormEventType::MouseClick)
42 {
43 this->pushFormEvent(FormEventType::ButtonClick, e);
44 }
45}
46
47void TextButton::onRender()
48{

Callers

nothing calls this directly

Calls 3

typeMethod · 0.80
pushFormEventMethod · 0.80
playSampleMethod · 0.45

Tested by

no test coverage detected