Exemple #1
0
    void resized()
    {
        text1.layout (getWidth() - 24, Justification::topLeft, false);
        text2.layout (getWidth() - 24, Justification::centred, false);

        link->setSize (100, 22);
        link->changeWidthToFitText();
        link->setTopLeftPosition ((getWidth() - link->getWidth()) / 2, getHeight() - link->getHeight() - 10);
    }
 void updateLayout (const int width)
 {
     TextLayout text;
     text.appendText (getText(), getFont());
     text.layout (width - 8, Justification::topLeft, true);
     setSize (width, jmin (width, text.getHeight() + (int) getFont().getHeight()));
 }
Exemple #3
0
static const TextLayout layoutTooltipText (const String& text) throw()
{
    const float tooltipFontSize = 11.0f;
    const int maxToolTipWidth = 400;

    const Font f (tooltipFontSize, Font::plain);
    TextLayout tl (text, f);
    tl.layout (maxToolTipWidth, Justification::left, true);

    return tl;
}