| 4131 | } |
| 4132 | |
| 4133 | void ScriptingObjects::ScriptedLookAndFeel::Laf::drawComboBox(Graphics& g_, int width, int height, bool isButtonDown, int buttonX, int buttonY, int buttonW, int buttonH, ComboBox& cb) |
| 4134 | { |
| 4135 | if (functionDefined("drawComboBox")) |
| 4136 | { |
| 4137 | auto obj = new DynamicObject(); |
| 4138 | writeId(obj, &cb); |
| 4139 | obj->setProperty("area", ApiHelpers::getVarRectangle(cb.getLocalBounds().toFloat())); |
| 4140 | |
| 4141 | auto text = cb.getText(); |
| 4142 | |
| 4143 | if (text.isEmpty()) |
| 4144 | { |
| 4145 | if (cb.getNumItems() == 0) |
| 4146 | text = cb.getTextWhenNoChoicesAvailable(); |
| 4147 | else |
| 4148 | text = cb.getTextWhenNothingSelected(); |
| 4149 | } |
| 4150 | |
| 4151 | obj->setProperty("text", text); |
| 4152 | obj->setProperty("active", cb.getSelectedId() != 0); |
| 4153 | obj->setProperty("enabled", cb.isEnabled() && cb.getNumItems() > 0); |
| 4154 | obj->setProperty("hover", cb.isMouseOver(true) || cb.isMouseButtonDown(true) || cb.isPopupActive()); |
| 4155 | |
| 4156 | setColourOrBlack(obj, "bgColour", cb, HiseColourScheme::ComponentOutlineColourId); |
| 4157 | setColourOrBlack(obj, "itemColour1", cb, HiseColourScheme::ComponentFillTopColourId); |
| 4158 | setColourOrBlack(obj, "itemColour2", cb, HiseColourScheme::ComponentFillBottomColourId); |
| 4159 | setColourOrBlack(obj, "textColour", cb, HiseColourScheme::ComponentTextColourId); |
| 4160 | |
| 4161 | addParentFloatingTile(cb, obj); |
| 4162 | |
| 4163 | if (get()->callWithGraphics(g_, "drawComboBox", var(obj), &cb)) |
| 4164 | return; |
| 4165 | } |
| 4166 | |
| 4167 | GlobalHiseLookAndFeel::drawComboBox(g_, width, height, isButtonDown, buttonX, buttonY, buttonW, buttonH, cb); |
| 4168 | } |
| 4169 | |
| 4170 | void ScriptingObjects::ScriptedLookAndFeel::Laf::positionComboBoxText(ComboBox &c, Label &labelToPosition) |
| 4171 | { |
nothing calls this directly
no test coverage detected