MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/FleX / buttonLogic

Function buttonLogic

demo/imgui.cpp:235–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233
234
235static bool buttonLogic(unsigned int id, bool over)
236{
237 bool res = false;
238 // process down
239 if (!anyActive())
240 {
241 if (over)
242 setHot(id);
243// Begin Add Android Support
244#ifdef ANDROID
245 if (isHot(id) && g_state.leftPressed && over)
246 setActive(id);
247#else
248 if (isHot(id) && g_state.leftPressed)
249 setActive(id);
250#endif
251// End Add Android Support
252 }
253
254 // if button is active, then react on left up
255 if (isActive(id))
256 {
257 g_state.isActive = true;
258 if (over)
259 setHot(id);
260 if (g_state.leftReleased)
261 {
262 if (isHot(id))
263 res = true;
264 clearActive();
265 }
266 }
267
268 if (isHot(id))
269 g_state.isHot = true;
270
271 return res;
272}
273
274static void updateInput(int mx, int my, unsigned char mbut, int scroll)
275{

Callers 6

imguiEndScrollAreaFunction · 0.85
imguiButtonFunction · 0.85
imguiItemFunction · 0.85
imguiCheckFunction · 0.85
imguiCollapseFunction · 0.85
imguiSliderFunction · 0.85

Calls 6

anyActiveFunction · 0.85
setHotFunction · 0.85
isHotFunction · 0.85
setActiveFunction · 0.85
isActiveFunction · 0.85
clearActiveFunction · 0.85

Tested by

no test coverage detected