rigImGui 0.1.1
RigKit pack API - rigImGui
Loading...
Searching...
No Matches
ImGuiExpr.h File Reference

Functions

bool rigkit::evalNumericExpr (const char *buf, double current, double &out)
 Evaluate a numeric field expression against the current value.

Function Documentation

◆ evalNumericExpr()

bool rigkit::evalNumericExpr ( const char * buf,
double current,
double & out )

Evaluate a numeric field expression against the current value.

Leading + * / apply to the current value (*2, +10, /2). -10 sets a negative; +-10 subtracts. x is the current value (x*2). + - * / ( ) with usual precedence. False on junk or divide-by-zero. Properties click-to-type calls this; do not hook Dear ImGui for it.

Parameters
bufExpression text (already trimmed of leading blanks by the caller).
currentValue in the field before the edit.
outResult when the function returns true.