| @@ -16,6 +16,9 @@ Changelist for version 1.44 | |||||
| - added a Component::setExplicitFocusOrder() method for specifying the order in which components have their focus traversed, and added Jucer support for setting this value. | - added a Component::setExplicitFocusOrder() method for specifying the order in which components have their focus traversed, and added Jucer support for setting this value. | ||||
| - made slider skew factor editable in the jucer | - made slider skew factor editable in the jucer | ||||
| - added a background thread to the MidiOutput class, so it can be given a batch of midi events and will dispatch them itself based on their timestamps. | - added a background thread to the MidiOutput class, so it can be given a batch of midi events and will dispatch them itself based on their timestamps. | ||||
| - added MultiDocumentPanel::createNewDocumentWindow() method to allow creation of custom document windows in a MultiDocumentPanel | |||||
| - added a Thread::getCurrentThread() method | |||||
| - added an option to MessageManagerLock that can check for thread termination, to avoid deadlocks. | |||||
| ============================================================================== | ============================================================================== | ||||
| Changelist for version 1.43 | Changelist for version 1.43 | ||||
| @@ -332,7 +332,8 @@ bool MessageManager::currentThreadHasLockedMessageManager() const | |||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| MessageManagerLock::MessageManagerLock() | |||||
| MessageManagerLock::MessageManagerLock() throw() | |||||
| : locked (true) | |||||
| { | { | ||||
| if (MessageManager::instance != 0) | if (MessageManager::instance != 0) | ||||
| { | { | ||||
| @@ -342,9 +343,36 @@ MessageManagerLock::MessageManagerLock() | |||||
| } | } | ||||
| } | } | ||||
| MessageManagerLock::~MessageManagerLock() | |||||
| MessageManagerLock::MessageManagerLock (Thread* const thread) throw() | |||||
| { | { | ||||
| jassert (thread != 0); // This will only work if you give it a valid thread! | |||||
| if (MessageManager::instance != 0) | if (MessageManager::instance != 0) | ||||
| { | |||||
| for (;;) | |||||
| { | |||||
| if (MessageManager::instance->messageDispatchLock.tryEnter()) | |||||
| { | |||||
| locked = true; | |||||
| lastLockingThreadId = MessageManager::instance->currentLockingThreadId; | |||||
| MessageManager::instance->currentLockingThreadId = Thread::getCurrentThreadId(); | |||||
| break; | |||||
| } | |||||
| if (thread != 0 && thread->threadShouldExit()) | |||||
| { | |||||
| locked = false; | |||||
| break; | |||||
| } | |||||
| Thread::sleep (1); | |||||
| } | |||||
| } | |||||
| } | |||||
| MessageManagerLock::~MessageManagerLock() throw() | |||||
| { | |||||
| if (locked && MessageManager::instance != 0) | |||||
| { | { | ||||
| MessageManager::instance->currentLockingThreadId = lastLockingThreadId; | MessageManager::instance->currentLockingThreadId = lastLockingThreadId; | ||||
| MessageManager::instance->messageDispatchLock.exit(); | MessageManager::instance->messageDispatchLock.exit(); | ||||
| @@ -36,6 +36,7 @@ | |||||
| #include "../../juce_core/containers/juce_SortedSet.h" | #include "../../juce_core/containers/juce_SortedSet.h" | ||||
| #include "juce_ActionListenerList.h" | #include "juce_ActionListenerList.h" | ||||
| #include "juce_Timer.h" | #include "juce_Timer.h" | ||||
| class Thread; | |||||
| class InternalTimerThread; | class InternalTimerThread; | ||||
| @@ -265,26 +266,74 @@ private: | |||||
| class JUCE_API MessageManagerLock | class JUCE_API MessageManagerLock | ||||
| { | { | ||||
| public: | public: | ||||
| /** Acquires a lock on the message manager. | |||||
| //============================================================================== | |||||
| /** Tries to acquire a lock on the message manager. | |||||
| When this constuctor returns, the message manager will have finished sending the | |||||
| If this constructor | |||||
| When this constructor returns, the message manager will have finished processing the | |||||
| last message and will not send another message until this MessageManagerLock is | last message and will not send another message until this MessageManagerLock is | ||||
| deleted. | deleted. | ||||
| If the current thread already has the lock, nothing will be done, so it's perfectly | If the current thread already has the lock, nothing will be done, so it's perfectly | ||||
| safe to create these locks recursively. | safe to create these locks recursively. | ||||
| */ | */ | ||||
| MessageManagerLock(); | |||||
| MessageManagerLock() throw(); | |||||
| /** Releases the current thread's lock on the message manager. | /** Releases the current thread's lock on the message manager. | ||||
| Make sure this object is created and deleted by the same thread, | Make sure this object is created and deleted by the same thread, | ||||
| otherwise there are no guarantees what will happen! | otherwise there are no guarantees what will happen! | ||||
| */ | */ | ||||
| ~MessageManagerLock(); | |||||
| ~MessageManagerLock() throw(); | |||||
| //============================================================================== | |||||
| /** Tries to acquire a lock on the message manager. | |||||
| This does the same thing as the normal constructor, but while it's waiting to get | |||||
| the lock, it checks the specified thread to see if it has been given the | |||||
| Thread::signalThreadShouldExit() signal. If this happens, then it will return | |||||
| without gaining the lock. | |||||
| To find out whether the lock was successful, call lockWasGained(). If this is | |||||
| false, your thread is being told to die, so you'd better get out of there. | |||||
| If the current thread already has the lock, nothing will be done, so it's perfectly | |||||
| safe to create these locks recursively. | |||||
| E.g. | |||||
| @code | |||||
| void run() | |||||
| { | |||||
| ... | |||||
| while (! threadShouldExit()) | |||||
| { | |||||
| MessageManagerLock mml (Thread::getCurrentThread()); | |||||
| if (! mml.lockWasGained) | |||||
| return; // another thread is trying to kill us! | |||||
| ..do some locked stuff here.. | |||||
| } | |||||
| ..and now the MM is now unlocked.. | |||||
| } | |||||
| @endcode | |||||
| */ | |||||
| MessageManagerLock (Thread* const threadToCheckForExitSignal) throw(); | |||||
| /** Returns true if the lock was successfully acquired. | |||||
| (See the constructor that takes a Thread for more info). | |||||
| */ | |||||
| bool lockWasGained() const throw() { return locked; } | |||||
| private: | private: | ||||
| int lastLockingThreadId; | int lastLockingThreadId; | ||||
| bool locked; | |||||
| }; | }; | ||||
| @@ -591,7 +591,7 @@ void TreeView::keyPressed (const KeyPress& key) | |||||
| } | } | ||||
| } | } | ||||
| void TreeView::itemsChanged() | |||||
| void TreeView::itemsChanged() throw() | |||||
| { | { | ||||
| needsRecalculating = true; | needsRecalculating = true; | ||||
| triggerAsyncUpdate(); | triggerAsyncUpdate(); | ||||
| @@ -733,7 +733,7 @@ void TreeViewItem::clearSubItems() | |||||
| } | } | ||||
| } | } | ||||
| void TreeViewItem::addSubItem (TreeViewItem* newItem, int insertPosition) | |||||
| void TreeViewItem::addSubItem (TreeViewItem* const newItem, const int insertPosition) | |||||
| { | { | ||||
| if (newItem != 0) | if (newItem != 0) | ||||
| { | { | ||||
| @@ -779,7 +779,7 @@ void TreeViewItem::removeSubItem (const int index, const bool deleteItem) | |||||
| ownerView->nodeAlterationLock.exit(); | ownerView->nodeAlterationLock.exit(); | ||||
| } | } | ||||
| bool TreeViewItem::isOpen() const | |||||
| bool TreeViewItem::isOpen() const throw() | |||||
| { | { | ||||
| if (openness == opennessDefault) | if (openness == opennessDefault) | ||||
| return ownerView != 0 && ownerView->defaultOpenness; | return ownerView != 0 && ownerView->defaultOpenness; | ||||
| @@ -852,7 +852,7 @@ const String TreeViewItem::getDragSourceDescription() | |||||
| return String::empty; | return String::empty; | ||||
| } | } | ||||
| const Rectangle TreeViewItem::getItemPosition (const bool relativeToTreeViewTopLeft) const | |||||
| const Rectangle TreeViewItem::getItemPosition (const bool relativeToTreeViewTopLeft) const throw() | |||||
| { | { | ||||
| const int indentX = getIndentX(); | const int indentX = getIndentX(); | ||||
| @@ -870,7 +870,7 @@ const Rectangle TreeViewItem::getItemPosition (const bool relativeToTreeViewTopL | |||||
| return r; | return r; | ||||
| } | } | ||||
| void TreeViewItem::treeHasChanged() const | |||||
| void TreeViewItem::treeHasChanged() const throw() | |||||
| { | { | ||||
| if (ownerView != 0) | if (ownerView != 0) | ||||
| ownerView->itemsChanged(); | ownerView->itemsChanged(); | ||||
| @@ -901,7 +901,7 @@ void TreeViewItem::updatePositions (int newY) | |||||
| } | } | ||||
| } | } | ||||
| TreeViewItem* TreeViewItem::getDeepestOpenParentItem() | |||||
| TreeViewItem* TreeViewItem::getDeepestOpenParentItem() throw() | |||||
| { | { | ||||
| TreeViewItem* result = this; | TreeViewItem* result = this; | ||||
| TreeViewItem* item = this; | TreeViewItem* item = this; | ||||
| @@ -917,7 +917,7 @@ TreeViewItem* TreeViewItem::getDeepestOpenParentItem() | |||||
| return result; | return result; | ||||
| } | } | ||||
| void TreeViewItem::setOwnerView (TreeView* const newOwner) | |||||
| void TreeViewItem::setOwnerView (TreeView* const newOwner) throw() | |||||
| { | { | ||||
| ownerView = newOwner; | ownerView = newOwner; | ||||
| @@ -925,7 +925,7 @@ void TreeViewItem::setOwnerView (TreeView* const newOwner) | |||||
| subItems.getUnchecked(i)->setOwnerView (newOwner); | subItems.getUnchecked(i)->setOwnerView (newOwner); | ||||
| } | } | ||||
| int TreeViewItem::getIndentX() const | |||||
| int TreeViewItem::getIndentX() const throw() | |||||
| { | { | ||||
| const int indentWidth = ownerView->getIndentSize(); | const int indentWidth = ownerView->getIndentSize(); | ||||
| int x = indentWidth; | int x = indentWidth; | ||||
| @@ -1039,7 +1039,7 @@ void TreeViewItem::paintRecursively (Graphics& g, int width) | |||||
| } | } | ||||
| } | } | ||||
| bool TreeViewItem::isLastOfSiblings() const | |||||
| bool TreeViewItem::isLastOfSiblings() const throw() | |||||
| { | { | ||||
| return parentItem == 0 | return parentItem == 0 | ||||
| || parentItem->subItems.getLast() == this; | || parentItem->subItems.getLast() == this; | ||||
| @@ -1051,7 +1051,7 @@ TreeViewItem* TreeViewItem::getTopLevelItem() throw() | |||||
| : parentItem->getTopLevelItem(); | : parentItem->getTopLevelItem(); | ||||
| } | } | ||||
| int TreeViewItem::getNumRows() const | |||||
| int TreeViewItem::getNumRows() const throw() | |||||
| { | { | ||||
| int num = 1; | int num = 1; | ||||
| @@ -1064,7 +1064,7 @@ int TreeViewItem::getNumRows() const | |||||
| return num; | return num; | ||||
| } | } | ||||
| TreeViewItem* TreeViewItem::getItemOnRow (int index) | |||||
| TreeViewItem* TreeViewItem::getItemOnRow (int index) throw() | |||||
| { | { | ||||
| if (index == 0) | if (index == 0) | ||||
| return this; | return this; | ||||
| @@ -1092,7 +1092,7 @@ TreeViewItem* TreeViewItem::getItemOnRow (int index) | |||||
| return 0; | return 0; | ||||
| } | } | ||||
| TreeViewItem* TreeViewItem::findItemRecursively (int y) | |||||
| TreeViewItem* TreeViewItem::findItemRecursively (int y) throw() | |||||
| { | { | ||||
| if (y >= 0 && y < totalHeight) | if (y >= 0 && y < totalHeight) | ||||
| { | { | ||||
| @@ -1120,7 +1120,7 @@ TreeViewItem* TreeViewItem::findItemRecursively (int y) | |||||
| return 0; | return 0; | ||||
| } | } | ||||
| int TreeViewItem::countSelectedItemsRecursively() const | |||||
| int TreeViewItem::countSelectedItemsRecursively() const throw() | |||||
| { | { | ||||
| int total = 0; | int total = 0; | ||||
| @@ -1133,7 +1133,7 @@ int TreeViewItem::countSelectedItemsRecursively() const | |||||
| return total; | return total; | ||||
| } | } | ||||
| TreeViewItem* TreeViewItem::getSelectedItemWithIndex (int index) | |||||
| TreeViewItem* TreeViewItem::getSelectedItemWithIndex (int index) throw() | |||||
| { | { | ||||
| if (isSelected()) | if (isSelected()) | ||||
| { | { | ||||
| @@ -1161,7 +1161,7 @@ TreeViewItem* TreeViewItem::getSelectedItemWithIndex (int index) | |||||
| return 0; | return 0; | ||||
| } | } | ||||
| int TreeViewItem::getRowNumberInTree() const | |||||
| int TreeViewItem::getRowNumberInTree() const throw() | |||||
| { | { | ||||
| if (parentItem != 0 && ownerView != 0) | if (parentItem != 0 && ownerView != 0) | ||||
| { | { | ||||
| @@ -1185,12 +1185,12 @@ int TreeViewItem::getRowNumberInTree() const | |||||
| } | } | ||||
| } | } | ||||
| void TreeViewItem::setLinesDrawnForSubItems (const bool drawLines) | |||||
| void TreeViewItem::setLinesDrawnForSubItems (const bool drawLines) throw() | |||||
| { | { | ||||
| drawLinesInside = drawLines; | drawLinesInside = drawLines; | ||||
| } | } | ||||
| TreeViewItem* TreeViewItem::getNextVisibleItem (const bool recurse) const | |||||
| TreeViewItem* TreeViewItem::getNextVisibleItem (const bool recurse) const throw() | |||||
| { | { | ||||
| if (recurse && isOpen() && subItems.size() > 0) | if (recurse && isOpen() && subItems.size() > 0) | ||||
| return subItems [0]; | return subItems [0]; | ||||
| @@ -90,8 +90,8 @@ public: | |||||
| @param insertPosition the index which the new item should have when it's added. If this | @param insertPosition the index which the new item should have when it's added. If this | ||||
| value is less than 0, the item will be added to the end of the list. | value is less than 0, the item will be added to the end of the list. | ||||
| */ | */ | ||||
| void addSubItem (TreeViewItem* newItem, | |||||
| int insertPosition = -1); | |||||
| void addSubItem (TreeViewItem* const newItem, | |||||
| const int insertPosition = -1); | |||||
| /** Removes one of the sub-items. | /** Removes one of the sub-items. | ||||
| @@ -110,7 +110,7 @@ public: | |||||
| //============================================================================== | //============================================================================== | ||||
| /** True if this item is currently open in the treeview. */ | /** True if this item is currently open in the treeview. */ | ||||
| bool isOpen() const; | |||||
| bool isOpen() const throw(); | |||||
| /** Opens or closes the item. | /** Opens or closes the item. | ||||
| @@ -142,14 +142,14 @@ public: | |||||
| the tree. If false, it is relative to the top-left of the topmost item in the | the tree. If false, it is relative to the top-left of the topmost item in the | ||||
| tree (so this would be unaffected by scrolling the view). | tree (so this would be unaffected by scrolling the view). | ||||
| */ | */ | ||||
| const Rectangle getItemPosition (const bool relativeToTreeViewTopLeft) const; | |||||
| const Rectangle getItemPosition (const bool relativeToTreeViewTopLeft) const throw(); | |||||
| /** Sends a signal to the treeview to make it refresh itself. | /** Sends a signal to the treeview to make it refresh itself. | ||||
| Call this if your items have changed and you want the tree to update to reflect | Call this if your items have changed and you want the tree to update to reflect | ||||
| this. | this. | ||||
| */ | */ | ||||
| void treeHasChanged() const; | |||||
| void treeHasChanged() const throw(); | |||||
| /** Returns the row number of this item in the tree. | /** Returns the row number of this item in the tree. | ||||
| @@ -157,13 +157,13 @@ public: | |||||
| @see TreeView::getNumRowsInTree(), TreeView::getItemOnRow() | @see TreeView::getNumRowsInTree(), TreeView::getItemOnRow() | ||||
| */ | */ | ||||
| int getRowNumberInTree() const; | |||||
| int getRowNumberInTree() const throw(); | |||||
| /** Changes whether lines are drawn to connect any sub-items to this item. | /** Changes whether lines are drawn to connect any sub-items to this item. | ||||
| By default, line-drawing is turned on. | By default, line-drawing is turned on. | ||||
| */ | */ | ||||
| void setLinesDrawnForSubItems (const bool shouldDrawLines); | |||||
| void setLinesDrawnForSubItems (const bool shouldDrawLines) throw(); | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Tells the tree whether this item can potentially be opened. | /** Tells the tree whether this item can potentially be opened. | ||||
| @@ -343,21 +343,21 @@ private: | |||||
| friend class TreeViewContentComponent; | friend class TreeViewContentComponent; | ||||
| void updatePositions (int newY); | void updatePositions (int newY); | ||||
| int getIndentX() const; | |||||
| void setOwnerView (TreeView* const newOwner); | |||||
| int getIndentX() const throw(); | |||||
| void setOwnerView (TreeView* const newOwner) throw(); | |||||
| void paintRecursively (Graphics& g, int width); | void paintRecursively (Graphics& g, int width); | ||||
| TreeViewItem* findItemRecursively (int y); | |||||
| TreeViewItem* getDeepestOpenParentItem(); | |||||
| TreeViewItem* findItemRecursively (int y) throw(); | |||||
| TreeViewItem* getDeepestOpenParentItem() throw(); | |||||
| void restoreFromXml (const XmlElement& e); | void restoreFromXml (const XmlElement& e); | ||||
| XmlElement* createXmlOpenness() const; | XmlElement* createXmlOpenness() const; | ||||
| bool isLastOfSiblings() const; | |||||
| bool isLastOfSiblings() const throw(); | |||||
| TreeViewItem* getTopLevelItem() throw(); | TreeViewItem* getTopLevelItem() throw(); | ||||
| int getNumRows() const; | |||||
| TreeViewItem* getItemOnRow (int index); | |||||
| int getNumRows() const throw(); | |||||
| TreeViewItem* getItemOnRow (int index) throw(); | |||||
| void deselectAllRecursively(); | void deselectAllRecursively(); | ||||
| int countSelectedItemsRecursively() const; | |||||
| TreeViewItem* getSelectedItemWithIndex (int index); | |||||
| TreeViewItem* getNextVisibleItem (const bool recurse) const; | |||||
| int countSelectedItemsRecursively() const throw(); | |||||
| TreeViewItem* getSelectedItemWithIndex (int index) throw(); | |||||
| TreeViewItem* getNextVisibleItem (const bool recurse) const throw(); | |||||
| TreeViewItem (const TreeViewItem&); | TreeViewItem (const TreeViewItem&); | ||||
| const TreeViewItem& operator= (const TreeViewItem&); | const TreeViewItem& operator= (const TreeViewItem&); | ||||
| @@ -521,6 +521,8 @@ public: | |||||
| include information about where the | include information about where the | ||||
| tree has been scrolled to vertically, | tree has been scrolled to vertically, | ||||
| so this can also be restored | so this can also be restored | ||||
| @param alsoIncludeSelectionState if this is true, the selected items will | |||||
| also be stored in the state that is returned | |||||
| @see restoreOpennessState | @see restoreOpennessState | ||||
| */ | */ | ||||
| XmlElement* getOpennessState (const bool alsoIncludeScrollPosition) const; | XmlElement* getOpennessState (const bool alsoIncludeScrollPosition) const; | ||||
| @@ -573,7 +575,7 @@ private: | |||||
| bool rootItemVisible : 1; | bool rootItemVisible : 1; | ||||
| bool multiSelectEnabled : 1; | bool multiSelectEnabled : 1; | ||||
| void itemsChanged(); | |||||
| void itemsChanged() throw(); | |||||
| void handleAsyncUpdate(); | void handleAsyncUpdate(); | ||||
| void moveSelectedRow (int delta); | void moveSelectedRow (int delta); | ||||
| @@ -58,7 +58,8 @@ FileBrowserComponent::FileBrowserComponent (FileChooserMode mode_, | |||||
| const File& initialFileOrDirectory, | const File& initialFileOrDirectory, | ||||
| const FileFilter* fileFilter, | const FileFilter* fileFilter, | ||||
| FilePreviewComponent* previewComp_, | FilePreviewComponent* previewComp_, | ||||
| const bool useTreeView) | |||||
| const bool useTreeView, | |||||
| const bool filenameTextBoxIsReadOnly) | |||||
| : directoriesOnlyFilter (0), | : directoriesOnlyFilter (0), | ||||
| mode (mode_), | mode (mode_), | ||||
| listeners (2), | listeners (2), | ||||
| @@ -124,6 +125,7 @@ FileBrowserComponent::FileBrowserComponent (FileChooserMode mode_, | |||||
| filenameBox->setSelectAllWhenFocused (true); | filenameBox->setSelectAllWhenFocused (true); | ||||
| filenameBox->setText (filename, false); | filenameBox->setText (filename, false); | ||||
| filenameBox->addListener (this); | filenameBox->addListener (this); | ||||
| filenameBox->setReadOnly (filenameTextBoxIsReadOnly); | |||||
| Label* label = new Label (T("f"), (mode == chooseDirectoryMode) ? TRANS("folder:") | Label* label = new Label (T("f"), (mode == chooseDirectoryMode) ? TRANS("folder:") | ||||
| : TRANS("file:")); | : TRANS("file:")); | ||||
| @@ -96,7 +96,8 @@ public: | |||||
| const File& initialFileOrDirectory, | const File& initialFileOrDirectory, | ||||
| const FileFilter* fileFilter, | const FileFilter* fileFilter, | ||||
| FilePreviewComponent* previewComp, | FilePreviewComponent* previewComp, | ||||
| const bool useTreeView = false); | |||||
| const bool useTreeView = false, | |||||
| const bool filenameTextBoxIsReadOnly = false); | |||||
| /** Destructor. */ | /** Destructor. */ | ||||
| ~FileBrowserComponent(); | ~FileBrowserComponent(); | ||||
| @@ -2103,7 +2103,7 @@ void Component::parentSizeChanged() | |||||
| // base class does nothing | // base class does nothing | ||||
| } | } | ||||
| void Component::addComponentListener (ComponentListener* const newListener) | |||||
| void Component::addComponentListener (ComponentListener* const newListener) throw() | |||||
| { | { | ||||
| if (componentListeners_ == 0) | if (componentListeners_ == 0) | ||||
| componentListeners_ = new VoidArray (4); | componentListeners_ = new VoidArray (4); | ||||
| @@ -2111,7 +2111,7 @@ void Component::addComponentListener (ComponentListener* const newListener) | |||||
| componentListeners_->addIfNotAlreadyThere (newListener); | componentListeners_->addIfNotAlreadyThere (newListener); | ||||
| } | } | ||||
| void Component::removeComponentListener (ComponentListener* const listenerToRemove) | |||||
| void Component::removeComponentListener (ComponentListener* const listenerToRemove) throw() | |||||
| { | { | ||||
| jassert (isValidComponent()); | jassert (isValidComponent()); | ||||
| @@ -1683,13 +1683,13 @@ public: | |||||
| will be ignored. | will be ignored. | ||||
| @see ComponentListener, removeComponentListener | @see ComponentListener, removeComponentListener | ||||
| */ | */ | ||||
| void addComponentListener (ComponentListener* const newListener); | |||||
| void addComponentListener (ComponentListener* const newListener) throw(); | |||||
| /** Removes a component listener. | /** Removes a component listener. | ||||
| @see addComponentListener | @see addComponentListener | ||||
| */ | */ | ||||
| void removeComponentListener (ComponentListener* const listenerToRemove); | |||||
| void removeComponentListener (ComponentListener* const listenerToRemove) throw(); | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Called when files are dragged-and-dropped onto this component. | /** Called when files are dragged-and-dropped onto this component. | ||||
| @@ -38,7 +38,7 @@ BEGIN_JUCE_NAMESPACE | |||||
| //============================================================================== | //============================================================================== | ||||
| ComponentBoundsConstrainer::ComponentBoundsConstrainer() | |||||
| ComponentBoundsConstrainer::ComponentBoundsConstrainer() throw() | |||||
| : minW (0), | : minW (0), | ||||
| maxW (0), | maxW (0), | ||||
| minH (0x3fffffff), | minH (0x3fffffff), | ||||
| @@ -56,27 +56,27 @@ ComponentBoundsConstrainer::~ComponentBoundsConstrainer() | |||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| void ComponentBoundsConstrainer::setMinimumWidth (const int minimumWidth) | |||||
| void ComponentBoundsConstrainer::setMinimumWidth (const int minimumWidth) throw() | |||||
| { | { | ||||
| minW = minimumWidth; | minW = minimumWidth; | ||||
| } | } | ||||
| void ComponentBoundsConstrainer::setMaximumWidth (const int maximumWidth) | |||||
| void ComponentBoundsConstrainer::setMaximumWidth (const int maximumWidth) throw() | |||||
| { | { | ||||
| maxW = maximumWidth; | maxW = maximumWidth; | ||||
| } | } | ||||
| void ComponentBoundsConstrainer::setMinimumHeight (const int minimumHeight) | |||||
| void ComponentBoundsConstrainer::setMinimumHeight (const int minimumHeight) throw() | |||||
| { | { | ||||
| minH = minimumHeight; | minH = minimumHeight; | ||||
| } | } | ||||
| void ComponentBoundsConstrainer::setMaximumHeight (const int maximumHeight) | |||||
| void ComponentBoundsConstrainer::setMaximumHeight (const int maximumHeight) throw() | |||||
| { | { | ||||
| maxH = maximumHeight; | maxH = maximumHeight; | ||||
| } | } | ||||
| void ComponentBoundsConstrainer::setMinimumSize (const int minimumWidth, const int minimumHeight) | |||||
| void ComponentBoundsConstrainer::setMinimumSize (const int minimumWidth, const int minimumHeight) throw() | |||||
| { | { | ||||
| jassert (maxW >= minimumWidth); | jassert (maxW >= minimumWidth); | ||||
| jassert (maxH >= minimumHeight); | jassert (maxH >= minimumHeight); | ||||
| @@ -92,7 +92,7 @@ void ComponentBoundsConstrainer::setMinimumSize (const int minimumWidth, const i | |||||
| maxH = minH; | maxH = minH; | ||||
| } | } | ||||
| void ComponentBoundsConstrainer::setMaximumSize (const int maximumWidth, const int maximumHeight) | |||||
| void ComponentBoundsConstrainer::setMaximumSize (const int maximumWidth, const int maximumHeight) throw() | |||||
| { | { | ||||
| jassert (maximumWidth >= minW); | jassert (maximumWidth >= minW); | ||||
| jassert (maximumHeight >= minH); | jassert (maximumHeight >= minH); | ||||
| @@ -105,7 +105,7 @@ void ComponentBoundsConstrainer::setMaximumSize (const int maximumWidth, const i | |||||
| void ComponentBoundsConstrainer::setSizeLimits (const int minimumWidth, | void ComponentBoundsConstrainer::setSizeLimits (const int minimumWidth, | ||||
| const int minimumHeight, | const int minimumHeight, | ||||
| const int maximumWidth, | const int maximumWidth, | ||||
| const int maximumHeight) | |||||
| const int maximumHeight) throw() | |||||
| { | { | ||||
| jassert (maximumWidth >= minimumWidth); | jassert (maximumWidth >= minimumWidth); | ||||
| jassert (maximumHeight >= minimumHeight); | jassert (maximumHeight >= minimumHeight); | ||||
| @@ -121,7 +121,7 @@ void ComponentBoundsConstrainer::setSizeLimits (const int minimumWidth, | |||||
| void ComponentBoundsConstrainer::setMinimumOnscreenAmounts (const int minimumWhenOffTheTop, | void ComponentBoundsConstrainer::setMinimumOnscreenAmounts (const int minimumWhenOffTheTop, | ||||
| const int minimumWhenOffTheLeft, | const int minimumWhenOffTheLeft, | ||||
| const int minimumWhenOffTheBottom, | const int minimumWhenOffTheBottom, | ||||
| const int minimumWhenOffTheRight) | |||||
| const int minimumWhenOffTheRight) throw() | |||||
| { | { | ||||
| minOffTop = minimumWhenOffTheTop; | minOffTop = minimumWhenOffTheTop; | ||||
| minOffLeft = minimumWhenOffTheLeft; | minOffLeft = minimumWhenOffTheLeft; | ||||
| @@ -129,7 +129,7 @@ void ComponentBoundsConstrainer::setMinimumOnscreenAmounts (const int minimumWhe | |||||
| minOffRight = minimumWhenOffTheRight; | minOffRight = minimumWhenOffTheRight; | ||||
| } | } | ||||
| void ComponentBoundsConstrainer::setFixedAspectRatio (const double widthOverHeight) | |||||
| void ComponentBoundsConstrainer::setFixedAspectRatio (const double widthOverHeight) throw() | |||||
| { | { | ||||
| aspectRatio = jmax (0.0, widthOverHeight); | aspectRatio = jmax (0.0, widthOverHeight); | ||||
| } | } | ||||
| @@ -52,49 +52,49 @@ class JUCE_API ComponentBoundsConstrainer | |||||
| public: | public: | ||||
| //============================================================================== | //============================================================================== | ||||
| /** When first created, the object will not impose any restrictions on the components. */ | /** When first created, the object will not impose any restrictions on the components. */ | ||||
| ComponentBoundsConstrainer(); | |||||
| ComponentBoundsConstrainer() throw(); | |||||
| /** Destructor. */ | /** Destructor. */ | ||||
| virtual ~ComponentBoundsConstrainer(); | virtual ~ComponentBoundsConstrainer(); | ||||
| //============================================================================== | //============================================================================== | ||||
| /** Imposes a minimum width limit. */ | /** Imposes a minimum width limit. */ | ||||
| void setMinimumWidth (const int minimumWidth); | |||||
| void setMinimumWidth (const int minimumWidth) throw(); | |||||
| /** Returns the current minimum width. */ | /** Returns the current minimum width. */ | ||||
| int getMinimumWidth() const throw() { return minW; } | int getMinimumWidth() const throw() { return minW; } | ||||
| /** Imposes a maximum width limit. */ | /** Imposes a maximum width limit. */ | ||||
| void setMaximumWidth (const int maximumWidth); | |||||
| void setMaximumWidth (const int maximumWidth) throw(); | |||||
| /** Returns the current maximum width. */ | /** Returns the current maximum width. */ | ||||
| int getMaximumWidth() const throw() { return maxW; } | int getMaximumWidth() const throw() { return maxW; } | ||||
| /** Imposes a minimum height limit. */ | /** Imposes a minimum height limit. */ | ||||
| void setMinimumHeight (const int minimumHeight); | |||||
| void setMinimumHeight (const int minimumHeight) throw(); | |||||
| /** Returns the current minimum height. */ | /** Returns the current minimum height. */ | ||||
| int getMinimumHeight() const throw() { return minH; } | int getMinimumHeight() const throw() { return minH; } | ||||
| /** Imposes a maximum height limit. */ | /** Imposes a maximum height limit. */ | ||||
| void setMaximumHeight (const int maximumHeight); | |||||
| void setMaximumHeight (const int maximumHeight) throw(); | |||||
| /** Returns the current maximum height. */ | /** Returns the current maximum height. */ | ||||
| int getMaximumHeight() const throw() { return maxH; } | int getMaximumHeight() const throw() { return maxH; } | ||||
| /** Imposes a minimum width and height limit. */ | /** Imposes a minimum width and height limit. */ | ||||
| void setMinimumSize (const int minimumWidth, | void setMinimumSize (const int minimumWidth, | ||||
| const int minimumHeight); | |||||
| const int minimumHeight) throw(); | |||||
| /** Imposes a maximum width and height limit. */ | /** Imposes a maximum width and height limit. */ | ||||
| void setMaximumSize (const int maximumWidth, | void setMaximumSize (const int maximumWidth, | ||||
| const int maximumHeight); | |||||
| const int maximumHeight) throw(); | |||||
| /** Set all the maximum and minimum dimensions. */ | /** Set all the maximum and minimum dimensions. */ | ||||
| void setSizeLimits (const int minimumWidth, | void setSizeLimits (const int minimumWidth, | ||||
| const int minimumHeight, | const int minimumHeight, | ||||
| const int maximumWidth, | const int maximumWidth, | ||||
| const int maximumHeight); | |||||
| const int maximumHeight) throw(); | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Sets the amount by which the component is allowed to go off-screen. | /** Sets the amount by which the component is allowed to go off-screen. | ||||
| @@ -116,7 +116,7 @@ public: | |||||
| void setMinimumOnscreenAmounts (const int minimumWhenOffTheTop, | void setMinimumOnscreenAmounts (const int minimumWhenOffTheTop, | ||||
| const int minimumWhenOffTheLeft, | const int minimumWhenOffTheLeft, | ||||
| const int minimumWhenOffTheBottom, | const int minimumWhenOffTheBottom, | ||||
| const int minimumWhenOffTheRight); | |||||
| const int minimumWhenOffTheRight) throw(); | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Specifies a width-to-height ratio that the resizer should always maintain. | /** Specifies a width-to-height ratio that the resizer should always maintain. | ||||
| @@ -126,7 +126,7 @@ public: | |||||
| @see setResizeLimits | @see setResizeLimits | ||||
| */ | */ | ||||
| void setFixedAspectRatio (const double widthOverHeight); | |||||
| void setFixedAspectRatio (const double widthOverHeight) throw(); | |||||
| /** Returns the aspect ratio that was set with setFixedAspectRatio(). | /** Returns the aspect ratio that was set with setFixedAspectRatio(). | ||||
| @@ -125,7 +125,7 @@ void ComponentMovementWatcher::componentMovedOrResized (Component&, bool wasMove | |||||
| componentMovedOrResized (wasMoved, wasResized); | componentMovedOrResized (wasMoved, wasResized); | ||||
| } | } | ||||
| void ComponentMovementWatcher::registerWithParentComps() | |||||
| void ComponentMovementWatcher::registerWithParentComps() throw() | |||||
| { | { | ||||
| Component* p = component->getParentComponent(); | Component* p = component->getParentComponent(); | ||||
| @@ -137,7 +137,7 @@ void ComponentMovementWatcher::registerWithParentComps() | |||||
| } | } | ||||
| } | } | ||||
| void ComponentMovementWatcher::unregister() | |||||
| void ComponentMovementWatcher::unregister() throw() | |||||
| { | { | ||||
| for (int i = registeredParentComps.size(); --i >= 0;) | for (int i = registeredParentComps.size(); --i >= 0;) | ||||
| ((Component*) registeredParentComps.getUnchecked(i))->removeComponentListener (this); | ((Component*) registeredParentComps.getUnchecked(i))->removeComponentListener (this); | ||||
| @@ -92,8 +92,8 @@ private: | |||||
| ComponentDeletionWatcher* deletionWatcher; | ComponentDeletionWatcher* deletionWatcher; | ||||
| #endif | #endif | ||||
| void unregister(); | |||||
| void registerWithParentComps(); | |||||
| void unregister() throw(); | |||||
| void registerWithParentComps() throw(); | |||||
| ComponentMovementWatcher (const ComponentMovementWatcher&); | ComponentMovementWatcher (const ComponentMovementWatcher&); | ||||
| const ComponentMovementWatcher& operator= (const ComponentMovementWatcher&); | const ComponentMovementWatcher& operator= (const ComponentMovementWatcher&); | ||||
| @@ -52,7 +52,7 @@ GroupComponent::~GroupComponent() | |||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| void GroupComponent::setText (const String& newText) | |||||
| void GroupComponent::setText (const String& newText) throw() | |||||
| { | { | ||||
| if (text != newText) | if (text != newText) | ||||
| { | { | ||||
| @@ -61,7 +61,7 @@ void GroupComponent::setText (const String& newText) | |||||
| } | } | ||||
| } | } | ||||
| const String GroupComponent::getText() const | |||||
| const String GroupComponent::getText() const throw() | |||||
| { | { | ||||
| return text; | return text; | ||||
| } | } | ||||
| @@ -58,10 +58,10 @@ public: | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Changes the text that's shown at the top of the component. */ | /** Changes the text that's shown at the top of the component. */ | ||||
| void setText (const String& newText); | |||||
| void setText (const String& newText) throw(); | |||||
| /** Returns the currently displayed text label. */ | /** Returns the currently displayed text label. */ | ||||
| const String getText() const; | |||||
| const String getText() const throw(); | |||||
| /** Sets the positioning of the text label. | /** Sets the positioning of the text label. | ||||
| @@ -34,71 +34,65 @@ | |||||
| BEGIN_JUCE_NAMESPACE | BEGIN_JUCE_NAMESPACE | ||||
| #include "juce_MultiDocumentPanel.h" | #include "juce_MultiDocumentPanel.h" | ||||
| #include "../windows/juce_DocumentWindow.h" | |||||
| #include "../lookandfeel/juce_LookAndFeel.h" | #include "../lookandfeel/juce_LookAndFeel.h" | ||||
| //============================================================================== | //============================================================================== | ||||
| class MDIDocumentWindowInternal : public DocumentWindow | |||||
| MultiDocumentPanelWindow::MultiDocumentPanelWindow (const Colour& backgroundColour) | |||||
| : DocumentWindow (String::empty, backgroundColour, | |||||
| DocumentWindow::maximiseButton | DocumentWindow::closeButton, false) | |||||
| { | { | ||||
| public: | |||||
| //============================================================================== | |||||
| MDIDocumentWindowInternal (const Colour& backgroundColour) | |||||
| : DocumentWindow (String::empty, backgroundColour, | |||||
| DocumentWindow::maximiseButton | DocumentWindow::closeButton, false) | |||||
| { | |||||
| } | |||||
| } | |||||
| ~MDIDocumentWindowInternal() | |||||
| { | |||||
| } | |||||
| MultiDocumentPanelWindow::~MultiDocumentPanelWindow() | |||||
| { | |||||
| } | |||||
| //============================================================================== | |||||
| void maximiseButtonPressed() | |||||
| { | |||||
| MultiDocumentPanel* const owner = getOwner(); | |||||
| //============================================================================== | |||||
| void MultiDocumentPanelWindow::maximiseButtonPressed() | |||||
| { | |||||
| MultiDocumentPanel* const owner = getOwner(); | |||||
| jassert (owner != 0); | |||||
| if (owner != 0) | |||||
| owner->setLayoutMode (MultiDocumentPanel::MaximisedWindowsWithTabs); | |||||
| } | |||||
| jassert (owner != 0); // these windows are only designed to be used inside a MultiDocumentPanel! | |||||
| if (owner != 0) | |||||
| owner->setLayoutMode (MultiDocumentPanel::MaximisedWindowsWithTabs); | |||||
| } | |||||
| void closeButtonPressed() | |||||
| { | |||||
| MultiDocumentPanel* const owner = getOwner(); | |||||
| void MultiDocumentPanelWindow::closeButtonPressed() | |||||
| { | |||||
| MultiDocumentPanel* const owner = getOwner(); | |||||
| jassert (owner != 0); | |||||
| if (owner != 0) | |||||
| owner->closeDocument (getContentComponent(), true); | |||||
| } | |||||
| jassert (owner != 0); // these windows are only designed to be used inside a MultiDocumentPanel! | |||||
| if (owner != 0) | |||||
| owner->closeDocument (getContentComponent(), true); | |||||
| } | |||||
| void activeWindowStatusChanged() | |||||
| { | |||||
| DocumentWindow::activeWindowStatusChanged(); | |||||
| updateOrder(); | |||||
| } | |||||
| void MultiDocumentPanelWindow::activeWindowStatusChanged() | |||||
| { | |||||
| DocumentWindow::activeWindowStatusChanged(); | |||||
| updateOrder(); | |||||
| } | |||||
| void broughtToFront() | |||||
| { | |||||
| DocumentWindow::broughtToFront(); | |||||
| updateOrder(); | |||||
| } | |||||
| void MultiDocumentPanelWindow::broughtToFront() | |||||
| { | |||||
| DocumentWindow::broughtToFront(); | |||||
| updateOrder(); | |||||
| } | |||||
| private: | |||||
| void updateOrder() | |||||
| { | |||||
| MultiDocumentPanel* const owner = getOwner(); | |||||
| void MultiDocumentPanelWindow::updateOrder() | |||||
| { | |||||
| MultiDocumentPanel* const owner = getOwner(); | |||||
| if (owner != 0) | |||||
| owner->updateOrder(); | |||||
| } | |||||
| if (owner != 0) | |||||
| owner->updateOrder(); | |||||
| } | |||||
| MultiDocumentPanel* MultiDocumentPanelWindow::getOwner() const throw() | |||||
| { | |||||
| // (unable to use the syntax findParentComponentOfClass <MultiDocumentPanel> () because of a VC6 compiler bug) | |||||
| return findParentComponentOfClass ((MultiDocumentPanel*) 0); | |||||
| } | |||||
| MultiDocumentPanel* getOwner() const throw() | |||||
| { | |||||
| // (unable to use the syntax findParentComponentOfClass <MultiDocumentPanel> () because of a VC6 compiler bug) | |||||
| return findParentComponentOfClass ((MultiDocumentPanel*) 0); | |||||
| } | |||||
| }; | |||||
| //============================================================================== | //============================================================================== | ||||
| class MDITabbedComponentInternal : public TabbedComponent | class MDITabbedComponentInternal : public TabbedComponent | ||||
| @@ -155,9 +149,14 @@ bool MultiDocumentPanel::closeAllDocuments (const bool checkItsOkToCloseFirst) | |||||
| return true; | return true; | ||||
| } | } | ||||
| MultiDocumentPanelWindow* MultiDocumentPanel::createNewDocumentWindow() | |||||
| { | |||||
| return new MultiDocumentPanelWindow (backgroundColour); | |||||
| } | |||||
| void MultiDocumentPanel::addWindow (Component* component) | void MultiDocumentPanel::addWindow (Component* component) | ||||
| { | { | ||||
| MDIDocumentWindowInternal* const dw = new MDIDocumentWindowInternal (backgroundColour); | |||||
| MultiDocumentPanelWindow* const dw = createNewDocumentWindow(); | |||||
| dw->setResizable (true, false); | dw->setResizable (true, false); | ||||
| dw->setContentComponent (component, false, true); | dw->setContentComponent (component, false, true); | ||||
| @@ -258,7 +257,7 @@ bool MultiDocumentPanel::closeDocument (Component* component, | |||||
| { | { | ||||
| for (int i = getNumChildComponents(); --i >= 0;) | for (int i = getNumChildComponents(); --i >= 0;) | ||||
| { | { | ||||
| MDIDocumentWindowInternal* const dw = dynamic_cast <MDIDocumentWindowInternal*> (getChildComponent (i)); | |||||
| MultiDocumentPanelWindow* const dw = dynamic_cast <MultiDocumentPanelWindow*> (getChildComponent (i)); | |||||
| if (dw != 0 && dw->getContentComponent() == component) | if (dw != 0 && dw->getContentComponent() == component) | ||||
| { | { | ||||
| @@ -277,7 +276,7 @@ bool MultiDocumentPanel::closeDocument (Component* component, | |||||
| { | { | ||||
| for (int i = getNumChildComponents(); --i >= 0;) | for (int i = getNumChildComponents(); --i >= 0;) | ||||
| { | { | ||||
| MDIDocumentWindowInternal* const dw = dynamic_cast <MDIDocumentWindowInternal*> (getChildComponent (i)); | |||||
| MultiDocumentPanelWindow* const dw = dynamic_cast <MultiDocumentPanelWindow*> (getChildComponent (i)); | |||||
| if (dw != 0) | if (dw != 0) | ||||
| { | { | ||||
| @@ -343,7 +342,7 @@ Component* MultiDocumentPanel::getActiveDocument() const throw() | |||||
| { | { | ||||
| for (int i = getNumChildComponents(); --i >= 0;) | for (int i = getNumChildComponents(); --i >= 0;) | ||||
| { | { | ||||
| MDIDocumentWindowInternal* const dw = dynamic_cast <MDIDocumentWindowInternal*> (getChildComponent (i)); | |||||
| MultiDocumentPanelWindow* const dw = dynamic_cast <MultiDocumentPanelWindow*> (getChildComponent (i)); | |||||
| if (dw != 0 && dw->isActiveWindow()) | if (dw != 0 && dw->isActiveWindow()) | ||||
| return dw->getContentComponent(); | return dw->getContentComponent(); | ||||
| @@ -415,7 +414,7 @@ void MultiDocumentPanel::setLayoutMode (const LayoutMode newLayoutMode) | |||||
| { | { | ||||
| for (int i = getNumChildComponents(); --i >= 0;) | for (int i = getNumChildComponents(); --i >= 0;) | ||||
| { | { | ||||
| MDIDocumentWindowInternal* const dw = dynamic_cast <MDIDocumentWindowInternal*> (getChildComponent (i)); | |||||
| MultiDocumentPanelWindow* const dw = dynamic_cast <MultiDocumentPanelWindow*> (getChildComponent (i)); | |||||
| if (dw != 0) | if (dw != 0) | ||||
| { | { | ||||
| @@ -474,7 +473,7 @@ Component* MultiDocumentPanel::getContainerComp (Component* c) const | |||||
| { | { | ||||
| for (int i = 0; i < getNumChildComponents(); ++i) | for (int i = 0; i < getNumChildComponents(); ++i) | ||||
| { | { | ||||
| MDIDocumentWindowInternal* const dw = dynamic_cast <MDIDocumentWindowInternal*> (getChildComponent (i)); | |||||
| MultiDocumentPanelWindow* const dw = dynamic_cast <MultiDocumentPanelWindow*> (getChildComponent (i)); | |||||
| if (dw != 0 && dw->getContentComponent() == c) | if (dw != 0 && dw->getContentComponent() == c) | ||||
| { | { | ||||
| @@ -493,7 +492,7 @@ void MultiDocumentPanel::componentNameChanged (Component&) | |||||
| { | { | ||||
| for (int i = 0; i < getNumChildComponents(); ++i) | for (int i = 0; i < getNumChildComponents(); ++i) | ||||
| { | { | ||||
| MDIDocumentWindowInternal* const dw = dynamic_cast <MDIDocumentWindowInternal*> (getChildComponent (i)); | |||||
| MultiDocumentPanelWindow* const dw = dynamic_cast <MultiDocumentPanelWindow*> (getChildComponent (i)); | |||||
| if (dw != 0) | if (dw != 0) | ||||
| dw->setName (dw->getContentComponent()->getName()); | dw->setName (dw->getContentComponent()->getName()); | ||||
| @@ -508,7 +507,7 @@ void MultiDocumentPanel::componentNameChanged (Component&) | |||||
| void MultiDocumentPanel::updateOrder() | void MultiDocumentPanel::updateOrder() | ||||
| { | { | ||||
| Array <Component*> oldList (components); | |||||
| const Array <Component*> oldList (components); | |||||
| if (mode == FloatingWindows) | if (mode == FloatingWindows) | ||||
| { | { | ||||
| @@ -516,7 +515,7 @@ void MultiDocumentPanel::updateOrder() | |||||
| for (int i = 0; i < getNumChildComponents(); ++i) | for (int i = 0; i < getNumChildComponents(); ++i) | ||||
| { | { | ||||
| MDIDocumentWindowInternal* const dw = dynamic_cast <MDIDocumentWindowInternal*> (getChildComponent (i)); | |||||
| MultiDocumentPanelWindow* const dw = dynamic_cast <MultiDocumentPanelWindow*> (getChildComponent (i)); | |||||
| if (dw != 0) | if (dw != 0) | ||||
| components.add (dw->getContentComponent()); | components.add (dw->getContentComponent()); | ||||
| @@ -33,10 +33,51 @@ | |||||
| #define __JUCE_MULTIDOCUMENTPANEL_JUCEHEADER__ | #define __JUCE_MULTIDOCUMENTPANEL_JUCEHEADER__ | ||||
| #include "juce_TabbedComponent.h" | #include "juce_TabbedComponent.h" | ||||
| class MDIDocumentWindowInternal; | |||||
| #include "../windows/juce_DocumentWindow.h" | |||||
| class MultiDocumentPanel; | |||||
| class MDITabbedComponentInternal; | class MDITabbedComponentInternal; | ||||
| //============================================================================== | |||||
| /** | |||||
| This is a derivative of DocumentWindow that is used inside a MultiDocumentPanel | |||||
| component. | |||||
| It's like a normal DocumentWindow but has some extra functionality to make sure | |||||
| everything works nicely inside a MultiDocumentPanel. | |||||
| @see MultiDocumentPanel | |||||
| */ | |||||
| class JUCE_API MultiDocumentPanelWindow : public DocumentWindow | |||||
| { | |||||
| public: | |||||
| //============================================================================== | |||||
| /** | |||||
| */ | |||||
| MultiDocumentPanelWindow (const Colour& backgroundColour); | |||||
| /** Destructor. */ | |||||
| ~MultiDocumentPanelWindow(); | |||||
| //============================================================================== | |||||
| /** @internal */ | |||||
| void maximiseButtonPressed(); | |||||
| /** @internal */ | |||||
| void closeButtonPressed(); | |||||
| /** @internal */ | |||||
| void activeWindowStatusChanged(); | |||||
| /** @internal */ | |||||
| void broughtToFront(); | |||||
| //============================================================================== | |||||
| juce_UseDebuggingNewOperator | |||||
| private: | |||||
| void updateOrder(); | |||||
| MultiDocumentPanel* getOwner() const throw(); | |||||
| }; | |||||
| //============================================================================== | //============================================================================== | ||||
| /** | /** | ||||
| A component that contains a set of other components either in floating windows | A component that contains a set of other components either in floating windows | ||||
| @@ -229,6 +270,13 @@ public: | |||||
| */ | */ | ||||
| virtual bool tryToCloseDocument (Component* component) = 0; | virtual bool tryToCloseDocument (Component* component) = 0; | ||||
| /** Creates a new window to be used for a document. | |||||
| The default implementation of this just returns a basic MultiDocumentPanelWindow object, | |||||
| but you might want to override it to return a custom component. | |||||
| */ | |||||
| virtual MultiDocumentPanelWindow* createNewDocumentWindow(); | |||||
| //============================================================================== | //============================================================================== | ||||
| /** @internal */ | /** @internal */ | ||||
| void paint (Graphics& g); | void paint (Graphics& g); | ||||
| @@ -248,7 +296,7 @@ private: | |||||
| Colour backgroundColour; | Colour backgroundColour; | ||||
| int maximumNumDocuments, numDocsBeforeTabsUsed; | int maximumNumDocuments, numDocsBeforeTabsUsed; | ||||
| friend class MDIDocumentWindowInternal; | |||||
| friend class MultiDocumentPanelWindow; | |||||
| friend class MDITabbedComponentInternal; | friend class MDITabbedComponentInternal; | ||||
| Component* getContainerComp (Component* c) const; | Component* getContainerComp (Component* c) const; | ||||
| @@ -153,7 +153,7 @@ bool ResizableBorderComponent::hitTest (int x, int y) | |||||
| || y >= getHeight() - borderSize.getBottom(); | || y >= getHeight() - borderSize.getBottom(); | ||||
| } | } | ||||
| void ResizableBorderComponent::setBorderThickness (const BorderSize& newBorderSize) | |||||
| void ResizableBorderComponent::setBorderThickness (const BorderSize& newBorderSize) throw() | |||||
| { | { | ||||
| if (borderSize != newBorderSize) | if (borderSize != newBorderSize) | ||||
| { | { | ||||
| @@ -162,12 +162,12 @@ void ResizableBorderComponent::setBorderThickness (const BorderSize& newBorderSi | |||||
| } | } | ||||
| } | } | ||||
| const BorderSize ResizableBorderComponent::getBorderThickness() const | |||||
| const BorderSize ResizableBorderComponent::getBorderThickness() const throw() | |||||
| { | { | ||||
| return borderSize; | return borderSize; | ||||
| } | } | ||||
| void ResizableBorderComponent::updateMouseZone (const MouseEvent& e) | |||||
| void ResizableBorderComponent::updateMouseZone (const MouseEvent& e) throw() | |||||
| { | { | ||||
| int newZone = 0; | int newZone = 0; | ||||
| @@ -84,13 +84,13 @@ public: | |||||
| @see getBorderThickness | @see getBorderThickness | ||||
| */ | */ | ||||
| void setBorderThickness (const BorderSize& newBorderSize); | |||||
| void setBorderThickness (const BorderSize& newBorderSize) throw(); | |||||
| /** Returns the number of pixels wide that the draggable edges of this component are. | /** Returns the number of pixels wide that the draggable edges of this component are. | ||||
| @see setBorderThickness | @see setBorderThickness | ||||
| */ | */ | ||||
| const BorderSize getBorderThickness() const; | |||||
| const BorderSize getBorderThickness() const throw(); | |||||
| //============================================================================== | //============================================================================== | ||||
| @@ -119,7 +119,7 @@ private: | |||||
| int originalX, originalY, originalW, originalH; | int originalX, originalY, originalW, originalH; | ||||
| int mouseZone; | int mouseZone; | ||||
| void updateMouseZone (const MouseEvent& e); | |||||
| void updateMouseZone (const MouseEvent& e) throw(); | |||||
| ResizableBorderComponent (const ResizableBorderComponent&); | ResizableBorderComponent (const ResizableBorderComponent&); | ||||
| const ResizableBorderComponent& operator= (const ResizableBorderComponent&); | const ResizableBorderComponent& operator= (const ResizableBorderComponent&); | ||||
| @@ -119,7 +119,7 @@ ScrollBar::~ScrollBar() | |||||
| //============================================================================== | //============================================================================== | ||||
| void ScrollBar::setRangeLimits (const double newMinimum, | void ScrollBar::setRangeLimits (const double newMinimum, | ||||
| const double newMaximum) | |||||
| const double newMaximum) throw() | |||||
| { | { | ||||
| minimum = newMinimum; | minimum = newMinimum; | ||||
| maximum = newMaximum; | maximum = newMaximum; | ||||
| @@ -125,7 +125,7 @@ public: | |||||
| @see setCurrentRange | @see setCurrentRange | ||||
| */ | */ | ||||
| void setRangeLimits (const double minimum, | void setRangeLimits (const double minimum, | ||||
| const double maximum); | |||||
| const double maximum) throw(); | |||||
| /** Returns the lower value that the thumb can be set to. | /** Returns the lower value that the thumb can be set to. | ||||
| @@ -292,7 +292,7 @@ class PopupMenuWindow : public Component, | |||||
| { | { | ||||
| public: | public: | ||||
| //============================================================================== | //============================================================================== | ||||
| PopupMenuWindow() | |||||
| PopupMenuWindow() throw() | |||||
| : Component (T("menu")), | : Component (T("menu")), | ||||
| owner (0), | owner (0), | ||||
| currentChild (0), | currentChild (0), | ||||
| @@ -356,7 +356,7 @@ public: | |||||
| const int itemIdThatMustBeVisible, | const int itemIdThatMustBeVisible, | ||||
| Component* const menuBarComponent, | Component* const menuBarComponent, | ||||
| ApplicationCommandManager** managerOfChosenCommand, | ApplicationCommandManager** managerOfChosenCommand, | ||||
| Component* const componentAttachedTo) | |||||
| Component* const componentAttachedTo) throw() | |||||
| { | { | ||||
| if (menu.items.size() > 0) | if (menu.items.size() > 0) | ||||
| { | { | ||||
| @@ -1313,13 +1313,13 @@ private: | |||||
| //============================================================================== | //============================================================================== | ||||
| PopupMenu::PopupMenu() | |||||
| PopupMenu::PopupMenu() throw() | |||||
| : items (8), | : items (8), | ||||
| lookAndFeel (0) | lookAndFeel (0) | ||||
| { | { | ||||
| } | } | ||||
| PopupMenu::PopupMenu (const PopupMenu& other) | |||||
| PopupMenu::PopupMenu (const PopupMenu& other) throw() | |||||
| : items (8), | : items (8), | ||||
| lookAndFeel (other.lookAndFeel) | lookAndFeel (other.lookAndFeel) | ||||
| { | { | ||||
| @@ -1329,7 +1329,7 @@ PopupMenu::PopupMenu (const PopupMenu& other) | |||||
| items.add (new MenuItemInfo (*(const MenuItemInfo*) other.items.getUnchecked(i))); | items.add (new MenuItemInfo (*(const MenuItemInfo*) other.items.getUnchecked(i))); | ||||
| } | } | ||||
| const PopupMenu& PopupMenu::operator= (const PopupMenu& other) | |||||
| const PopupMenu& PopupMenu::operator= (const PopupMenu& other) throw() | |||||
| { | { | ||||
| if (this != &other) | if (this != &other) | ||||
| { | { | ||||
| @@ -1345,12 +1345,12 @@ const PopupMenu& PopupMenu::operator= (const PopupMenu& other) | |||||
| return *this; | return *this; | ||||
| } | } | ||||
| PopupMenu::~PopupMenu() | |||||
| PopupMenu::~PopupMenu() throw() | |||||
| { | { | ||||
| clear(); | clear(); | ||||
| } | } | ||||
| void PopupMenu::clear() | |||||
| void PopupMenu::clear() throw() | |||||
| { | { | ||||
| for (int i = items.size(); --i >= 0;) | for (int i = items.size(); --i >= 0;) | ||||
| { | { | ||||
| @@ -1365,7 +1365,7 @@ void PopupMenu::addItem (const int itemResultId, | |||||
| const String& itemText, | const String& itemText, | ||||
| const bool isActive, | const bool isActive, | ||||
| const bool isTicked, | const bool isTicked, | ||||
| const Image* const iconToUse) | |||||
| const Image* const iconToUse) throw() | |||||
| { | { | ||||
| jassert (itemResultId != 0); // 0 is used as a return value to indicate that the user | jassert (itemResultId != 0); // 0 is used as a return value to indicate that the user | ||||
| // didn't pick anything, so you shouldn't use it as the id | // didn't pick anything, so you shouldn't use it as the id | ||||
| @@ -1383,7 +1383,7 @@ void PopupMenu::addItem (const int itemResultId, | |||||
| void PopupMenu::addCommandItem (ApplicationCommandManager* commandManager, | void PopupMenu::addCommandItem (ApplicationCommandManager* commandManager, | ||||
| const int commandID, | const int commandID, | ||||
| const String& displayName) | |||||
| const String& displayName) throw() | |||||
| { | { | ||||
| jassert (commandManager != 0 && commandID != 0); | jassert (commandManager != 0 && commandID != 0); | ||||
| @@ -1412,7 +1412,7 @@ void PopupMenu::addColouredItem (const int itemResultId, | |||||
| const Colour& itemTextColour, | const Colour& itemTextColour, | ||||
| const bool isActive, | const bool isActive, | ||||
| const bool isTicked, | const bool isTicked, | ||||
| const Image* const iconToUse) | |||||
| const Image* const iconToUse) throw() | |||||
| { | { | ||||
| jassert (itemResultId != 0); // 0 is used as a return value to indicate that the user | jassert (itemResultId != 0); // 0 is used as a return value to indicate that the user | ||||
| // didn't pick anything, so you shouldn't use it as the id | // didn't pick anything, so you shouldn't use it as the id | ||||
| @@ -1430,7 +1430,7 @@ void PopupMenu::addColouredItem (const int itemResultId, | |||||
| //============================================================================== | //============================================================================== | ||||
| void PopupMenu::addCustomItem (const int itemResultId, | void PopupMenu::addCustomItem (const int itemResultId, | ||||
| PopupMenuCustomComponent* const customComponent) | |||||
| PopupMenuCustomComponent* const customComponent) throw() | |||||
| { | { | ||||
| jassert (itemResultId != 0); // 0 is used as a return value to indicate that the user | jassert (itemResultId != 0); // 0 is used as a return value to indicate that the user | ||||
| // didn't pick anything, so you shouldn't use it as the id | // didn't pick anything, so you shouldn't use it as the id | ||||
| @@ -1486,7 +1486,7 @@ private: | |||||
| void PopupMenu::addCustomItem (const int itemResultId, | void PopupMenu::addCustomItem (const int itemResultId, | ||||
| Component* customComponent, | Component* customComponent, | ||||
| int idealWidth, int idealHeight, | int idealWidth, int idealHeight, | ||||
| const bool triggerMenuItemAutomaticallyWhenClicked) | |||||
| const bool triggerMenuItemAutomaticallyWhenClicked) throw() | |||||
| { | { | ||||
| addCustomItem (itemResultId, | addCustomItem (itemResultId, | ||||
| new NormalComponentWrapper (customComponent, | new NormalComponentWrapper (customComponent, | ||||
| @@ -1498,7 +1498,7 @@ void PopupMenu::addCustomItem (const int itemResultId, | |||||
| void PopupMenu::addSubMenu (const String& subMenuName, | void PopupMenu::addSubMenu (const String& subMenuName, | ||||
| const PopupMenu& subMenu, | const PopupMenu& subMenu, | ||||
| const bool isActive, | const bool isActive, | ||||
| Image* const iconToUse) | |||||
| Image* const iconToUse) throw() | |||||
| { | { | ||||
| items.add (new MenuItemInfo (0, | items.add (new MenuItemInfo (0, | ||||
| subMenuName, | subMenuName, | ||||
| @@ -1512,7 +1512,7 @@ void PopupMenu::addSubMenu (const String& subMenuName, | |||||
| 0)); | 0)); | ||||
| } | } | ||||
| void PopupMenu::addSeparator() | |||||
| void PopupMenu::addSeparator() throw() | |||||
| { | { | ||||
| items.add (new MenuItemInfo()); | items.add (new MenuItemInfo()); | ||||
| } | } | ||||
| @@ -1556,7 +1556,7 @@ public: | |||||
| juce_UseDebuggingNewOperator | juce_UseDebuggingNewOperator | ||||
| }; | }; | ||||
| void PopupMenu::addSectionHeader (const String& title) | |||||
| void PopupMenu::addSectionHeader (const String& title) throw() | |||||
| { | { | ||||
| addCustomItem (0X4734a34f, new HeaderItemComponent (title)); | addCustomItem (0X4734a34f, new HeaderItemComponent (title)); | ||||
| } | } | ||||
| @@ -1570,7 +1570,7 @@ Component* PopupMenu::createMenuComponent (const int x, const int y, const int w | |||||
| const bool alignToRectangle, | const bool alignToRectangle, | ||||
| Component* menuBarComponent, | Component* menuBarComponent, | ||||
| ApplicationCommandManager** managerOfChosenCommand, | ApplicationCommandManager** managerOfChosenCommand, | ||||
| Component* const componentAttachedTo) | |||||
| Component* const componentAttachedTo) throw() | |||||
| { | { | ||||
| PopupMenuWindow* const pw | PopupMenuWindow* const pw | ||||
| = PopupMenuWindow::create (*this, | = PopupMenuWindow::create (*this, | ||||
| @@ -1599,7 +1599,7 @@ int PopupMenu::showMenu (const int x, const int y, const int w, const int h, | |||||
| const int maximumNumColumns, | const int maximumNumColumns, | ||||
| const int standardItemHeight, | const int standardItemHeight, | ||||
| const bool alignToRectangle, | const bool alignToRectangle, | ||||
| Component* const componentAttachedTo) | |||||
| Component* const componentAttachedTo) throw() | |||||
| { | { | ||||
| Component* const prevFocused = Component::getCurrentlyFocusedComponent(); | Component* const prevFocused = Component::getCurrentlyFocusedComponent(); | ||||
| @@ -1728,7 +1728,7 @@ void JUCE_CALLTYPE PopupMenu::dismissAllActiveMenus() throw() | |||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| int PopupMenu::getNumItems() const | |||||
| int PopupMenu::getNumItems() const throw() | |||||
| { | { | ||||
| int num = 0; | int num = 0; | ||||
| @@ -1739,7 +1739,7 @@ int PopupMenu::getNumItems() const | |||||
| return num; | return num; | ||||
| } | } | ||||
| bool PopupMenu::containsCommandItem (const int commandID) const | |||||
| bool PopupMenu::containsCommandItem (const int commandID) const throw() | |||||
| { | { | ||||
| for (int i = items.size(); --i >= 0;) | for (int i = items.size(); --i >= 0;) | ||||
| { | { | ||||
| @@ -1755,7 +1755,7 @@ bool PopupMenu::containsCommandItem (const int commandID) const | |||||
| return false; | return false; | ||||
| } | } | ||||
| void PopupMenu::setLookAndFeel (LookAndFeel* const newLookAndFeel) | |||||
| void PopupMenu::setLookAndFeel (LookAndFeel* const newLookAndFeel) throw() | |||||
| { | { | ||||
| lookAndFeel = newLookAndFeel; | lookAndFeel = newLookAndFeel; | ||||
| } | } | ||||
| @@ -89,20 +89,20 @@ class JUCE_API PopupMenu | |||||
| public: | public: | ||||
| //============================================================================== | //============================================================================== | ||||
| /** Creates an empty popup menu. */ | /** Creates an empty popup menu. */ | ||||
| PopupMenu(); | |||||
| PopupMenu() throw(); | |||||
| /** Creates a copy of another menu. */ | /** Creates a copy of another menu. */ | ||||
| PopupMenu (const PopupMenu& other); | |||||
| PopupMenu (const PopupMenu& other) throw(); | |||||
| /** Destructor. */ | /** Destructor. */ | ||||
| ~PopupMenu(); | |||||
| ~PopupMenu() throw(); | |||||
| /** Copies this menu from another one. */ | /** Copies this menu from another one. */ | ||||
| const PopupMenu& operator= (const PopupMenu& other); | |||||
| const PopupMenu& operator= (const PopupMenu& other) throw(); | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Resets the menu, removing all its items. */ | /** Resets the menu, removing all its items. */ | ||||
| void clear(); | |||||
| void clear() throw(); | |||||
| /** Appends a new text item for this menu to show. | /** Appends a new text item for this menu to show. | ||||
| @@ -125,7 +125,7 @@ public: | |||||
| const String& itemText, | const String& itemText, | ||||
| const bool isActive = true, | const bool isActive = true, | ||||
| const bool isTicked = false, | const bool isTicked = false, | ||||
| const Image* const iconToUse = 0); | |||||
| const Image* const iconToUse = 0) throw(); | |||||
| /** Adds an item that represents one of the commands in a command manager object. | /** Adds an item that represents one of the commands in a command manager object. | ||||
| @@ -137,7 +137,7 @@ public: | |||||
| */ | */ | ||||
| void addCommandItem (ApplicationCommandManager* commandManager, | void addCommandItem (ApplicationCommandManager* commandManager, | ||||
| const int commandID, | const int commandID, | ||||
| const String& displayName = String::empty); | |||||
| const String& displayName = String::empty) throw(); | |||||
| /** Appends a text item with a special colour. | /** Appends a text item with a special colour. | ||||
| @@ -151,7 +151,7 @@ public: | |||||
| const Colour& itemTextColour, | const Colour& itemTextColour, | ||||
| const bool isActive = true, | const bool isActive = true, | ||||
| const bool isTicked = false, | const bool isTicked = false, | ||||
| const Image* const iconToUse = 0); | |||||
| const Image* const iconToUse = 0) throw(); | |||||
| /** Appends a custom menu item. | /** Appends a custom menu item. | ||||
| @@ -161,7 +161,7 @@ public: | |||||
| @see PopupMenuCustomComponent | @see PopupMenuCustomComponent | ||||
| */ | */ | ||||
| void addCustomItem (const int itemResultId, | void addCustomItem (const int itemResultId, | ||||
| PopupMenuCustomComponent* const customComponent); | |||||
| PopupMenuCustomComponent* const customComponent) throw(); | |||||
| /** Appends a custom menu item that can't be used to trigger a result. | /** Appends a custom menu item that can't be used to trigger a result. | ||||
| @@ -181,7 +181,7 @@ public: | |||||
| void addCustomItem (const int itemResultId, | void addCustomItem (const int itemResultId, | ||||
| Component* customComponent, | Component* customComponent, | ||||
| int idealWidth, int idealHeight, | int idealWidth, int idealHeight, | ||||
| const bool triggerMenuItemAutomaticallyWhenClicked); | |||||
| const bool triggerMenuItemAutomaticallyWhenClicked) throw(); | |||||
| /** Appends a sub-menu. | /** Appends a sub-menu. | ||||
| @@ -190,7 +190,7 @@ public: | |||||
| void addSubMenu (const String& subMenuName, | void addSubMenu (const String& subMenuName, | ||||
| const PopupMenu& subMenu, | const PopupMenu& subMenu, | ||||
| const bool isActive = true, | const bool isActive = true, | ||||
| Image* const iconToUse = 0); | |||||
| Image* const iconToUse = 0) throw(); | |||||
| /** Appends a separator to the menu, to help break it up into sections. | /** Appends a separator to the menu, to help break it up into sections. | ||||
| @@ -199,23 +199,23 @@ public: | |||||
| one, so your code can be quite free and easy about adding these, and it'll | one, so your code can be quite free and easy about adding these, and it'll | ||||
| always look ok. | always look ok. | ||||
| */ | */ | ||||
| void addSeparator(); | |||||
| void addSeparator() throw(); | |||||
| /** Adds a non-clickable text item to the menu. | /** Adds a non-clickable text item to the menu. | ||||
| This is a bold-font items which can be used as a header to separate the items | This is a bold-font items which can be used as a header to separate the items | ||||
| into named groups. | into named groups. | ||||
| */ | */ | ||||
| void addSectionHeader (const String& title); | |||||
| void addSectionHeader (const String& title) throw(); | |||||
| /** Returns the number of items that the menu currently contains. | /** Returns the number of items that the menu currently contains. | ||||
| (This doesn't count separators). | (This doesn't count separators). | ||||
| */ | */ | ||||
| int getNumItems() const; | |||||
| int getNumItems() const throw(); | |||||
| /** Returns true if the menu contains a command item that triggers the given command. */ | /** Returns true if the menu contains a command item that triggers the given command. */ | ||||
| bool containsCommandItem (const int commandID) const; | |||||
| bool containsCommandItem (const int commandID) const throw(); | |||||
| //============================================================================== | //============================================================================== | ||||
| @@ -294,7 +294,7 @@ public: | |||||
| This can be called before show() if you need a customised menu. Be careful | This can be called before show() if you need a customised menu. Be careful | ||||
| not to delete the LookAndFeel object before the menu has been deleted. | not to delete the LookAndFeel object before the menu has been deleted. | ||||
| */ | */ | ||||
| void setLookAndFeel (LookAndFeel* const newLookAndFeel); | |||||
| void setLookAndFeel (LookAndFeel* const newLookAndFeel) throw(); | |||||
| //============================================================================== | //============================================================================== | ||||
| /** A set of colour IDs to use to change the colour of various aspects of the menu. | /** A set of colour IDs to use to change the colour of various aspects of the menu. | ||||
| @@ -386,7 +386,7 @@ private: | |||||
| const int maximumNumColumns, | const int maximumNumColumns, | ||||
| const int standardItemHeight, | const int standardItemHeight, | ||||
| const bool alignToRectangle, | const bool alignToRectangle, | ||||
| Component* const componentAttachedTo); | |||||
| Component* const componentAttachedTo) throw(); | |||||
| friend class MenuBarComponent; | friend class MenuBarComponent; | ||||
| Component* createMenuComponent (const int x, const int y, const int w, const int h, | Component* createMenuComponent (const int x, const int y, const int w, const int h, | ||||
| @@ -397,7 +397,7 @@ private: | |||||
| const bool alignToRectangle, | const bool alignToRectangle, | ||||
| Component* menuBarComponent, | Component* menuBarComponent, | ||||
| ApplicationCommandManager** managerOfChosenCommand, | ApplicationCommandManager** managerOfChosenCommand, | ||||
| Component* const componentAttachedTo); | |||||
| Component* const componentAttachedTo) throw(); | |||||
| }; | }; | ||||
| #endif // __JUCE_POPUPMENU_JUCEHEADER__ | #endif // __JUCE_POPUPMENU_JUCEHEADER__ | ||||
| @@ -236,6 +236,29 @@ int Thread::getNumRunningThreads() throw() | |||||
| return runningThreads.size(); | return runningThreads.size(); | ||||
| } | } | ||||
| Thread* Thread::getCurrentThread() throw() | |||||
| { | |||||
| const int thisId = getCurrentThreadId(); | |||||
| Thread* result = 0; | |||||
| runningThreadsLock.enter(); | |||||
| for (int i = runningThreads.size(); --i >= 0;) | |||||
| { | |||||
| Thread* const t = (Thread*) (runningThreads.getUnchecked(i)); | |||||
| if (t->threadId_ == thisId) | |||||
| { | |||||
| result = t; | |||||
| break; | |||||
| } | |||||
| } | |||||
| runningThreadsLock.exit(); | |||||
| return result; | |||||
| } | |||||
| void Thread::stopAllThreads (const int timeoutInMillisecs) throw() | void Thread::stopAllThreads (const int timeoutInMillisecs) throw() | ||||
| { | { | ||||
| while (getNumRunningThreads() > 0) | while (getNumRunningThreads() > 0) | ||||
| @@ -225,6 +225,13 @@ public: | |||||
| */ | */ | ||||
| static int getCurrentThreadId() throw(); | static int getCurrentThreadId() throw(); | ||||
| /** Finds the thread object that is currently running. | |||||
| Note that the main UI thread (or other non-Juce threads) don't have a Thread | |||||
| object associated with them, so this will return 0. | |||||
| */ | |||||
| static Thread* getCurrentThread() throw(); | |||||
| /** Returns the ID of this thread. | /** Returns the ID of this thread. | ||||
| That means the ID of this thread object - not of the thread that's calling the method. | That means the ID of this thread object - not of the thread that's calling the method. | ||||