1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-16 00:34:19 +00:00

Introjucer: commands to move back/forwards through open docs.

This commit is contained in:
jules 2012-07-07 21:11:06 +01:00
parent 39c974194e
commit 0475cedff5
11 changed files with 325 additions and 123 deletions

View file

@ -346,10 +346,8 @@ void MainWindowList::closeWindow (MainWindow* w)
void MainWindowList::openDocument (OpenDocumentManager::Document* doc)
{
MainWindow* const w = getOrCreateFrontmostWindow();
w->makeVisible();
MainWindow* w = getOrCreateFrontmostWindow();
w->getProjectContentComponent()->showDocument (doc);
avoidSuperimposedWindows (w);
}
bool MainWindowList::openFile (const File& file)
@ -381,11 +379,7 @@ bool MainWindowList::openFile (const File& file)
else if (file.exists())
{
MainWindow* const w = getOrCreateFrontmostWindow();
const bool ok = w->openFile (file);
w->makeVisible();
avoidSuperimposedWindows (w);
return ok;
return w->openFile (file);
}
return false;
@ -403,7 +397,12 @@ MainWindow* MainWindowList::createNewMainWindow()
MainWindow* MainWindowList::getOrCreateFrontmostWindow()
{
if (windows.size() == 0)
return createNewMainWindow();
{
MainWindow* w = createNewMainWindow();
avoidSuperimposedWindows (w);
w->makeVisible();
return w;
}
for (int i = Desktop::getInstance().getNumComponents(); --i >= 0;)
{