1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-28 02:30:05 +00:00

Added a colour ID for TextButton text when the button is toggled on. Improved the class hierarchy implementation of some container classes. Made DSound cope better with dropped buffers.

This commit is contained in:
Julian Storer 2009-12-18 16:37:46 +00:00
parent 2a43959884
commit a126b1918a
22 changed files with 853 additions and 764 deletions

View file

@ -565,6 +565,14 @@ TreeViewItem* TreeView::getItemAt (int y) const throw()
return tc->findItemAt (y, pos);
}
TreeViewItem* TreeView::findItemFromIdentifierString (const String& identifierString) const
{
if (rootItem == 0)
return 0;
return rootItem->findItemFromIdentifierString (identifierString);
}
//==============================================================================
XmlElement* TreeView::getOpennessState (const bool alsoIncludeScrollPosition) const
{
@ -1679,6 +1687,44 @@ TreeViewItem* TreeViewItem::getNextVisibleItem (const bool recurse) const throw(
return 0;
}
const String TreeViewItem::getItemIdentifierString() const
{
String s;
if (parentItem != 0)
s = parentItem->getItemIdentifierString();
return s + T("/") + getUniqueName().replaceCharacter (T('/'), T('\\'));
}
TreeViewItem* TreeViewItem::findItemFromIdentifierString (const String& identifierString)
{
const String uid (getUniqueName());
if (uid == identifierString)
return this;
if (identifierString.startsWith (uid + T("/")))
{
const String remainingPath (identifierString.substring (uid.length() + 1));
bool wasOpen = isOpen();
setOpen (true);
for (int i = subItems.size(); --i >= 0;)
{
TreeViewItem* item = subItems.getUnchecked(i)->findItemFromIdentifierString (remainingPath);
if (item != 0)
return item;
}
setOpen (wasOpen);
}
return 0;
}
void TreeViewItem::restoreOpennessState (const XmlElement& e) throw()
{
if (e.hasTagName (T("CLOSED")))