コード例 #1
0
ファイル: juce_Button.cpp プロジェクト: pingdynasty/BlipZones
void Button::internalClickCallback (const ModifierKeys& modifiers)
{
    if (clickTogglesState)
        setToggleState ((radioGroupId != 0) || ! lastToggleState, false);

    sendClickMessage (modifiers);
}
コード例 #2
0
ファイル: llbutton.cpp プロジェクト: otwstephanie/hpa2oar
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
ファイル: juce_Button.cpp プロジェクト: pingdynasty/BlipZones
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
ファイル: juce_Button.cpp プロジェクト: pingdynasty/BlipZones
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);
	}