MCPcopy Create free account
hub / github.com/LibreSprite/LibreSprite / onProcessMessage

Method onProcessMessage

src/ui/tooltips.cpp:61–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61bool TooltipManager::onProcessMessage(Message* msg)
62{
63 switch (msg->type()) {
64
65 case kMouseEnterMessage: {
66 for (Widget* widget : msg->recipients()) {
67 Tips::iterator it = m_tips.find(widget);
68 if (it != m_tips.end()) {
69 m_target.widget = it->first;
70 m_target.tipInfo = it->second;
71
72 if (m_timer == NULL) {
73 m_timer.reset(new Timer(kTooltipDelayMsecs, this));
74 m_timer->Tick.connect(&TooltipManager::onTick, this);
75 }
76
77 m_timer->start();
78 }
79 }
80 return false;
81 }
82
83 case kKeyDownMessage:
84 case kMouseDownMessage:
85 case kMouseLeaveMessage:
86 if (m_tipWindow) {
87 m_tipWindow->closeWindow(NULL);
88 m_tipWindow.reset();
89 }
90
91 if (m_timer)
92 m_timer->stop();
93
94 return false;
95 }
96
97 return Widget::onProcessMessage(msg);
98}
99
100void TooltipManager::onTick()
101{

Callers

nothing calls this directly

Calls 7

startMethod · 0.80
typeMethod · 0.45
endMethod · 0.45
resetMethod · 0.45
closeWindowMethod · 0.45
stopMethod · 0.45
scancodeMethod · 0.45

Tested by

no test coverage detected