예제 #1
0
void StateMachineView::paint(Graphics & g)
{
	BaseManagerViewUI::paint(g);

	if (transitionCreationMode)

	{
		//Point<int> midP = (transitionCreationSourceUI->getBounds().getCentre() + getMouseXYRelative()) / 2;
		Point<int> sourceP = transitionCreationSourceUI->getBounds().getConstrainedPoint(getMouseXYRelative());
		g.setColour(HIGHLIGHT_COLOR);
		Line<float> line(sourceP.x, sourceP.y, getMouseXYRelative().x, getMouseXYRelative().y);
		float dl[] = {5,5};
		g.drawDashedLine(line, dl, 2);
	}
}
void FilterGraph::mouseMove (const MouseEvent &event)
{
    Point <int> mousePos =  getMouseXYRelative();
    int xPos = mousePos.getX();
    float freq = xToFreq (xPos);
    
    if (traceType == Magnitude)
    {
        float magnitude = (float) (filterVector [0].getResponse (freq).magnitudeValue);
    
        for (int i = 1; i < numFilters; i++)
        {
            magnitude *= (float) (filterVector [i].getResponse (freq).magnitudeValue);
        }
    
        magnitude = 20 * log10 (magnitude);
    
        setTooltip (String (freq, 1) + "Hz, " + String (magnitude, 1) + "dB");
    }
    
    if (traceType == Phase)
    {
        float phase = (float) (filterVector [0].getResponse (freq).phaseValue);
    
        for (int i = 1; i < numFilters; i++)
        {
            phase += (float) (filterVector [i].getResponse (freq).phaseValue);
        }
        
        phase /= float_Pi;
    
        setTooltip (String (freq, 1) + "Hz, " + String (phase, 2) + String (CharPointer_UTF8 ("\xcf\x80")) + "rad");
    }
}
String LuftikusAudioProcessorEditor::getTooltip()
{
	const juce::Rectangle<int> rect(108, 156, 115, 40);

	if (rect.contains(getMouseXYRelative()))
		return "Click here to toggle tooltips";
	
	return String::empty;
}
예제 #4
0
    String getTooltip()
    {
        const int columnId = owner.getHeader().getColumnIdAtX (getMouseXYRelative().getX());

        if (columnId != 0 && owner.getModel() != nullptr)
            return owner.getModel()->getCellTooltip (row, columnId);

        return String::empty;
    }
    String getTooltip() override
    {
        const int columnId = owner.getHeader().getColumnIdAtX (getMouseXYRelative().getX());

        if (columnId != 0)
            if (TableListBoxModel* m = owner.getModel())
                return m->getCellTooltip (row, columnId);

        return String::empty;
    }
예제 #6
0
    const String getTooltip()
    {
        Rectangle<int> pos;
        TreeViewItem* const item = findItemAt (getMouseXYRelative().getY(), pos);

        if (item != 0)
            return item->getTooltip();

        return owner.getTooltip();
    }
void BookmarkFolderContainer::unSelectedChildren()
{
    for (std::vector<ScopedPointer<BookmarkFolder> >::iterator it = folderContainer.begin();
        it != folderContainer.end(); ++it)
    {
        if (! (*it)->getBounds().contains(getMouseXYRelative()))
        {
            (*it)->unSelected();
        }
    }
}
예제 #8
0
void CallOutBox::inputAttemptWhenModal()
{
    if (dismissalMouseClicksAreAlwaysConsumed
         || targetArea.contains (getMouseXYRelative() + getBounds().getPosition()))
    {
        // if you click on the area that originally popped-up the callout, you expect it
        // to get rid of the box, but deleting the box here allows the click to pass through and
        // probably re-trigger it, so we need to dismiss the box asynchronously to consume the click..
        dismiss();
    }
    else
    {
        exitModalState (0);
        setVisible (false);
    }
}
void BookmarkFolder::paint(Graphics& g)
{
    g.fillAll(Colours::white);
    if (bHover || bSelected)
    {
        validRect = Rectangle<int>(0, 0, getWidth(), iconWidth + 2 );
        Point<int> mPos = getMouseXYRelative();
        if (validRect.contains(mPos) || bSelected)
        {
            g.setColour(Colours::blue.withAlpha(bSelected ? 0.35f : 0.15f));
            g.fillRect(validRect);
            g.setColour(Colours::lightgrey);
            g.drawRect(validRect, 1);
        }
    }
}
예제 #10
0
void CallOutBox::inputAttemptWhenModal()
{
    const Point<int> mousePos (getMouseXYRelative() + getBounds().getPosition());

    if (targetArea.contains (mousePos))
    {
        // if you click on the area that originally popped-up the callout, you expect it
        // to get rid of the box, but deleting the box here allows the click to pass through and
        // probably re-trigger it, so we need to dismiss the box asynchronously to consume the click..
        postCommandMessage (callOutBoxDismissCommandId);
    }
    else
    {
        exitModalState (0);
        setVisible (false);
    }
}
//====================================================================================
void DraggableWaveDisplay::timerCallback (const int timerId)
{
	if (timerId == waveformUpdated) //moved due to file position changing
	{
		movedX = roundToInt (timeToPixels (filePlayer.getAudioTransportSource()->getCurrentPosition()));

		if (! movedX.areEqual())
			repaint();
	}
	else if (timerId == waveformMoved) // being dragged
	{
		if (isMouseDown)
		{
			mouseX = getMouseXYRelative().getX();
			const int currentXDrag = mouseX.getDifference();
			
			if (currentXDrag != 0)
			{
				const double position = filePlayer.getAudioTransportSource()->getCurrentPosition() - pixelsToTime (currentXDrag);
				filePlayer.getAudioTransportSource()->setPosition (position);

				repaint();
			}
		}
	}
    else if (timerId == waveformLoading)
    {
        const int w = getWidth();
        const int playHeadXPos = roundToInt (playheadPos * w);
        const double timeToPlayHead = pixelsToTime (playHeadXPos);
        const double startTime = filePlayer.getAudioTransportSource()->getCurrentPosition() - timeToPlayHead;
        const double timeToDisplay = pixelsToTime (w);
        
        const double timeAtEnd = startTime + timeToDisplay;
        
        if (audioThumbnailImage.getTimeRendered() <= timeAtEnd)
            repaint();
        
        if (audioThumbnailImage.hasFinishedLoading())
        {
            repaint();
            stopTimer (waveformLoading);
        }
    }
}
예제 #12
0
void CallOutBox::inputAttemptWhenModal()
{
    if (dismissalMouseClicksAreAlwaysConsumed
         || targetArea.contains (getMouseXYRelative() + getBounds().getPosition()))
    {
        // if you click on the area that originally popped-up the callout, you expect it
        // to get rid of the box, but deleting the box here allows the click to pass through and
        // probably re-trigger it, so we need to dismiss the box asynchronously to consume the click..

        // For touchscreens, we make sure not to dismiss the CallOutBox immediately,
        // as Windows still sends touch events before the CallOutBox had a chance
        // to really open.

        RelativeTime elapsed = Time::getCurrentTime() - creationTime;
        if (elapsed.inMilliseconds() > 200)
            dismiss();
    }
    else
    {
        exitModalState (0);
        setVisible (false);
    }
}
void MidiKeyboardComponent::timerCallback()
{
    updateNoteUnderMouse (getMouseXYRelative());
}
예제 #14
0
void MenuBarComponent::timerCallback()
{
    stopTimer();
    updateItemUnderMouse (getMouseXYRelative());
}
예제 #15
0
void GuitarNeckComponent::timerCallback()
{
    updateNoteUnderMouse (getMouseXYRelative());
}