int uiControlEnabledToUser(uiControl *c) { while (c != NULL) { if (!uiControlEnabled(c)) return 0; c = uiControlParent(c); } return 1; }
void enableAllWindowsExcept(uiWindow *which) { for (auto &w : windows) { if (w.first == which) continue; if (!uiControlEnabled(uiControl(w.first))) continue; EnableWindow(w.first->hwnd, TRUE); } }
BOOL uiWindowsShouldStopSyncEnableState(uiWindowsControl *c, BOOL enabled) { int ce; ce = uiControlEnabled(uiControl(c)); // only stop if we're going from disabled back to enabled; don't stop under any other condition // (if we stop when going from enabled to disabled then enabled children of a disabled control won't get disabled at the OS level) if (!ce && enabled) return TRUE; return FALSE; }
static Janet janet_ui_enabled(int32_t argc, Janet *argv) { janet_fixarity(argc, 1); uiControl *c = janet_getcontrol(argv, 0); return janet_wrap_boolean(uiControlEnabled(c)); }