Any documentaiton on look & feel for Combo Boxes
-
I looked in the source but I cant really see anything specific for Combo Boxes.. Id like to draw a (different coloured) graphic next to each combo box item...
-
@Lindon here's some code I used recently:
const var expcblaf = Content.createLocalLookAndFeel(); expcblaf.registerFunction("drawComboBox", function(g, obj) { var a = obj.area; g.setColour(obj.itemColour1); g.fillRoundedRectangle(a, 0); //g.setColour(obj.itemColour2); //g.drawRoundedRectangle(obj.area, 4, 1); g.setColour(Colours.withAlpha(obj.textColour, (obj.enabled && obj.active) ? 1.0 : 0.2)); g.setFont("Abel-Regular", 16.0); g.drawAlignedText(obj.text, [a[0] + 10, a[1], a[2]-10, a[3]], "left"); g.setColour(obj.textColour); var h = a[3]; g.fillTriangle([a[0] + a[2] - h/3 - 10, a[1] + h/3, h/3, h/3], Math.PI); }); ExpansionSelector.setLocalLookAndFeel(expcblaf); expcblaf.registerFunction("drawPopupMenuBackground", function(g, obj) { g.fillAll(0xFF016265); g.setColour(0xFF222328); g.drawRoundedRectangle([0, 0, obj.width, obj.height], 1, 2); //g.setColour(0xFFE3E3E3); //g.setFont("Abel-Regular", 16.0); //g.drawAlignedText(obj.text); }); expcblaf.registerFunction("drawPopupMenuItem", function(g, obj) { var a = obj.area; var h = a[3]; if(obj.isHighlighted) { g.setColour(0x22FFFFFF); g.fillRect(obj.area); } if(obj.isSeparator) { g.setColour(Colours.white); g.drawLine(a[0]+10, a[0] + a[2]-10, a[1] + a[3]/2, a[1] + a[3]/2, 1.0); return; } if(obj.isTicked) { g.setColour(Colours.white); g.fillEllipse([a[0] + h/3, a[1] + h/3, h/3, h/3]); } g.setFont("Abel-Regular", 16.0); g.setColour(0xFFE3E3E3); g.drawAlignedText(obj.text, [a[0] + h, a[1], a[2] - h, a[3]], "left"); });
-
@Lindon drawPopupMenuItem is what you want to be looking at
HiseSnippet 906.3ocsVstaaaCElxIpXVcanEXO.DFX.x.tF1oosCnHnM27fwRRMpyJ1+JnoNRlKTjBRTMwXnuG6wbuAaGpaVYwKK0.U+Pfm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nhYmVLGxw4TECqrJpBI+CScbpr
-
@d-healey yeah I think htisn is close to what I want thanks, Thanks Dan too...