本文整理汇总了C++中GlyphArrangement::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ GlyphArrangement::clear方法的具体用法?C++ GlyphArrangement::clear怎么用?C++ GlyphArrangement::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GlyphArrangement
的用法示例。
在下文中一共展示了GlyphArrangement::clear方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: paintListBoxItem
void PluginListComponent::paintListBoxItem (int row, Graphics& g, int width, int height, bool rowIsSelected)
{
if (rowIsSelected)
g.fillAll (findColour (TextEditor::highlightColourId));
String name, desc;
bool isBlacklisted = false;
if (row >= list.getNumTypes())
{
isBlacklisted = true;
name = list.getBlacklistedFiles() [row - list.getNumTypes()];
desc = TRANS("Deactivated after failing to initialise correctly");
}
else if (const PluginDescription* const pd = list.getType (row))
{
name = pd->name;
desc << pd->pluginFormatName
<< (pd->isInstrument ? " instrument" : " effect")
<< " - " << pd->numInputChannels << (pd->numInputChannels == 1 ? " in" : " ins")
<< " / " << pd->numOutputChannels << (pd->numOutputChannels == 1 ? " out" : " outs");
if (pd->manufacturerName.isNotEmpty()) desc << " - " << pd->manufacturerName;
if (pd->version.isNotEmpty()) desc << " - " << pd->version;
if (pd->category.isNotEmpty()) desc << " - category: '" << pd->category << '\'';
}
if (name.isNotEmpty())
{
GlyphArrangement ga;
ga.addCurtailedLineOfText (Font (height * 0.7f, Font::bold),
name, 8.0f, height * 0.8f, width - 10.0f, true);
g.setColour (isBlacklisted ? Colours::red : Colours::black);
ga.draw (g);
const Rectangle<float> bb (ga.getBoundingBox (0, -1, false));
ga.clear();
ga.addCurtailedLineOfText (Font (height * 0.6f), desc,
jmax (bb.getRight() + 10.0f, width / 3.0f), height * 0.8f,
width - bb.getRight() - 12.0f, true);
g.setColour (isBlacklisted ? Colours::red : Colours::grey);
ga.draw (g);
}
}
示例2: paintListBoxItem
void PluginListComponent::paintListBoxItem (int row,
Graphics& g,
int width, int height,
bool rowIsSelected)
{
if (rowIsSelected)
g.fillAll (findColour (TextEditor::highlightColourId));
const PluginDescription* const pd = list.getType (row);
if (pd != 0)
{
GlyphArrangement ga;
ga.addCurtailedLineOfText (Font (height * 0.7f, Font::bold), pd->name, 8.0f, height * 0.8f, width - 10.0f, true);
g.setColour (Colours::black);
ga.draw (g);
float x, y, r, b;
ga.getBoundingBox (0, -1, x, y, r, b, false);
String desc;
desc << pd->pluginFormatName
<< (pd->isInstrument ? " instrument" : " effect")
<< " - "
<< pd->numInputChannels << (pd->numInputChannels == 1 ? " in" : " ins")
<< " / "
<< pd->numOutputChannels << (pd->numOutputChannels == 1 ? " out" : " outs");
if (pd->manufacturerName.isNotEmpty())
desc << " - " << pd->manufacturerName;
if (pd->version.isNotEmpty())
desc << " - " << pd->version;
if (pd->category.isNotEmpty())
desc << " - category: '" << pd->category << '\'';
g.setColour (Colours::grey);
ga.clear();
ga.addCurtailedLineOfText (Font (height * 0.6f), desc, r + 10.0f, height * 0.8f, width - r - 12.0f, true);
ga.draw (g);
}
}
示例3: getMessageHeight
const int EdoChatWindowMessage::getMessageHeight(const int parentWidth, const Justification justification)
{
GlyphArrangement messageGlyphs;
float top,left,right,bottom;
applyOptions();
messageGlyphs.clear();
messageGlyphs.addJustifiedText (
EdoRestoreFont (getPropertyString(EWND_MESSAGE_FONT), Font(14)),
messageLabel->getText(),
0,
0,
(float)parentWidth,
justification
);
messageGlyphs.getBoundingBox (0, -1, left, top, right, bottom, true);
messageHeight = roundFloatToInt ((bottom - top) + SPACER);
// Log (String::formatted (T("EdoChatWindowMessage::getMessageHeight parentWidth: %d height: %d"), parentWidth, messageHeight));
if (avatar->isVisible())
{
if (messageHeight < (avatar->getHeight()+16))
{
messageHeight = avatar->getHeight()+16;
return (messageHeight+SPACER);
}
else
{
return (messageHeight+SPACER);
}
}
else
{
return (messageHeight+SPACER);
}
}