void Button::internalClickCallback (const ModifierKeys& modifiers) { if (clickTogglesState) setToggleState ((radioGroupId != 0) || ! lastToggleState, false); sendClickMessage (modifiers); }
BOOL LLButton::toggleState() { bool flipped = ! getToggleState(); setToggleState(flipped); return flipped; }
void CSecondaryScreen::leave() { LOG((CLOG_INFO "leaving screen")); CLock lock(&m_mutex); assert(m_active == true); getScreen()->syncDesktop(); // subclass hook onPreLeave(); // restore toggle key state setToggleState(m_toggleKeys); // warp and hide mouse SInt32 x, y; getScreen()->getCursorCenter(x, y); showWindow(x, y); // subclass hook onPostLeave(); // not active anymore m_active = false; // make sure our idea of clipboard ownership is correct getScreen()->checkClipboards(); }
void CSecondaryScreen::enter(SInt32 x, SInt32 y, KeyModifierMask mask) { CLock lock(&m_mutex); assert(m_active == false); LOG((CLOG_INFO "entering screen at %d,%d mask=%04x", x, y, mask)); getScreen()->syncDesktop(); // now active m_active = true; // subclass hook onPreEnter(); // update our keyboard state to reflect the local state updateKeys(); // remember toggle key state m_toggleKeys = getToggleState(); // toggle modifiers that don't match the desired state setToggleState(mask); // warp to requested location warpCursor(x, y); // show mouse hideWindow(); // subclass hook onPostEnter(); }
void Button::applicationCommandListChanged() { if (commandManagerToUse != nullptr) { ApplicationCommandInfo info (0); ApplicationCommandTarget* const target = commandManagerToUse->getTargetForCommand (commandID, info); setEnabled (target != nullptr && (info.flags & ApplicationCommandInfo::isDisabled) == 0); if (target != nullptr) setToggleState ((info.flags & ApplicationCommandInfo::isTicked) != 0, false); } }
void Button::internalClickCallback (const ModifierKeys& modifiers) { if (clickTogglesState) { const bool shouldBeOn = (radioGroupId != 0 || ! lastToggleState); if (shouldBeOn != getToggleState()) { setToggleState (shouldBeOn, sendNotification); return; } } sendClickMessage (modifiers); }
void Button::applicationCommandListChangeCallback() { if (commandManagerToUse != nullptr) { ApplicationCommandInfo info (0); if (commandManagerToUse->getTargetForCommand (commandID, info) != nullptr) { setEnabled ((info.flags & ApplicationCommandInfo::isDisabled) == 0); setToggleState ((info.flags & ApplicationCommandInfo::isTicked) != 0, dontSendNotification); } else { setEnabled (false); } } }
ParameterCheckbox::ParameterCheckbox(bool defaultState) : Button("name"), isEnabled(true) { setToggleState(defaultState, false); setClickingTogglesState(true); selectedGrad = ColourGradient(Colour(240,179,12),0.0,0.0, Colour(207,160,33),0.0, 20.0f, true); selectedOverGrad = ColourGradient(Colour(209,162,33),0.0, 5.0f, Colour(190,150,25),0.0, 0.0f, true); neutralGrad = ColourGradient(Colour(220,220,220),0.0,0.0, Colour(170,170,170),0.0, 20.0f, true); neutralOverGrad = ColourGradient(Colour(180,180,180),0.0,5.0f, Colour(150,150,150),0.0, 0.0, true); deactivatedGrad = ColourGradient(Colour(120, 120, 120), 0.0, 5.0f, Colour(100, 100, 100), 0.0, 0.0, false); }
BOOL LLButton::toggleState() { setToggleState( !mToggleState ); return mToggleState; }
void Button::setToggleState (const bool shouldBeOn, bool sendChange) { setToggleState (shouldBeOn, sendChange ? sendNotification : dontSendNotification); }
void Button::valueChanged (Value& value) { if (value.refersToSameSourceAs (isOn)) setToggleState (isOn.getValue(), true); }
AssociatedButton(const String& componentName, ZenParameter* associatedParam, const String& inLabel = "") : Button(componentName), AssociatedComponent(associatedParam, inLabel) { setToggleState(associatedParam->getBoolFromValue(), sendNotification); }