| @@ -959,7 +959,7 @@ private: | |||||
| static String createRTASName() | static String createRTASName() | ||||
| { | { | ||||
| return String (JucePlugin_Name) + "\n" | return String (JucePlugin_Name) + "\n" | ||||
| + String (JucePlugin_Name).substring (0, 4); | |||||
| + String (JucePlugin_Desc); | |||||
| } | } | ||||
| static EPlugIn_StemFormat getFormatForChans (const int numChans) noexcept | static EPlugIn_StemFormat getFormatForChans (const int numChans) noexcept | ||||
| @@ -559,17 +559,17 @@ void TableHeaderComponent::resized() | |||||
| void TableHeaderComponent::mouseMove (const MouseEvent& e) | void TableHeaderComponent::mouseMove (const MouseEvent& e) | ||||
| { | { | ||||
| updateColumnUnderMouse (e.x, e.y); | |||||
| updateColumnUnderMouse (e); | |||||
| } | } | ||||
| void TableHeaderComponent::mouseEnter (const MouseEvent& e) | void TableHeaderComponent::mouseEnter (const MouseEvent& e) | ||||
| { | { | ||||
| updateColumnUnderMouse (e.x, e.y); | |||||
| updateColumnUnderMouse (e); | |||||
| } | } | ||||
| void TableHeaderComponent::mouseExit (const MouseEvent& e) | void TableHeaderComponent::mouseExit (const MouseEvent& e) | ||||
| { | { | ||||
| updateColumnUnderMouse (e.x, e.y); | |||||
| setColumnUnderMouse (0); | |||||
| } | } | ||||
| void TableHeaderComponent::mouseDown (const MouseEvent& e) | void TableHeaderComponent::mouseDown (const MouseEvent& e) | ||||
| @@ -771,7 +771,7 @@ void TableHeaderComponent::mouseUp (const MouseEvent& e) | |||||
| endDrag (getIndexOfColumnId (columnIdBeingDragged, true)); | endDrag (getIndexOfColumnId (columnIdBeingDragged, true)); | ||||
| updateColumnUnderMouse (e.x, e.y); | |||||
| updateColumnUnderMouse (e); | |||||
| if (columnIdUnderMouse != 0 && e.mouseWasClicked() && ! e.mods.isPopupMenu()) | if (columnIdUnderMouse != 0 && e.mouseWasClicked() && ! e.mods.isPopupMenu()) | ||||
| columnClicked (columnIdUnderMouse, e.mods); | columnClicked (columnIdUnderMouse, e.mods); | ||||
| @@ -892,11 +892,8 @@ int TableHeaderComponent::getResizeDraggerAt (const int mouseX) const | |||||
| return 0; | return 0; | ||||
| } | } | ||||
| void TableHeaderComponent::updateColumnUnderMouse (int x, int y) | |||||
| void TableHeaderComponent::setColumnUnderMouse (const int newCol) | |||||
| { | { | ||||
| const int newCol = (reallyContains (Point<int> (x, y), true) && getResizeDraggerAt (x) == 0) | |||||
| ? getColumnIdAtX (x) : 0; | |||||
| if (newCol != columnIdUnderMouse) | if (newCol != columnIdUnderMouse) | ||||
| { | { | ||||
| columnIdUnderMouse = newCol; | columnIdUnderMouse = newCol; | ||||
| @@ -904,6 +901,12 @@ void TableHeaderComponent::updateColumnUnderMouse (int x, int y) | |||||
| } | } | ||||
| } | } | ||||
| void TableHeaderComponent::updateColumnUnderMouse (const MouseEvent& e) | |||||
| { | |||||
| setColumnUnderMouse (reallyContains (e.getPosition(), true) && getResizeDraggerAt (e.x) == 0 | |||||
| ? getColumnIdAtX (e.x) : 0); | |||||
| } | |||||
| static void tableHeaderMenuCallback (int result, TableHeaderComponent* tableHeader, int columnIdClicked) | static void tableHeaderMenuCallback (int result, TableHeaderComponent* tableHeader, int columnIdClicked) | ||||
| { | { | ||||
| if (tableHeader != nullptr && result != 0) | if (tableHeader != nullptr && result != 0) | ||||
| @@ -419,7 +419,8 @@ private: | |||||
| void beginDrag (const MouseEvent&); | void beginDrag (const MouseEvent&); | ||||
| void endDrag (int finalIndex); | void endDrag (int finalIndex); | ||||
| int getResizeDraggerAt (int mouseX) const; | int getResizeDraggerAt (int mouseX) const; | ||||
| void updateColumnUnderMouse (int x, int y); | |||||
| void updateColumnUnderMouse (const MouseEvent&); | |||||
| void setColumnUnderMouse (int columnId); | |||||
| void resizeColumnsToFit (int firstColumnIndex, int targetTotalWidth); | void resizeColumnsToFit (int firstColumnIndex, int targetTotalWidth); | ||||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TableHeaderComponent); | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TableHeaderComponent); | ||||
| @@ -229,6 +229,11 @@ FileBasedDocument::SaveResult FileBasedDocument::saveIfNeededAndUserAgrees() | |||||
| return userCancelledSave; | return userCancelledSave; | ||||
| } | } | ||||
| File FileBasedDocument::getSuggestedSaveAsFile (const File& defaultFile) | |||||
| { | |||||
| return defaultFile.withFileExtension (fileExtension).getNonexistentSibling (true); | |||||
| } | |||||
| FileBasedDocument::SaveResult FileBasedDocument::saveAsInteractive (const bool warnAboutOverwritingExistingFiles) | FileBasedDocument::SaveResult FileBasedDocument::saveAsInteractive (const bool warnAboutOverwritingExistingFiles) | ||||
| { | { | ||||
| File f; | File f; | ||||
| @@ -248,8 +253,7 @@ FileBasedDocument::SaveResult FileBasedDocument::saveAsInteractive (const bool w | |||||
| else | else | ||||
| f = File::getSpecialLocation (File::userDocumentsDirectory).getChildFile (legalFilename); | f = File::getSpecialLocation (File::userDocumentsDirectory).getChildFile (legalFilename); | ||||
| f = f.withFileExtension (fileExtension) | |||||
| .getNonexistentSibling (true); | |||||
| f = getSuggestedSaveAsFile (f); | |||||
| FileChooser fc (saveFileDialogTitle, f, fileWildcard); | FileChooser fc (saveFileDialogTitle, f, fileWildcard); | ||||
| @@ -275,6 +275,13 @@ protected: | |||||
| */ | */ | ||||
| virtual void setLastDocumentOpened (const File& file) = 0; | virtual void setLastDocumentOpened (const File& file) = 0; | ||||
| /** This is called by saveAsInteractive() to allow you to optionally customise the | |||||
| filename that the user is presented with in the save dialog. | |||||
| The defaultFile parameter is an initial suggestion based on what the class knows | |||||
| about the current document - you can return a variation on this file with a different | |||||
| extension, etc, or just return something completely different. | |||||
| */ | |||||
| virtual File getSuggestedSaveAsFile (const File& defaultFile); | |||||
| private: | private: | ||||
| //============================================================================== | //============================================================================== | ||||