Пример #1
0
void TreeView::setRootItem (TreeViewItem* const newRootItem)
{
    if (rootItem != newRootItem)
    {
        if (newRootItem != 0)
        {
            jassert (newRootItem->ownerView == 0); // can't use a tree item in more than one tree at once..

            if (newRootItem->ownerView != 0)
                newRootItem->ownerView->setRootItem (0);
        }

        if (rootItem != 0)
            rootItem->setOwnerView (0);

        rootItem = newRootItem;

        if (newRootItem != 0)
            newRootItem->setOwnerView (this);

        needsRecalculating = true;
        handleAsyncUpdate();

        if (rootItem != 0 && (defaultOpenness || ! rootItemVisible))
        {
            rootItem->setOpen (false); // force a re-open
            rootItem->setOpen (true);
        }
    }
}
Пример #2
0
void TreeView::resized()
{
    viewport->setBounds (getLocalBounds());

    itemsChanged();
    handleAsyncUpdate();
}
Пример #3
0
void AsyncUpdater::handleUpdateNowIfNeeded()
{
    // This can only be called by the event thread.
    jassert (MessageManager::getInstance()->currentThreadHasLockedMessageManager());

    if (activeMessage->shouldDeliver.exchange (0) != 0)
        handleAsyncUpdate();
}
void AsyncUpdater::handleUpdateNowIfNeeded()
{
    if (asyncMessagePending)
    {
        asyncMessagePending = false;
        handleAsyncUpdate();
    }
}
void Engine::createNewGraph(){
  engineListeners.call(&EngineListener::startLoadFile);
  clear();
  isLoadingFile = true;

  //init with default data here

  setFile(File());
  isLoadingFile = false;
  handleAsyncUpdate();

}
Пример #6
0
void LR_IPC_OUT::handleMidiNote(int midiChannel, int note)
{
    MIDI_Message note_msg(midiChannel, note, false);

    if (!CommandMap::getInstance().messageExistsInMap(note_msg) || 
         CommandMap::getInstance().getCommandforMessage(note_msg) == "Unmapped" ||
        find(LRCommandList::ProfileList.begin(),
            LRCommandList::ProfileList.end(),
            CommandMap::getInstance().getCommandforMessage(note_msg)) != LRCommandList::ProfileList.end())
        return;

    _commandToSend = CommandMap::getInstance().getCommandforMessage(note_msg);
    _valueToSend = 127;
    handleAsyncUpdate();
}
Пример #7
0
void LR_IPC_OUT::handleMidiCC(int midiChannel, int controller, int value)
{
    MIDI_Message cc(midiChannel, controller, true);

    if (!CommandMap::getInstance().messageExistsInMap(cc) || 
         CommandMap::getInstance().getCommandforMessage(cc) == "Unmapped" ||
         find(LRCommandList::ProfileList.begin(), 
              LRCommandList::ProfileList.end(),
              CommandMap::getInstance().getCommandforMessage(cc)) != LRCommandList::ProfileList.end())
        return;

    _commandToSend = CommandMap::getInstance().getCommandforMessage(cc);
    _valueToSend = value;
    handleAsyncUpdate();
}
Пример #8
0
void TreeView::scrollToKeepItemVisible (TreeViewItem* item)
{
    if (item != 0 && item->ownerView == this)
    {
        handleAsyncUpdate();

        item = item->getDeepestOpenParentItem();

        int y = item->y;
        int viewTop = viewport->getViewPositionY();

        if (y < viewTop)
        {
            viewport->setViewPosition (viewport->getViewPositionX(), y);
        }
        else if (y + item->itemHeight > viewTop + viewport->getViewHeight())
        {
            viewport->setViewPosition (viewport->getViewPositionX(),
                                       (y + item->itemHeight) - viewport->getViewHeight());
        }
    }
}
Пример #9
0
void Blender::setInitialized()
{
    m_initialized = true;
    handleAsyncUpdate();
}