本文整理汇总了C++中AttributedString::setWordWrap方法的典型用法代码示例。如果您正苦于以下问题:C++ AttributedString::setWordWrap方法的具体用法?C++ AttributedString::setWordWrap怎么用?C++ AttributedString::setWordWrap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AttributedString
的用法示例。
在下文中一共展示了AttributedString::setWordWrap方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: paint
void paint (Graphics& g) override
{
Rectangle<float> area (getLocalBounds().toFloat().reduced (2.0f));
g.setColour (Colours::orange);
g.drawRoundedRectangle (area, 10.0f, 2.0f);
AttributedString s;
s.setJustification (Justification::centred);
s.setWordWrap (AttributedString::none);
s.append ("Drag Me!");
s.setColour (Colours::white);
s.draw (g, area);
}
示例2: paintListBoxItem
void paintListBoxItem (int rowNumber, Graphics& g,
int width, int height, bool rowIsSelected)
{
if (rowIsSelected)
g.fillAll (Colours::lightblue);
Font font (fonts [rowNumber]);
AttributedString s;
s.setWordWrap (AttributedString::none);
s.setJustification (Justification::centredLeft);
s.append (font.getTypefaceName(), font.withPointHeight (height * 0.7f), Colours::black);
s.append (" " + font.getTypefaceName(), Font (height * 0.5f, Font::italic), Colours::grey);
s.draw (g, Rectangle<int> (width, height).expanded (-4, 50).toFloat());
}
示例3: paint
void paint (Graphics& g) override
{
Rectangle<float> area (getLocalBounds().toFloat().reduced (2.0f));
g.setColour (Colours::orange.withAlpha (0.6f));
g.fillRoundedRectangle (area, 10.0f);
g.setColour (Colours::darkgrey);
g.drawRoundedRectangle (area, 10.0f, 2.0f);
AttributedString s;
s.setJustification (Justification::centred);
s.setWordWrap (AttributedString::none);
s.append ("Balls!\n"
"(Drag Me)");
s.setColour (Colours::black);
s.draw (g, area);
}