MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / setAttributedText

Method setAttributedText

Source/UIComponents/CtrlrTextEditor.cpp:14–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12}
13
14void CtrlrTextEditor::setAttributedText (const AttributedString &text)
15{
16 clear();
17
18 for (int i=0; i<text.getNumAttributes(); i++)
19 {
20 const AttributedString::Attribute a = text.getAttribute(i);
21 setFont (a.font);
22 setColour (TextEditor::textColourId, a.colour);
23
24 insertTextAtCaret (text.getText().substring (a.range.getStart(), a.range.getEnd()));
25 }
26}
27
28void CtrlrTextEditor::insertText (const String &text, const Font &font, const Colour &colour)
29{

Callers

nothing calls this directly

Calls 9

getNumAttributesMethod · 0.80
getAttributeMethod · 0.80
clearFunction · 0.50
setFontFunction · 0.50
setColourFunction · 0.50
substringMethod · 0.45
getTextMethod · 0.45
getStartMethod · 0.45
getEndMethod · 0.45

Tested by

no test coverage detected