MCPcopy Create free account
hub / github.com/DISTRHO/DPF / onMouse

Method onMouse

tests/Demo.cpp:164–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162 }
163
164 bool onMouse(const MouseEvent& ev) override
165 {
166 if (ev.button != 1 || ! ev.press)
167 return false;
168 if (! contains(ev.pos))
169 return false;
170
171 const int iconSize = bgIcon.getWidth();
172
173 for (int i=0; i<kPageCount; ++i)
174 {
175 bgIcon.setY(i*iconSize + i*3);
176
177 if (bgIcon.contains(ev.pos))
178 {
179 curPage = i;
180 callback->curPageChanged(i);
181 repaint();
182 break;
183 }
184 }
185
186 return true;
187 }
188
189 bool onMotion(const MotionEvent& ev) override
190 {

Callers

nothing calls this directly

Calls 6

containsFunction · 0.85
setYMethod · 0.80
curPageChangedMethod · 0.80
repaintFunction · 0.50
getWidthMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected