当前位置: 首页>>代码示例>>C++>>正文


C++ ProcessorListItem::getName方法代码示例

本文整理汇总了C++中ProcessorListItem::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ ProcessorListItem::getName方法的具体用法?C++ ProcessorListItem::getName怎么用?C++ ProcessorListItem::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ProcessorListItem的用法示例。


在下文中一共展示了ProcessorListItem::getName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: mouseDrag

void ProcessorList::mouseDrag(const MouseEvent& e)
{

	if (e.getMouseDownX() < getWidth() && !(isDragging))
	{

		ProcessorListItem* listItem = getListItemForYPos(e.getMouseDownY());

		if (listItem != 0)
		{

			if (!listItem->hasSubItems())
			{
				isDragging = true;

				String b = listItem->getName();

				const String dragDescription = b;

				//std::cout << dragDescription << std::endl;

				if (dragDescription.isNotEmpty())
				{
					DragAndDropContainer* const dragContainer
						= DragAndDropContainer::findParentDragContainerFor(this);

					if (dragContainer != 0)
					{
						//pos.setSize (pos.getWidth(), 10);

						Image dragImage(Image::ARGB, 100, 15, true);

						Graphics g(dragImage);
						g.setColour(findColour(listItem->colorId));
						g.fillAll();
						g.setColour(Colours::white);
						g.setFont(14);
						g.drawSingleLineText(listItem->getName(),10,12);//,75,15,Justification::centredRight,true);

						dragImage.multiplyAllAlphas(0.6f);

						Point<int> imageOffset(20,10);

						//See ProcessorGraph::createProcesorFromDescription for description info
						Array<var> dragData;
						dragData.add(true);
						dragData.add(dragDescription);
						dragData.add(listItem->processorType);
						dragData.add(listItem->processorId);
						dragData.add(listItem->getParentName());

						dragContainer->startDragging(dragData, this,
								dragImage, true, &imageOffset);
					}
				}
			}
		}
	}

}
开发者ID:LabPF,项目名称:plugin-GUI,代码行数:60,代码来源:ProcessorList.cpp

示例2: mouseDrag

void ProcessorList::mouseDrag(const MouseEvent& e) 
{

	if (e.getMouseDownX() < getWidth()-getScrollBarWidth() && !(isDragging))
	{

		ProcessorListItem* fli = getListItemForYPos(e.getMouseDownY());

		if (fli != 0)
		{

			if (!fli->hasSubItems())
			{
				isDragging = true;

				String b = fli->getParentName();
				b += "/";
				b += fli->getName();

				const String dragDescription = b;

				//std::cout << dragDescription << std::endl;

				if (dragDescription.isNotEmpty())
				{
					DragAndDropContainer* const dragContainer
						= DragAndDropContainer::findParentDragContainerFor (this);

					if (dragContainer != 0)
					{
						//pos.setSize (pos.getWidth(), 10);

						Image dragImage (Image::ARGB, 100, 15, true);

						Graphics g(dragImage);
						g.setColour (fli->color);
						g.fillAll();
						g.setColour(Colours::white);
						g.setFont(14);
						g.drawSingleLineText(fli->getName(),10,12);//,75,15,Justification::centredRight,true);

						dragImage.multiplyAllAlphas(0.6f);

						Point<int> imageOffset (20,10);
						dragContainer->startDragging(dragDescription, this,
											         dragImage, true, &imageOffset);
					}
				}
			}
		}
	}

	mouseDragInCanvas(e);
}
开发者ID:karlssonm,项目名称:GUI,代码行数:54,代码来源:ProcessorList.cpp

示例3: mouseDown

void ProcessorList::mouseDown(const MouseEvent& e)
{

    isDragging = false;

    Point<int> pos = e.getPosition();
    int xcoord = pos.getX();
    int ycoord = pos.getY();

    //std::cout << xcoord << " " << ycoord << std::endl;

    ProcessorListItem* listItem = getListItemForYPos(ycoord);

    if (listItem != 0)
    {
        //std::cout << "Selecting: " << fli->getName() << std::endl;
        if (!listItem->hasSubItems())
        {
            clearSelectionState();
            listItem->setSelected(true);
        }

    }
    else
    {
        //std::cout << "No selection." << std::endl;
    }

    if (listItem != 0)
    {
        if (xcoord < getWidth())
        {
            if (e.mods.isRightButtonDown() || e.mods.isCtrlDown())
            {

                if (listItem->getName().equalsIgnoreCase("Sources"))
                {
                    currentColor = SOURCE_COLOR;
                }
                else if (listItem->getName().equalsIgnoreCase("Filters"))
                {
                    currentColor = FILTER_COLOR;
                }
                else if (listItem->getName().equalsIgnoreCase("Utilities"))
                {
                    currentColor = UTILITY_COLOR;
                }
                else if (listItem->getName().equalsIgnoreCase("Sinks"))
                {
                    currentColor = SINK_COLOR;
                }
                else
                {
                    return;
                }

                int options=0;
                options += (0 << 0); // showAlpha
                options += (0 << 1); // showColorAtTop
                options += (0 << 2); // showSliders
                options += (1 << 3); // showColourSpace

                ColourSelector colourSelector(options);
                colourSelector.setName("background");
                colourSelector.setCurrentColour(findColour(currentColor));
                colourSelector.addChangeListener(this);
                colourSelector.addChangeListener(AccessClass::getProcessorGraph());
                colourSelector.setColour(ColourSelector::backgroundColourId, Colours::transparentBlack);
                colourSelector.setSize(300, 275);

                juce::Rectangle<int> rect = juce::Rectangle<int>(0,0,10,10);

                CallOutBox callOut(colourSelector, rect, nullptr);
                callOut.setTopLeftPosition(e.getScreenX(), e.getScreenY());
                callOut.setArrowSize(0.0f);

                callOut.runModalLoop();

            }
            else
            {
                listItem->reverseOpenState();
            }
        }

        if (listItem == baseItem)
        {
            if (listItem->isOpen())
            {
                AccessClass::getUIComponent()->childComponentChanged();
            }
            else
            {
                AccessClass::getUIComponent()->childComponentChanged();
                // totalHeight = itemHeight + 2*yBuffer;
            }

        }
    }

//.........这里部分代码省略.........
开发者ID:ArmandNM,项目名称:GUI,代码行数:101,代码来源:ProcessorList.cpp


注:本文中的ProcessorListItem::getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。