emfunctions.hpp
Specialized, useful function for Empirical.
This file is part of Empirical, https://github.com/devosoft/Empirical Copyright (C) 2015-2017 Michigan State University MIT Software license; see doc/LICENSE.md
Functions
-
static void DelayCall(const std::function<void()> &in_fun, int delay)
Call a function after a specified amount of time (in milliseconds)
-
static void OnResize(const std::function<void()> &in_fun)
Provide a function to call whenever a window’s size changes (no arguments).
-
static void OnResize(const std::function<void(int, int)> &in_fun)
Provide a function to call whenever a window’s size changes (new size as arguments)
-
inline double GetTime()
Get the current time, as provided by the web browser.
-
inline int GetWindowInnerWidth()
Determine with width of the current window.
-
inline int GetWindowInnerHeight()
Determine with height of the current window.
-
static void SetCursor(const char *type)
-
String MakeHTMLTrigger(String text, std::function<void()> in_fun, String color = "")
Generate a string that will associate text with a clickable link to call a function.
- Parameters:
text – The text you want in the link.
in_fun – The function to call when the text is clicked on.
- Returns:
The generated string NOTE: This will wrap a new function each time you call, so minimize calls!