예제 #1
0
void Button::internalClickCallback (const ModifierKeys& modifiers)
{
    if (clickTogglesState)
        setToggleState ((radioGroupId != 0) || ! lastToggleState, false);

    sendClickMessage (modifiers);
}
예제 #2
0
BOOL LLButton::toggleState()			
{
    bool flipped = ! getToggleState();
	setToggleState(flipped); 

	return flipped; 
}
예제 #3
0
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();
}
예제 #4
0
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();
}
예제 #5
0
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);
    }
}
예제 #6
0
파일: juce_Button.cpp 프로젝트: 2DaT/Obxd
void Button::internalClickCallback (const ModifierKeys& modifiers)
{
    if (clickTogglesState)
    {
        const bool shouldBeOn = (radioGroupId != 0 || ! lastToggleState);

        if (shouldBeOn != getToggleState())
        {
            setToggleState (shouldBeOn, sendNotification);
            return;
        }
    }

    sendClickMessage (modifiers);
}
예제 #7
0
파일: juce_Button.cpp 프로젝트: 2DaT/Obxd
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);
        }
    }
}
예제 #8
0
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);
}
예제 #9
0
BOOL LLButton::toggleState()			
{ 
	setToggleState( !mToggleState ); 
	return mToggleState; 
}
예제 #10
0
파일: juce_Button.cpp 프로젝트: 2DaT/Obxd
void Button::setToggleState (const bool shouldBeOn, bool sendChange)
{
    setToggleState (shouldBeOn, sendChange ? sendNotification : dontSendNotification);
}
예제 #11
0
void Button::valueChanged (Value& value)
{
    if (value.refersToSameSourceAs (isOn))
        setToggleState (isOn.getValue(), true);
}
예제 #12
0
	AssociatedButton(const String& componentName, ZenParameter* associatedParam, const String& inLabel = "")
		: Button(componentName), AssociatedComponent(associatedParam, inLabel)
	{
		setToggleState(associatedParam->getBoolFromValue(), sendNotification);
	}