Przeglądaj źródła

Renaming items in the IDE

Ivan Safrin 14 lat temu
rodzic
commit
1ee0958f5c

+ 62 - 13
IDE/Build/Mac OS X/English.lproj/MainMenu.xib

@@ -210,7 +210,7 @@
 									<reference key="NSOnImage" ref="35465992"/>
 									<reference key="NSOnImage" ref="35465992"/>
 									<reference key="NSMixedImage" ref="502551668"/>
 									<reference key="NSMixedImage" ref="502551668"/>
 								</object>
 								</object>
-								<object class="NSMenuItem" id="241372282">
+								<object class="NSMenuItem" id="93992569">
 									<reference key="NSMenu" ref="720053764"/>
 									<reference key="NSMenu" ref="720053764"/>
 									<string key="NSTitle">New Folder</string>
 									<string key="NSTitle">New Folder</string>
 									<string key="NSKeyEquiv">F</string>
 									<string key="NSKeyEquiv">F</string>
@@ -277,7 +277,7 @@
 									<reference key="NSOnImage" ref="35465992"/>
 									<reference key="NSOnImage" ref="35465992"/>
 									<reference key="NSMixedImage" ref="502551668"/>
 									<reference key="NSMixedImage" ref="502551668"/>
 								</object>
 								</object>
-								<object class="NSMenuItem" id="174789659">
+								<object class="NSMenuItem" id="355684970">
 									<reference key="NSMenu" ref="720053764"/>
 									<reference key="NSMenu" ref="720053764"/>
 									<string key="NSTitle">Remove File</string>
 									<string key="NSTitle">Remove File</string>
 									<string type="base64-UTF8" key="NSKeyEquiv">CA</string>
 									<string type="base64-UTF8" key="NSKeyEquiv">CA</string>
@@ -697,7 +697,7 @@
 						<reference key="NSOnImage" ref="35465992"/>
 						<reference key="NSOnImage" ref="35465992"/>
 						<reference key="NSMixedImage" ref="502551668"/>
 						<reference key="NSMixedImage" ref="502551668"/>
 					</object>
 					</object>
-					<object class="NSMenuItem" id="7599453">
+					<object class="NSMenuItem" id="46500047">
 						<reference key="NSMenu" ref="1048220208"/>
 						<reference key="NSMenu" ref="1048220208"/>
 						<string key="NSTitle">Add New Folder</string>
 						<string key="NSTitle">Add New Folder</string>
 						<string key="NSKeyEquiv"/>
 						<string key="NSKeyEquiv"/>
@@ -715,6 +715,24 @@
 						<reference key="NSOnImage" ref="35465992"/>
 						<reference key="NSOnImage" ref="35465992"/>
 						<reference key="NSMixedImage" ref="502551668"/>
 						<reference key="NSMixedImage" ref="502551668"/>
 					</object>
 					</object>
+					<object class="NSMenuItem" id="49210983">
+						<reference key="NSMenu" ref="1048220208"/>
+						<string key="NSTitle">Rename</string>
+						<string key="NSKeyEquiv"/>
+						<int key="NSMnemonicLoc">2147483647</int>
+						<reference key="NSOnImage" ref="35465992"/>
+						<reference key="NSMixedImage" ref="502551668"/>
+					</object>
+					<object class="NSMenuItem" id="954168611">
+						<reference key="NSMenu" ref="1048220208"/>
+						<bool key="NSIsDisabled">YES</bool>
+						<bool key="NSIsSeparator">YES</bool>
+						<string key="NSTitle"/>
+						<string key="NSKeyEquiv"/>
+						<int key="NSMnemonicLoc">2147483647</int>
+						<reference key="NSOnImage" ref="35465992"/>
+						<reference key="NSMixedImage" ref="502551668"/>
+					</object>
 					<object class="NSMenuItem" id="901265223">
 					<object class="NSMenuItem" id="901265223">
 						<reference key="NSMenu" ref="1048220208"/>
 						<reference key="NSMenu" ref="1048220208"/>
 						<string key="NSTitle">Remove</string>
 						<string key="NSTitle">Remove</string>
@@ -1005,7 +1023,7 @@
 					<object class="IBActionConnection" key="connection">
 					<object class="IBActionConnection" key="connection">
 						<string key="label">newGroup:</string>
 						<string key="label">newGroup:</string>
 						<reference key="source" ref="976324537"/>
 						<reference key="source" ref="976324537"/>
-						<reference key="destination" ref="241372282"/>
+						<reference key="destination" ref="93992569"/>
 					</object>
 					</object>
 					<int key="connectionID">574</int>
 					<int key="connectionID">574</int>
 				</object>
 				</object>
@@ -1013,7 +1031,7 @@
 					<object class="IBActionConnection" key="connection">
 					<object class="IBActionConnection" key="connection">
 						<string key="label">removeFile:</string>
 						<string key="label">removeFile:</string>
 						<reference key="source" ref="976324537"/>
 						<reference key="source" ref="976324537"/>
-						<reference key="destination" ref="174789659"/>
+						<reference key="destination" ref="355684970"/>
 					</object>
 					</object>
 					<int key="connectionID">576</int>
 					<int key="connectionID">576</int>
 				</object>
 				</object>
@@ -1045,10 +1063,18 @@
 					<object class="IBActionConnection" key="connection">
 					<object class="IBActionConnection" key="connection">
 						<string key="label">newGroup:</string>
 						<string key="label">newGroup:</string>
 						<reference key="source" ref="976324537"/>
 						<reference key="source" ref="976324537"/>
-						<reference key="destination" ref="7599453"/>
+						<reference key="destination" ref="46500047"/>
 					</object>
 					</object>
 					<int key="connectionID">581</int>
 					<int key="connectionID">581</int>
 				</object>
 				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">renameFile:</string>
+						<reference key="source" ref="976324537"/>
+						<reference key="destination" ref="49210983"/>
+					</object>
+					<int key="connectionID">584</int>
+				</object>
 			</object>
 			</object>
 			<object class="IBMutableOrderedSet" key="objectRecords">
 			<object class="IBMutableOrderedSet" key="objectRecords">
 				<object class="NSArray" key="orderedObjects">
 				<object class="NSArray" key="orderedObjects">
@@ -1147,8 +1173,8 @@
 							<reference ref="164447311"/>
 							<reference ref="164447311"/>
 							<reference ref="810242391"/>
 							<reference ref="810242391"/>
 							<reference ref="1071799412"/>
 							<reference ref="1071799412"/>
-							<reference ref="241372282"/>
-							<reference ref="174789659"/>
+							<reference ref="93992569"/>
+							<reference ref="355684970"/>
 						</object>
 						</object>
 						<reference key="parent" ref="379814623"/>
 						<reference key="parent" ref="379814623"/>
 					</object>
 					</object>
@@ -1538,7 +1564,9 @@
 							<reference ref="548023385"/>
 							<reference ref="548023385"/>
 							<reference ref="901265223"/>
 							<reference ref="901265223"/>
 							<reference ref="26940596"/>
 							<reference ref="26940596"/>
-							<reference ref="7599453"/>
+							<reference ref="46500047"/>
+							<reference ref="49210983"/>
+							<reference ref="954168611"/>
 						</object>
 						</object>
 						<reference key="parent" ref="0"/>
 						<reference key="parent" ref="0"/>
 					</object>
 					</object>
@@ -1574,17 +1602,27 @@
 					</object>
 					</object>
 					<object class="IBObjectRecord">
 					<object class="IBObjectRecord">
 						<int key="objectID">573</int>
 						<int key="objectID">573</int>
-						<reference key="object" ref="241372282"/>
+						<reference key="object" ref="93992569"/>
 						<reference key="parent" ref="720053764"/>
 						<reference key="parent" ref="720053764"/>
 					</object>
 					</object>
 					<object class="IBObjectRecord">
 					<object class="IBObjectRecord">
 						<int key="objectID">575</int>
 						<int key="objectID">575</int>
-						<reference key="object" ref="174789659"/>
+						<reference key="object" ref="355684970"/>
 						<reference key="parent" ref="720053764"/>
 						<reference key="parent" ref="720053764"/>
 					</object>
 					</object>
 					<object class="IBObjectRecord">
 					<object class="IBObjectRecord">
 						<int key="objectID">580</int>
 						<int key="objectID">580</int>
-						<reference key="object" ref="7599453"/>
+						<reference key="object" ref="46500047"/>
+						<reference key="parent" ref="1048220208"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">582</int>
+						<reference key="object" ref="49210983"/>
+						<reference key="parent" ref="1048220208"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">583</int>
+						<reference key="object" ref="954168611"/>
 						<reference key="parent" ref="1048220208"/>
 						<reference key="parent" ref="1048220208"/>
 					</object>
 					</object>
 				</object>
 				</object>
@@ -1667,6 +1705,8 @@
 					<string>575.IBPluginDependency</string>
 					<string>575.IBPluginDependency</string>
 					<string>58.IBPluginDependency</string>
 					<string>58.IBPluginDependency</string>
 					<string>580.IBPluginDependency</string>
 					<string>580.IBPluginDependency</string>
+					<string>582.IBPluginDependency</string>
+					<string>583.IBPluginDependency</string>
 					<string>72.IBPluginDependency</string>
 					<string>72.IBPluginDependency</string>
 					<string>73.IBPluginDependency</string>
 					<string>73.IBPluginDependency</string>
 					<string>75.IBPluginDependency</string>
 					<string>75.IBPluginDependency</string>
@@ -1760,6 +1800,8 @@
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 				</object>
 				</object>
 			</object>
 			</object>
 			<object class="NSMutableDictionary" key="unlocalizedProperties">
 			<object class="NSMutableDictionary" key="unlocalizedProperties">
@@ -1774,7 +1816,7 @@
 				<reference key="dict.values" ref="0"/>
 				<reference key="dict.values" ref="0"/>
 			</object>
 			</object>
 			<nil key="sourceID"/>
 			<nil key="sourceID"/>
-			<int key="maxID">581</int>
+			<int key="maxID">584</int>
 		</object>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
 			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -1860,6 +1902,7 @@
 							<string>newProject:</string>
 							<string>newProject:</string>
 							<string>openProject:</string>
 							<string>openProject:</string>
 							<string>removeFile:</string>
 							<string>removeFile:</string>
+							<string>renameFile:</string>
 							<string>runProject:</string>
 							<string>runProject:</string>
 							<string>saveFile:</string>
 							<string>saveFile:</string>
 						</object>
 						</object>
@@ -1874,6 +1917,7 @@
 							<string>id</string>
 							<string>id</string>
 							<string>id</string>
 							<string>id</string>
 							<string>id</string>
 							<string>id</string>
+							<string>id</string>
 						</object>
 						</object>
 					</object>
 					</object>
 					<object class="NSMutableDictionary" key="actionInfosByName">
 					<object class="NSMutableDictionary" key="actionInfosByName">
@@ -1887,6 +1931,7 @@
 							<string>newProject:</string>
 							<string>newProject:</string>
 							<string>openProject:</string>
 							<string>openProject:</string>
 							<string>removeFile:</string>
 							<string>removeFile:</string>
+							<string>renameFile:</string>
 							<string>runProject:</string>
 							<string>runProject:</string>
 							<string>saveFile:</string>
 							<string>saveFile:</string>
 						</object>
 						</object>
@@ -1920,6 +1965,10 @@
 								<string key="name">removeFile:</string>
 								<string key="name">removeFile:</string>
 								<string key="candidateClassName">id</string>
 								<string key="candidateClassName">id</string>
 							</object>
 							</object>
+							<object class="IBActionInfo">
+								<string key="name">renameFile:</string>
+								<string key="candidateClassName">id</string>
+							</object>
 							<object class="IBActionInfo">
 							<object class="IBActionInfo">
 								<string key="name">runProject:</string>
 								<string key="name">runProject:</string>
 								<string key="candidateClassName">id</string>
 								<string key="candidateClassName">id</string>

+ 6 - 0
IDE/Build/Mac OS X/Polycode.xcodeproj/project.pbxproj

@@ -10,6 +10,7 @@
 		1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; };
 		1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; };
 		256AC3DA0F4B6AC300CF3369 /* PolycodeAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 256AC3D90F4B6AC300CF3369 /* PolycodeAppDelegate.m */; };
 		256AC3DA0F4B6AC300CF3369 /* PolycodeAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 256AC3D90F4B6AC300CF3369 /* PolycodeAppDelegate.m */; };
 		6D34143412B816BC0034FA9B /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D34143312B816BC0034FA9B /* IOKit.framework */; };
 		6D34143412B816BC0034FA9B /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D34143312B816BC0034FA9B /* IOKit.framework */; };
+		6D3B6C5B14B820A900727F17 /* ToolWindows.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D3B6C5A14B820A900727F17 /* ToolWindows.cpp */; };
 		6D6D3FA614B446A600219173 /* PolycodeToolLauncher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D6D3FA514B446A600219173 /* PolycodeToolLauncher.cpp */; };
 		6D6D3FA614B446A600219173 /* PolycodeToolLauncher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D6D3FA514B446A600219173 /* PolycodeToolLauncher.cpp */; };
 		6D70AB2A12B29BF200EB6D94 /* NewFileWindow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D70AB2912B29BF200EB6D94 /* NewFileWindow.cpp */; };
 		6D70AB2A12B29BF200EB6D94 /* NewFileWindow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D70AB2912B29BF200EB6D94 /* NewFileWindow.cpp */; };
 		6D80E91E12AB53FB0037A708 /* PolycodeFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D80E91912AB53FB0037A708 /* PolycodeFrame.cpp */; };
 		6D80E91E12AB53FB0037A708 /* PolycodeFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D80E91912AB53FB0037A708 /* PolycodeFrame.cpp */; };
@@ -67,6 +68,8 @@
 		29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
 		29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
 		29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
 		29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
 		6D34143312B816BC0034FA9B /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
 		6D34143312B816BC0034FA9B /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
+		6D3B6C5A14B820A900727F17 /* ToolWindows.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ToolWindows.cpp; sourceTree = "<group>"; };
+		6D3B6C5C14B820B000727F17 /* ToolWindows.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ToolWindows.h; sourceTree = "<group>"; };
 		6D6D3FA514B446A600219173 /* PolycodeToolLauncher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolycodeToolLauncher.cpp; sourceTree = "<group>"; };
 		6D6D3FA514B446A600219173 /* PolycodeToolLauncher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolycodeToolLauncher.cpp; sourceTree = "<group>"; };
 		6D6D3FA814B446AF00219173 /* PolycodeToolLauncher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolycodeToolLauncher.h; sourceTree = "<group>"; };
 		6D6D3FA814B446AF00219173 /* PolycodeToolLauncher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolycodeToolLauncher.h; sourceTree = "<group>"; };
 		6D70AB2812B29BEC00EB6D94 /* NewFileWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewFileWindow.h; sourceTree = "<group>"; };
 		6D70AB2812B29BEC00EB6D94 /* NewFileWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewFileWindow.h; sourceTree = "<group>"; };
@@ -235,6 +238,7 @@
 		6D80E91212AB53FB0037A708 /* Include */ = {
 		6D80E91212AB53FB0037A708 /* Include */ = {
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
+				6D3B6C5C14B820B000727F17 /* ToolWindows.h */,
 				6DCAFD4614B51A2D00039F34 /* ExampleBrowserWindow.h */,
 				6DCAFD4614B51A2D00039F34 /* ExampleBrowserWindow.h */,
 				6D6D3FA814B446AF00219173 /* PolycodeToolLauncher.h */,
 				6D6D3FA814B446AF00219173 /* PolycodeToolLauncher.h */,
 				6D70AB2812B29BEC00EB6D94 /* NewFileWindow.h */,
 				6D70AB2812B29BEC00EB6D94 /* NewFileWindow.h */,
@@ -258,6 +262,7 @@
 		6D80E91812AB53FB0037A708 /* Source */ = {
 		6D80E91812AB53FB0037A708 /* Source */ = {
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
+				6D3B6C5A14B820A900727F17 /* ToolWindows.cpp */,
 				6DCAFD4214B519C900039F34 /* ExampleBrowserWindow.cpp */,
 				6DCAFD4214B519C900039F34 /* ExampleBrowserWindow.cpp */,
 				6D6D3FA514B446A600219173 /* PolycodeToolLauncher.cpp */,
 				6D6D3FA514B446A600219173 /* PolycodeToolLauncher.cpp */,
 				6D70AB2912B29BF200EB6D94 /* NewFileWindow.cpp */,
 				6D70AB2912B29BF200EB6D94 /* NewFileWindow.cpp */,
@@ -376,6 +381,7 @@
 				6D8A55BC14B3EACB005F6411 /* PolycodeView.mm in Sources */,
 				6D8A55BC14B3EACB005F6411 /* PolycodeView.mm in Sources */,
 				6D6D3FA614B446A600219173 /* PolycodeToolLauncher.cpp in Sources */,
 				6D6D3FA614B446A600219173 /* PolycodeToolLauncher.cpp in Sources */,
 				6DCAFD4314B519C900039F34 /* ExampleBrowserWindow.cpp in Sources */,
 				6DCAFD4314B519C900039F34 /* ExampleBrowserWindow.cpp in Sources */,
+				6D3B6C5B14B820A900727F17 /* ToolWindows.cpp in Sources */,
 			);
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 		};

+ 1 - 0
IDE/Build/Mac OS X/PolycodeAppDelegate.h

@@ -52,6 +52,7 @@ public:
 
 
 // Menu accessors
 // Menu accessors
 
 
+-(IBAction) renameFile: (id) sender;
 -(IBAction) removeFile: (id) sender;
 -(IBAction) removeFile: (id) sender;
 -(IBAction) newGroup: (id) sender;
 -(IBAction) newGroup: (id) sender;
 -(IBAction) browseExamples: (id) sender;
 -(IBAction) browseExamples: (id) sender;

+ 4 - 0
IDE/Build/Mac OS X/PolycodeAppDelegate.m

@@ -71,6 +71,10 @@
 	return YES;
 	return YES;
 }
 }
 
 
+-(IBAction) renameFile: (id) sender {
+	app->renameFile();
+}
+
 -(IBAction) removeFile: (id) sender {
 -(IBAction) removeFile: (id) sender {
 	app->removeFile();
 	app->removeFile();
 }
 }

+ 1 - 0
IDE/Contents/Include/PolycodeEditor.h

@@ -36,6 +36,7 @@ public:
 	
 	
 	virtual void saveFile(){};
 	virtual void saveFile(){};
 	
 	
+	void setFilePath(String newPath);
 	String getFilePath() { return filePath; }
 	String getFilePath() { return filePath; }
 	
 	
 	bool isReadOnly() { return _isReadOnly; }
 	bool isReadOnly() { return _isReadOnly; }

+ 3 - 0
IDE/Contents/Include/PolycodeFrame.h

@@ -27,6 +27,7 @@
 #include "NewProjectWindow.h"
 #include "NewProjectWindow.h"
 #include "ExampleBrowserWindow.h"
 #include "ExampleBrowserWindow.h"
 #include "NewFileWindow.h"
 #include "NewFileWindow.h"
+#include "ToolWindows.h"
 
 
 using namespace Polycode;
 using namespace Polycode;
 
 
@@ -52,6 +53,8 @@ public:
 	ExampleBrowserWindow *exampleBrowserWindow;
 	ExampleBrowserWindow *exampleBrowserWindow;
 	NewFileWindow *newFileWindow;
 	NewFileWindow *newFileWindow;
 	
 	
+	TextInputPopup *textInputPopup;
+	
 	ScreenEntity *welcomeEntity;	
 	ScreenEntity *welcomeEntity;	
 	PolycodeProjectBrowser *projectBrowser;
 	PolycodeProjectBrowser *projectBrowser;
 		
 		

+ 1 - 0
IDE/Contents/Include/PolycodeIDEApp.h

@@ -50,6 +50,7 @@ public:
 	void loadConfigFile();
 	void loadConfigFile();
 	
 	
 	// menu commands
 	// menu commands
+	void renameFile();
 	void removeFile();
 	void removeFile();
 	void browseExamples();
 	void browseExamples();
 	void newProject();
 	void newProject();

+ 1 - 0
IDE/Contents/Include/PolycodeProjectManager.h

@@ -51,6 +51,7 @@ class PolycodeProjectManager {
 	
 	
 	String activeFolder;
 	String activeFolder;
 	String selectedFile;
 	String selectedFile;
+	OSFileEntry selectedFileEntry;
 	
 	
 protected:
 protected:
 	
 	

+ 48 - 0
IDE/Contents/Include/ToolWindows.h

@@ -0,0 +1,48 @@
+/*
+ Copyright (C) 2012 by Ivan Safrin
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+ */
+
+#pragma once
+
+#include "PolycodeGlobals.h"
+#include "PolycodeUI.h"
+#include "Polycode.h"
+#include "OSBasics.h"
+
+using namespace Polycode;
+
+class TextInputPopup : public UIWindow {
+	public:
+		TextInputPopup();
+		~TextInputPopup();
+		
+		void setValue(String value);
+		String getValue();
+		void handleEvent(Event *event);
+		
+	protected:
+	
+		UITextInput *textInput;
+	
+		UIButton *cancelButton;
+		UIButton *okButton;
+	
+};

+ 4 - 0
IDE/Contents/Source/PolycodeEditor.cpp

@@ -38,6 +38,10 @@ bool PolycodeEditorFactory::canHandleExtension(String extension) {
 	return false;
 	return false;
 }
 }
 
 
+void PolycodeEditor::setFilePath(String newPath) {
+	filePath = newPath;
+}
+
 PolycodeEditor::PolycodeEditor(bool _isReadOnly) : ScreenEntity() {
 PolycodeEditor::PolycodeEditor(bool _isReadOnly) : ScreenEntity() {
 	this->_isReadOnly = _isReadOnly;
 	this->_isReadOnly = _isReadOnly;
 }
 }

+ 3 - 0
IDE/Contents/Source/PolycodeFrame.cpp

@@ -83,6 +83,9 @@ PolycodeFrame::PolycodeFrame() : ScreenEntity() {
 	newFileWindow = new NewFileWindow();
 	newFileWindow = new NewFileWindow();
 	newFileWindow->visible = false;
 	newFileWindow->visible = false;
 	
 	
+	textInputPopup = new TextInputPopup();
+	textInputPopup->visible = false;
+	
 	currentEditor = NULL;
 	currentEditor = NULL;
 	
 	
 }
 }

+ 31 - 2
IDE/Contents/Source/PolycodeIDEApp.cpp

@@ -53,7 +53,8 @@ PolycodeIDEApp::PolycodeIDEApp(PolycodeView *view) : EventDispatcher() {
 	
 	
 	frame = new PolycodeFrame();
 	frame = new PolycodeFrame();
 	frame->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
 	frame->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
-	
+
+	frame->textInputPopup->addEventListener(this, UIEvent::OK_EVENT);	
 	frame->newProjectWindow->addEventListener(this, UIEvent::OK_EVENT);
 	frame->newProjectWindow->addEventListener(this, UIEvent::OK_EVENT);
 	frame->exampleBrowserWindow->addEventListener(this, UIEvent::OK_EVENT);
 	frame->exampleBrowserWindow->addEventListener(this, UIEvent::OK_EVENT);
 	
 	
@@ -79,6 +80,13 @@ PolycodeIDEApp::PolycodeIDEApp(PolycodeView *view) : EventDispatcher() {
 	loadConfigFile();
 	loadConfigFile();
 }
 }
 
 
+void PolycodeIDEApp::renameFile() {
+	if(projectManager->selectedFile != "") {
+		frame->textInputPopup->setValue(projectManager->selectedFileEntry.name);
+		frame->showModal(frame->textInputPopup);
+	}
+}
+
 void PolycodeIDEApp::removeFile() {
 void PolycodeIDEApp::removeFile() {
 	if(projectManager->selectedFile != "") {
 	if(projectManager->selectedFile != "") {
 		core->removeDiskItem(projectManager->selectedFile);
 		core->removeDiskItem(projectManager->selectedFile);
@@ -181,7 +189,8 @@ void PolycodeIDEApp::handleEvent(Event *event) {
 				projectManager->activeFolder = "";
 				projectManager->activeFolder = "";
 				projectManager->selectedFile = "";
 				projectManager->selectedFile = "";
 			} else {
 			} else {
-				projectManager->selectedFile = selectedData->fileEntry.fullPath;			
+				projectManager->selectedFileEntry = selectedData->fileEntry;
+				projectManager->selectedFile = selectedData->fileEntry.fullPath;
 				if(selectedData->fileEntry.type == OSFileEntry::TYPE_FILE) {
 				if(selectedData->fileEntry.type == OSFileEntry::TYPE_FILE) {
 					projectManager->activeFolder = selectedData->fileEntry.basePath;
 					projectManager->activeFolder = selectedData->fileEntry.basePath;
 				} else {
 				} else {
@@ -226,6 +235,26 @@ void PolycodeIDEApp::handleEvent(Event *event) {
 		}
 		}
 	}
 	}
 	
 	
+	if(event->getDispatcher() == frame->textInputPopup) {
+		if(event->getEventType() == "UIEvent" && event->getEventCode() == UIEvent::OK_EVENT) {
+			core->moveDiskItem(projectManager->selectedFileEntry.fullPath, projectManager->selectedFileEntry.basePath + "/" + frame->textInputPopup->getValue());			
+			if(projectManager->getActiveProject()) {
+				frame->getProjectBrowser()->refreshProject(projectManager->getActiveProject());
+			}
+			
+			PolycodeEditor *editor = editorManager->getEditorForPath(projectManager->selectedFileEntry.fullPath);
+			if(editor) {
+				editor->setFilePath(projectManager->selectedFileEntry.basePath + "/" + frame->textInputPopup->getValue());
+			}
+			
+			projectManager->selectedFileEntry.fullPath = projectManager->selectedFileEntry.basePath + "/" + frame->textInputPopup->getValue();
+			projectManager->selectedFileEntry.name = frame->textInputPopup->getValue();
+			
+			
+			frame->hideModal();			
+		}
+	}	
+	
 	if(event->getDispatcher() == frame->newProjectWindow) {
 	if(event->getDispatcher() == frame->newProjectWindow) {
 		if(event->getEventType() == "UIEvent" && event->getEventCode() == UIEvent::OK_EVENT) {
 		if(event->getEventType() == "UIEvent" && event->getEventCode() == UIEvent::OK_EVENT) {
 			projectManager->createNewProject(frame->newProjectWindow->getTemplateFolder(), frame->newProjectWindow->getProjectName(), frame->newProjectWindow->getProjectLocation());
 			projectManager->createNewProject(frame->newProjectWindow->getTemplateFolder(), frame->newProjectWindow->getProjectName(), frame->newProjectWindow->getProjectLocation());

+ 72 - 0
IDE/Contents/Source/ToolWindows.cpp

@@ -0,0 +1,72 @@
+/*
+ Copyright (C) 2012 by Ivan Safrin
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+ */
+ 
+#include "ToolWindows.h"
+
+TextInputPopup::TextInputPopup() : UIWindow(L"", 300, 95) {
+	
+	textInput = new UITextInput(false, 300-(padding*3.0), 12);	
+	addChild(textInput);
+	textInput->setPosition(padding, 35);
+		
+	cancelButton = new UIButton(L"Cancel", 100);
+	cancelButton->addEventListener(this, UIEvent::CLICK_EVENT);
+	addChild(cancelButton);
+	cancelButton->setPosition(300-100-padding-100-10, 60);		
+	
+	okButton = new UIButton(L"OK", 100);
+	okButton->addEventListener(this, UIEvent::CLICK_EVENT);
+	addChild(okButton);
+	okButton->setPosition(300-100-padding, 60);
+	
+	closeOnEscape = true;
+
+}
+
+String TextInputPopup::getValue() {
+	return textInput->getText();
+}
+
+void TextInputPopup::setValue(String value) {
+	textInput->setText(value);
+	focusChild(textInput);	
+}
+
+void TextInputPopup::handleEvent(Event *event) {
+	if(event->getEventType() == "UIEvent") {
+		if(event->getEventCode() == UIEvent::CLICK_EVENT) {
+			if(event->getDispatcher() == okButton) {
+				dispatchEvent(new UIEvent(), UIEvent::OK_EVENT);						
+			}
+			
+			if(event->getDispatcher() == cancelButton) {
+				dispatchEvent(new UIEvent(), UIEvent::CLOSE_EVENT);				
+			}									
+		}
+	}
+	UIWindow::handleEvent(event);	
+}
+
+
+TextInputPopup::~TextInputPopup() {
+	
+}