MCPcopy Create free account
hub / github.com/christophhart/HISE / drawToggleButton

Method drawToggleButton

hi_scripting/scripting/api/ScriptingGraphics.cpp:3972–3998  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3970}
3971
3972void ScriptingObjects::ScriptedLookAndFeel::Laf::drawToggleButton(Graphics &g_, ToggleButton &b, bool isMouseOverButton, bool isButtonDown)
3973{
3974 if (functionDefined("drawToggleButton"))
3975 {
3976 auto obj = new DynamicObject();
3977
3978 writeId(obj, &b);
3979 obj->setProperty("area", ApiHelpers::getVarRectangle(b.getLocalBounds().toFloat()));
3980 obj->setProperty("enabled", b.isEnabled());
3981 obj->setProperty("text", b.getButtonText());
3982 obj->setProperty("over", isMouseOverButton);
3983 obj->setProperty("down", isButtonDown);
3984 obj->setProperty("value", b.getToggleState());
3985
3986 setColourOrBlack(obj, "bgColour", b, HiseColourScheme::ComponentOutlineColourId);
3987 setColourOrBlack(obj, "itemColour1", b, HiseColourScheme::ComponentFillTopColourId);
3988 setColourOrBlack(obj, "itemColour2", b, HiseColourScheme::ComponentFillBottomColourId);
3989 setColourOrBlack(obj, "textColour", b, HiseColourScheme::ComponentTextColourId);
3990
3991 addParentFloatingTile(b, obj);
3992
3993 if (get()->callWithGraphics(g_, "drawToggleButton", var(obj), &b))
3994 return;
3995 }
3996
3997 GlobalHiseLookAndFeel::drawToggleButton(g_, b, isMouseOverButton, isButtonDown);
3998}
3999
4000
4001void ScriptingObjects::ScriptedLookAndFeel::Laf::drawRotarySlider(Graphics &g_, int /*x*/, int /*y*/, int width, int height, float /*sliderPosProportional*/, float /*rotaryStartAngle*/, float /*rotaryEndAngle*/, Slider &s)

Callers

nothing calls this directly

Calls 10

setColourOrBlackFunction · 0.85
varFunction · 0.85
getLocalBoundsMethod · 0.80
getToggleStateMethod · 0.80
callWithGraphicsMethod · 0.80
getFunction · 0.50
setPropertyMethod · 0.45
toFloatMethod · 0.45
isEnabledMethod · 0.45
getButtonTextMethod · 0.45

Tested by

no test coverage detected