本文整理汇总了C++中AlertWindow::findColour方法的典型用法代码示例。如果您正苦于以下问题:C++ AlertWindow::findColour方法的具体用法?C++ AlertWindow::findColour怎么用?C++ AlertWindow::findColour使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AlertWindow
的用法示例。
在下文中一共展示了AlertWindow::findColour方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawAlertBox
void CabbageIDELookAndFeel::drawAlertBox (Graphics& g,
AlertWindow& alert,
const Rectangle<int>& textArea,
TextLayout& textLayout)
{
g.fillAll (CabbageSettings::getColourFromValueTree (colourTree, CabbageColourIds::alertWindowBackground, Colour (Colour::fromString("2ff52636a"))));
int iconSpaceUsed = 160;
if (alert.getAlertType() != AlertWindow::NoIcon)
{
Path icon;
if (alert.getAlertType() == AlertWindow::WarningIcon)
{
Rectangle<float> rect (alert.getLocalBounds().removeFromLeft (iconSpaceUsed).toFloat());
const Image warningImage = ImageCache::getFromMemory (CabbageBinaryData::WarningIcon_png, CabbageBinaryData::WarningIcon_pngSize);
//g.drawImage(warningImage, rect.reduced(20));
}
if (alert.getAlertType() == AlertWindow::QuestionIcon)
{
Rectangle<float> rect (alert.getLocalBounds().removeFromLeft (iconSpaceUsed - 20).toFloat());
const Image warningImage = ImageCache::getFromMemory (CabbageBinaryData::WarningIcon_png, CabbageBinaryData::WarningIcon_pngSize);
//g.drawImage(warningImage, rect.reduced(25));
}
MemoryInputStream svgStream (CabbageBinaryData::processstop_svg, CabbageBinaryData::processstop_svgSize, false);
ScopedPointer<XmlElement> svg (XmlDocument::parse (svgStream.readString()));
if (svg == nullptr)
jassert (false);
ScopedPointer<Drawable> drawable;
if (svg != nullptr)
{
drawable = Drawable::createFromSVG (*svg);
Rectangle<float> rect (20, 20, 80, 80);//alert.getLocalBounds().removeFromLeft (iconSpaceUsed - 20).withHeight(130).toFloat());
drawable->setTransformToFit (rect, RectanglePlacement::stretchToFit);
drawable->draw (g, 1.f, AffineTransform());
}
}
g.setColour (alert.findColour (AlertWindow::textColourId));
textLayout.draw (g, Rectangle<int> (textArea.getX() + iconSpaceUsed - 50,
textArea.getY(),
textArea.getWidth() - iconSpaceUsed - 40,
textArea.getHeight()).toFloat());
g.setColour (alert.findColour (AlertWindow::outlineColourId));
g.drawRect (0, 0, alert.getWidth(), alert.getHeight());
}
示例2: AlertTextComp
AlertTextComp (AlertWindow& owner, const String& message, const Font& font)
{
setReadOnly (true);
setMultiLine (true, true);
setCaretVisible (false);
setScrollbarsShown (true);
lookAndFeelChanged();
setWantsKeyboardFocus (false);
setFont (font);
setText (message, false);
bestWidth = 2 * (int) std::sqrt (font.getHeight() * font.getStringWidth (message));
if (owner.isColourSpecified (AlertWindow::textColourId))
setColour (TextEditor::textColourId, owner.findColour (AlertWindow::textColourId));
setColour (TextEditor::backgroundColourId, Colours::transparentBlack);
setColour (TextEditor::outlineColourId, Colours::transparentBlack);
setColour (TextEditor::shadowColourId, Colours::transparentBlack);
}