本文整理汇总了C++中var::isVoid方法的典型用法代码示例。如果您正苦于以下问题:C++ var::isVoid方法的具体用法?C++ var::isVoid怎么用?C++ var::isVoid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类var
的用法示例。
在下文中一共展示了var::isVoid方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addWindow
void MultiDocumentPanel::addWindow (Component* component)
{
MultiDocumentPanelWindow* const dw = createNewDocumentWindow();
dw->setResizable (true, false);
dw->setContentNonOwned (component, true);
dw->setName (component->getName());
const var bkg (component->getProperties() ["mdiDocumentBkg_"]);
dw->setBackgroundColour (bkg.isVoid() ? backgroundColour : Colour ((uint32) static_cast <int> (bkg)));
int x = 4;
Component* const topComp = getChildComponent (getNumChildComponents() - 1);
if (topComp != nullptr && topComp->getX() == x && topComp->getY() == x)
x += 16;
dw->setTopLeftPosition (x, x);
const var pos (component->getProperties() ["mdiDocumentPos_"]);
if (pos.toString().isNotEmpty())
dw->restoreWindowStateFromString (pos.toString());
addAndMakeVisible (dw);
dw->toFront (true);
}
开发者ID:SimpleSoftwareSynthesizer,项目名称:SimpleSoftwareSynthesizer,代码行数:26,代码来源:juce_MultiDocumentPanel.cpp
示例2: refreshFromValueTree
//==============================================================================
void DrawableImage::refreshFromValueTree (const ValueTree& tree, ImageProvider* imageProvider)
{
const ValueTreeWrapper controller (tree);
setName (controller.getID());
const float newOpacity = controller.getOpacity();
const Colour newOverlayColour (controller.getOverlayColour());
Image newImage;
const var imageIdentifier (controller.getImageIdentifier());
jassert (imageProvider != 0 || imageIdentifier.isVoid()); // if you're using images, you need to provide something that can load and save them!
if (imageProvider != 0)
newImage = imageProvider->getImageForIdentifier (imageIdentifier);
const RelativeParallelogram newBounds (controller.getBoundingBox());
if (newOpacity != opacity || overlayColour != newOverlayColour || image != newImage)
{
repaint();
opacity = newOpacity;
overlayColour = newOverlayColour;
bounds = newBounds;
setImage (newImage);
}
}
示例3: mouseDrag
void mouseDrag (const MouseEvent& e)
{
if (isEnabled() && owner.getModel() != nullptr && ! (e.mouseWasClicked() || isDragging))
{
const SparseSet<int> selectedRows (owner.getSelectedRows());
if (selectedRows.size() > 0)
{
const var dragDescription (owner.getModel()->getDragSourceDescription (selectedRows));
if (! (dragDescription.isVoid() || (dragDescription.isString() && dragDescription.toString().isEmpty())))
{
isDragging = true;
owner.startDragAndDrop (e, dragDescription);
}
}
}
}
示例4: mouseDrag
void mouseDrag (const MouseEvent& e) override
{
if (isEnabled() && owner.getModel() != nullptr && ! (e.mouseWasClicked() || isDragging))
{
SparseSet<int> rowsToDrag;
if (owner.selectOnMouseDown || owner.isRowSelected (row))
rowsToDrag = owner.getSelectedRows();
else
rowsToDrag.addRange (Range<int>::withStartAndLength (row, 1));
if (rowsToDrag.size() > 0)
{
const var dragDescription (owner.getModel()->getDragSourceDescription (rowsToDrag));
if (! (dragDescription.isVoid() || (dragDescription.isString() && dragDescription.toString().isEmpty())))
{
isDragging = true;
owner.startDragAndDrop (e, rowsToDrag, dragDescription, true);
}
}
}
}
示例5: getOpacityFromVar
static float getOpacityFromVar (const var& v)
{
return v.isVoid() ? 1.0f : static_cast<float> (v);
}