void LayoutLabel::setAttributedText (ScopedPointer<AttributedString> newText, const bool broadcastChangeMessage) { hideEditor (true); attributedTextValue = newText; repaint(); textWasChanged(); if (ownerComponent != nullptr) componentMovedOrResized (*ownerComponent, true, true); if (broadcastChangeMessage) callChangeListeners(); }
//============================================================================== void Label::setText (const String& newText, const bool broadcastChangeMessage) { hideEditor (true); if (lastTextValue != newText) { lastTextValue = newText; textValue = newText; repaint(); textWasChanged(); if (ownerComponent != nullptr) componentMovedOrResized (*ownerComponent, true, true); if (broadcastChangeMessage) callChangeListeners(); } }
bool Label::updateFromTextEditorContents (TextEditor& ed) { const String newText (ed.getText()); if (textValue.toString() != newText) { lastTextValue = newText; textValue = newText; repaint(); textWasChanged(); if (ownerComponent != nullptr) componentMovedOrResized (*ownerComponent, true, true); return true; } return false; }
//============================================================================== void Label::setText (const String& newText, const NotificationType notification) { hideEditor (true); if (lastTextValue != newText) { lastTextValue = newText; textValue = newText; repaint(); textWasChanged(); if (ownerComponent != nullptr) componentMovedOrResized (*ownerComponent, true, true); if (notification != dontSendNotification) callChangeListeners(); } }