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); } } }
void TreeView::resized() { viewport->setBounds (getLocalBounds()); itemsChanged(); handleAsyncUpdate(); }
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(); }
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(); }
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(); }
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()); } } }
void Blender::setInitialized() { m_initialized = true; handleAsyncUpdate(); }