Explorar o código

Squashed 'src/ted2go/' content from commit 35ecc3e

git-subtree-dir: src/ted2go
git-subtree-split: 35ecc3eaa8e6ff4797fa4321f52e6e41f166f3a6
Mark Sibly %!s(int64=8) %!d(string=hai) anos
achega
da27658bce
Modificáronse 100 ficheiros con 3118 adicións e 0 borrados
  1. 4 0
      .gitignore
  2. 16 0
      README.md
  3. 630 0
      actions/buildactions.monkey2
  4. 155 0
      actions/editactions.monkey2
  5. 351 0
      actions/fileactions.monkey2
  6. 310 0
      actions/findactions.monkey2
  7. 98 0
      actions/helpactions.monkey2
  8. 81 0
      actions/viewactions.monkey2
  9. 312 0
      assets/about.html
  10. 125 0
      assets/aboutTed2Go.html
  11. BIN=BIN
      assets/fonts/verdana.ttf
  12. BIN=BIN
      assets/fonts/verdanab.ttf
  13. 54 0
      assets/newfiles/Letterboxed_Mojo_App.monkey2
  14. 12 0
      assets/newfiles/Simple_Console_App.monkey2
  15. 33 0
      assets/newfiles/Simple_Mojo_App.monkey2
  16. 26 0
      assets/newfiles/Simple_Mojox_Gui_App.monkey2
  17. BIN=BIN
      assets/themes/cancel.png
  18. BIN=BIN
      assets/themes/codeicons/alias.png
  19. BIN=BIN
      assets/themes/codeicons/annotation.png
  20. BIN=BIN
      assets/themes/codeicons/class.png
  21. BIN=BIN
      assets/themes/codeicons/class_private.png
  22. BIN=BIN
      assets/themes/codeicons/class_protected.png
  23. BIN=BIN
      assets/themes/codeicons/code_template.png
  24. BIN=BIN
      assets/themes/codeicons/const.png
  25. BIN=BIN
      assets/themes/codeicons/constructor.png
  26. BIN=BIN
      assets/themes/codeicons/constructor_private.png
  27. BIN=BIN
      assets/themes/codeicons/constructor_protected.png
  28. BIN=BIN
      assets/themes/codeicons/enum.png
  29. BIN=BIN
      assets/themes/codeicons/enum_private.png
  30. BIN=BIN
      assets/themes/codeicons/enum_protected.png
  31. BIN=BIN
      assets/themes/codeicons/error.png
  32. BIN=BIN
      assets/themes/codeicons/field.png
  33. BIN=BIN
      assets/themes/codeicons/field_func.png
  34. BIN=BIN
      assets/themes/codeicons/field_private.png
  35. BIN=BIN
      assets/themes/codeicons/field_protected.png
  36. BIN=BIN
      assets/themes/codeicons/field_static.png
  37. BIN=BIN
      assets/themes/codeicons/field_static_private.png
  38. BIN=BIN
      assets/themes/codeicons/field_static_protected.png
  39. BIN=BIN
      assets/themes/codeicons/folder.png
  40. BIN=BIN
      assets/themes/codeicons/interface.png
  41. BIN=BIN
      assets/themes/codeicons/keyword.png
  42. BIN=BIN
      assets/themes/codeicons/local.png
  43. BIN=BIN
      assets/themes/codeicons/method.png
  44. BIN=BIN
      assets/themes/codeicons/method_private.png
  45. BIN=BIN
      assets/themes/codeicons/method_protected.png
  46. BIN=BIN
      assets/themes/codeicons/method_static.png
  47. BIN=BIN
      assets/themes/codeicons/method_static_private.png
  48. BIN=BIN
      assets/themes/codeicons/method_static_protected.png
  49. BIN=BIN
      assets/themes/codeicons/operator.png
  50. BIN=BIN
      assets/themes/codeicons/other.png
  51. BIN=BIN
      assets/themes/codeicons/package.png
  52. BIN=BIN
      assets/themes/codeicons/property.png
  53. BIN=BIN
      assets/themes/codeicons/property_private.png
  54. BIN=BIN
      assets/themes/codeicons/property_protected.png
  55. BIN=BIN
      assets/themes/codeicons/struct.png
  56. BIN=BIN
      assets/themes/codeicons/struct_private.png
  57. BIN=BIN
      assets/themes/codeicons/struct_protected.png
  58. BIN=BIN
      assets/themes/codeicons/warning.png
  59. BIN=BIN
      assets/themes/debug_icons.png
  60. 337 0
      assets/themes/default.json
  61. BIN=BIN
      assets/themes/docbar/back.png
  62. BIN=BIN
      assets/themes/docbar/forward.png
  63. BIN=BIN
      assets/themes/docbar/home.png
  64. BIN=BIN
      assets/themes/editorbar/back.png
  65. BIN=BIN
      assets/themes/editorbar/comment.png
  66. BIN=BIN
      assets/themes/editorbar/find_next.png
  67. BIN=BIN
      assets/themes/editorbar/find_previous.png
  68. BIN=BIN
      assets/themes/editorbar/find_selection.png
  69. BIN=BIN
      assets/themes/editorbar/forward.png
  70. BIN=BIN
      assets/themes/editorbar/last_edit.png
  71. BIN=BIN
      assets/themes/editorbar/next_bookmark.png
  72. BIN=BIN
      assets/themes/editorbar/previous_bookmark.png
  73. BIN=BIN
      assets/themes/editorbar/shift_left.png
  74. BIN=BIN
      assets/themes/editorbar/shift_right.png
  75. BIN=BIN
      assets/themes/editorbar/toggle_bookmark.png
  76. BIN=BIN
      assets/themes/editorbar/uncomment.png
  77. BIN=BIN
      assets/themes/project/package.png
  78. BIN=BIN
      assets/themes/smooth_assets/button_skin.png
  79. BIN=BIN
      assets/themes/smooth_assets/checkbox_icons.png
  80. BIN=BIN
      assets/themes/smooth_assets/dialog_skin.png
  81. BIN=BIN
      assets/themes/smooth_assets/progressbar_icons.png
  82. BIN=BIN
      assets/themes/smooth_assets/tabbutton_skin.png
  83. BIN=BIN
      assets/themes/smooth_assets/tabclose_icons.png
  84. BIN=BIN
      assets/themes/smooth_assets/treeview_icons.png
  85. BIN=BIN
      assets/themes/sourcebar/filter_inherited.png
  86. BIN=BIN
      assets/themes/sourcebar/sort_alpha.png
  87. BIN=BIN
      assets/themes/sourcebar/sort_position.png
  88. 89 0
      assets/themes/ted2-default.json
  89. 40 0
      assets/themes/theme-Basic-Blue.json
  90. 32 0
      assets/themes/theme-blitzed.json
  91. 32 0
      assets/themes/theme-classic-dark.json
  92. 41 0
      assets/themes/theme-monkey1.json
  93. 32 0
      assets/themes/theme-overcast.json
  94. 28 0
      assets/themes/theme-smooth-warm.json
  95. 271 0
      assets/themes/theme-smooth.json
  96. 9 0
      assets/themes/themes.json
  97. BIN=BIN
      assets/themes/toolbar/back.png
  98. BIN=BIN
      assets/themes/toolbar/build.png
  99. BIN=BIN
      assets/themes/toolbar/check.png
  100. BIN=BIN
      assets/themes/toolbar/debug.png

+ 4 - 0
.gitignore

@@ -0,0 +1,4 @@
+
+*.bak
+*.buildv*
+*.products/

+ 16 - 0
README.md

@@ -0,0 +1,16 @@
+# Ted2Go
+My custom version of Ted2 IDE.
+
+## Benefits & Goals
+* Autocompletion for keywords, modules and user's code (WIP).
+* On-the-fly parser - see errors w/o build (not all errors).
+* "Find in project" dialog.
+* CodeTree and NavigationList for comfortable code jumping (todo).
+* Code folding and bookmarks (todo).
+* Doc's hints directly inside of code area (todo).
+
+## More info
+Discussion page: http://monkey2.monkey-x.com/forums/topic/ted2go-fork/
+
+## Monkey <-> money :)
+Support me if you like this project: https://paypal.me/engor

+ 630 - 0
actions/buildactions.monkey2

@@ -0,0 +1,630 @@
+
+Namespace ted2go
+
+
+Class BuildError
+
+	Field path:String
+	Field line:Int
+	Field msg:String
+	Field removed:Bool
+	
+	Method New( path:String,line:Int,msg:String )
+		Self.path=path
+		Self.line=line
+		Self.msg=msg
+	End
+
+	Operator<=>:Int( err:BuildError )
+		If line<err.line Return -1
+		If line>err.line Return 1
+		Return 0
+	End
+	
+End
+
+Class BuildActions
+
+	Field buildAndRun:Action
+	Field build:Action
+	Field semant:Action
+	Field buildSettings:Action
+	Field nextError:Action
+	Field lockBuildFile:Action
+	Field updateModules:Action
+	Field rebuildModules:Action
+	Field moduleManager:Action
+	Field rebuildHelp:Action
+	
+	Field targetMenu:Menu
+	
+	Field PreBuild:Void()
+	
+	Method New( docs:DocumentManager,console:Console,debugView:DebugView )
+	
+		_docs=docs
+		_console=console
+		_debugView=debugView
+		
+		_docs.DocumentRemoved+=Lambda( doc:Ted2Document )
+
+			If doc=_locked _locked=Null
+		End
+		
+		buildAndRun=New Action( "Build and run" )
+#If __TARGET__="macos"
+		buildAndRun.HotKey=Key.R
+		buildAndRun.HotKeyModifiers=Modifier.Menu
+#Else
+		buildAndRun.HotKey=Key.F5
+#Endif
+		buildAndRun.Triggered=OnBuildAndRun
+		
+
+		build=New Action( "Build only" )
+#If __TARGET__="macos"
+		build.HotKey=Key.B
+		build.HotKeyModifiers=Modifier.Menu
+#Else
+		build.HotKey=Key.F6
+#Endif
+		build.Triggered=OnBuild
+		
+		semant=New Action( "Check app" )
+#If __TARGET__="macos"
+		semant.HotKey=Key.R
+		semant.HotKeyModifiers=Modifier.Menu|Modifier.Shift
+#Else
+		semant.HotKey=Key.F7
+#Endif
+		semant.Triggered=OnSemant
+		
+		
+		buildSettings=New Action( "Target settings" )
+		buildSettings.Triggered=OnBuildFileSettings
+		
+		nextError=New Action( "Next build error" )
+		nextError.Triggered=OnNextError
+		nextError.HotKey=Key.F4
+		
+		lockBuildFile=New Action( "Lock build file" )
+		lockBuildFile.Triggered=OnLockBuildFile
+		lockBuildFile.HotKey=Key.L
+		lockBuildFile.HotKeyModifiers=Modifier.Menu
+		
+		updateModules=New Action( "Update modules" )
+		updateModules.Triggered=OnUpdateModules
+		updateModules.HotKey=Key.U
+		updateModules.HotKeyModifiers=Modifier.Menu
+		
+		rebuildModules=New Action( "Rebuild modules" )
+		rebuildModules.Triggered=OnRebuildModules
+		rebuildModules.HotKey=Key.U
+		rebuildModules.HotKeyModifiers=Modifier.Menu|Modifier.Shift
+		
+		moduleManager=New Action( "Module manager" )
+		moduleManager.Triggered=OnModuleManager
+		
+		rebuildHelp=New Action( "Rebuild documentation" )
+		rebuildHelp.Triggered=OnRebuildHelp
+		
+		local group:=New CheckGroup
+		_debugConfig=New CheckButton( "Debug",,group )
+		_debugConfig.Layout="fill-x"
+		_releaseConfig=New CheckButton( "Release",,group )
+		_releaseConfig.Layout="fill-x"
+		_debugConfig.Clicked+=Lambda()
+			_buildConfig="debug"
+		End
+		_releaseConfig.Clicked+=Lambda()
+			_buildConfig="release"
+		End
+		_buildConfig="debug"
+
+		group=New CheckGroup
+
+		_desktopTarget=New CheckButton( "Desktop",,group )
+		_desktopTarget.Layout="fill-x"
+		
+		_emscriptenTarget=New CheckButton( "Emscripten",,group )
+		_emscriptenTarget.Layout="fill-x"
+		
+		_wasmTarget=New CheckButton( "Wasm",,group )
+		_wasmTarget.Layout="fill-x"
+		
+		_androidTarget=New CheckButton( "Android",,group )
+		_androidTarget.Layout="fill-x"
+		
+		_iosTarget=New CheckButton( "iOS",,group )
+		_iosTarget.Layout="fill-x"
+		
+		targetMenu=New Menu( "Build target..." )
+		targetMenu.AddView( _debugConfig )
+		targetMenu.AddView( _releaseConfig )
+		targetMenu.AddSeparator()
+		targetMenu.AddView( _desktopTarget )
+		targetMenu.AddView( _emscriptenTarget )
+		targetMenu.AddView( _wasmTarget )
+		targetMenu.AddView( _androidTarget )
+		targetMenu.AddView( _iosTarget )
+		targetMenu.AddSeparator()
+		targetMenu.AddAction( buildSettings )
+		
+		'check valid targets...WIP...
+		
+		_validTargets=EnumValidTargets( _console )
+		
+		If _validTargets _buildTarget=_validTargets[0].ToLower()
+		
+		If _validTargets.Contains( "desktop" )
+			_desktopTarget.Clicked+=Lambda()
+				_buildTarget="desktop"
+			End
+		Else
+			_desktopTarget.Enabled=False
+		Endif
+		
+		If _validTargets.Contains( "emscripten" )
+			_emscriptenTarget.Clicked+=Lambda()
+				_buildTarget="emscripten"
+			End
+		Else
+			_emscriptenTarget.Enabled=False
+		Endif
+
+		If _validTargets.Contains( "wasm" )
+			_wasmTarget.Clicked+=Lambda()
+				_buildTarget="wasm"
+			End
+		Else
+			_wasmTarget.Enabled=False
+		Endif
+
+		If _validTargets.Contains( "android" )
+			_androidTarget.Clicked+=Lambda()
+				_buildTarget="android"
+			End
+		Else
+			_androidTarget.Enabled=False
+		Endif
+
+		If _validTargets.Contains( "ios" )
+			_iosTarget.Clicked+=Lambda()
+				_buildTarget="ios"
+			End
+		Else
+			_iosTarget.Enabled=False
+		Endif
+	End
+	
+	Property LockedDocument:CodeDocument()
+	
+		Return _locked
+	End
+	
+	Method SaveState( jobj:JsonObject )
+		
+		If _locked jobj["lockedDocument"]=New JsonString( _locked.Path )
+		
+		jobj["buildConfig"]=New JsonString( _buildConfig )
+		
+		jobj["buildTarget"]=New JsonString( _buildTarget )
+	End
+		
+	Method LoadState( jobj:JsonObject )
+	
+		If jobj.Contains( "lockedDocument" )
+			Local path:=jobj["lockedDocument"].ToString()
+			_locked=Cast<CodeDocument>( _docs.FindDocument( path ) )
+			If _locked _locked.State="+"
+		Endif
+		
+		If jobj.Contains( "buildConfig" )
+			_buildConfig=jobj["buildConfig"].ToString()
+			Select _buildConfig
+			Case "release"
+				_releaseConfig.Checked=True
+			Default
+				_debugConfig.Checked=True
+				_buildConfig="debug"
+			End
+		Endif
+		
+		If jobj.Contains( "buildTarget" )
+					
+			local target:=jobj["buildTarget"].ToString()
+
+			If _validTargets.Contains( target )
+			
+				 _buildTarget=target
+				
+				Select _buildTarget
+				Case "desktop"
+					_desktopTarget.Checked=True
+				Case "emscripten"
+					_emscriptenTarget.Checked=True
+				Case "wasm"
+					_wasmTarget.Checked=True
+				Case "android"
+					_androidTarget.Checked=True
+				Case "ios"
+					_iosTarget.Checked=True
+				End
+			
+			Endif
+			
+		Endif
+		
+	End
+	
+	Method Update()
+	
+		While Not _errors.Empty And _errors.First.removed
+			_errors.RemoveFirst()
+		Wend
+	
+		Local idle:=Not _console.Running
+		Local canbuild:=idle And BuildDoc()<>Null And _buildTarget
+		
+		build.Enabled=canbuild
+		buildAndRun.Enabled=canbuild
+		nextError.Enabled=Not _errors.Empty
+		updateModules.Enabled=idle
+		rebuildModules.Enabled=idle
+		rebuildHelp.Enabled=idle
+		moduleManager.Enabled=idle
+	End
+
+	Private
+	
+	Field _docs:DocumentManager
+	Field _console:Console
+	Field _debugView:DebugView
+	
+	Field _locked:CodeDocument
+	
+	Field _errors:=New List<BuildError>
+	
+	Field _buildConfig:String
+	Field _buildTarget:String
+	
+	Field _debugConfig:CheckButton
+	Field _releaseConfig:CheckButton
+	Field _desktopTarget:CheckButton
+	Field _emscriptenTarget:CheckButton
+	Field _wasmTarget:CheckButton
+	Field _androidTarget:CheckButton
+	Field _iosTarget:CheckButton
+	
+	Field _validTargets:StringStack
+	
+	Method BuildDoc:CodeDocument()
+		
+		If Not _locked Return Cast<CodeDocument>( _docs.CurrentDocument )
+		
+		Return _locked
+	End
+	
+	Method SaveAll:Bool()
+	
+		For Local doc:=Eachin _docs.OpenDocuments
+			If Not doc.Save() Return False
+		Next
+		
+		Return True
+	End
+	
+	Method ClearErrors()
+	
+		_errors.Clear()
+	
+		For Local doc:=Eachin _docs.OpenDocuments
+			Local mx2Doc:=Cast<CodeDocument>( doc )
+			If mx2Doc mx2Doc.Errors.Clear()
+		Next
+
+	End
+
+	Method GotoError( err:BuildError )
+	
+		Local doc:=Cast<CodeDocument>( _docs.OpenDocument( err.path,True ) )
+		If Not doc Return
+		
+		Local tv := doc.TextView
+		If Not tv Return
+		
+		MainWindow.UpdateWindow( False )
+		
+		tv.GotoLine( err.line )
+	End
+	
+	Method BuildMx2:Bool( cmd:String,progressText:String,run:Bool=True )
+	
+		ClearErrors()
+		
+		_console.Clear()
+		
+		MainWindow.ShowBuildConsole( False )
+		
+		If Not SaveAll() Return False
+
+		If Not _console.Start( cmd )
+			Alert( "Failed to start process: '"+cmd+"'" )
+			Return False
+		Endif
+		
+		Local title := run ? "Building" Else "Checking"
+		'Local progress:=New ProgressDialog( title,progressText )
+		
+		'progress.MinSize=New Vec2i( 320,0 )
+		
+		'Local cancel:=progress.AddAction( "Cancel" )
+		
+		'cancel.Triggered=Lambda()
+		'	_console.Terminate()
+		'End
+		
+		'progress.Open()
+		
+		Local s:=progressText
+		If Not s.EndsWith( "..." ) Then s+="..."
+		
+		MainWindow.ShowStatusBarText( s )
+		MainWindow.ShowStatusBarProgress( _console.Terminate )
+		
+		Local hasErrors:=False
+		
+		Repeat
+		
+			Local stdout:=_console.ReadStdout()
+			If Not stdout Exit
+			
+			If stdout.StartsWith( "Application built:" )
+
+'				_appFile=stdout.Slice( stdout.Find( ":" )+1 ).Trim()
+			Else
+			
+				Local i:=stdout.Find( "] : Error : " )
+				If i<>-1
+					hasErrors=True
+					Local j:=stdout.Find( " [" )
+					If j<>-1
+						Local path:=stdout.Slice( 0,j )
+						Local line:=Int( stdout.Slice( j+2,i ) )-1
+						Local msg:=stdout.Slice( i+12 )
+						
+						Local err:=New BuildError( path,line,msg )
+						Local doc:=Cast<CodeDocument>( _docs.OpenDocument( path,False ) )
+						
+						If doc
+							doc.AddError( err )
+							If _errors.Empty 
+								MainWindow.ShowBuildConsole( True )
+								GotoError( err )
+							Endif
+							_errors.Add( err )
+						Endif
+						
+					Endif
+				Endif
+				If Not hasErrors
+					i=stdout.Find( "Build error: " )
+					hasErrors=(i<>-1)
+				Endif
+				
+			Endif
+						
+			_console.Write( stdout )
+		
+		Forever
+		
+		'progress.Close()
+		MainWindow.HideStatusBarProgress()
+		
+		Local status:=hasErrors ? "Process failed. See the build console for details." Else (_console.ExitCode=0 ? "Process finished." Else "Process cancelled.")
+		MainWindow.ShowStatusBarText( status )
+		
+		Return _console.ExitCode=0
+	End
+
+	Method BuildModules:Bool( clean:Bool,target:String )
+	
+		Local msg:=(clean ? "Rebuilding " Else "Updating ")+target
+		
+		For Local config:=0 Until 2
+		
+			Local cfg:=(config ? "debug" Else "release")
+			
+			Local cmd:=MainWindow.Mx2ccPath+" makemods -target="+target
+			If clean cmd+=" -clean"
+			cmd+=" -config="+cfg
+			
+			If Not BuildMx2( cmd,msg+" "+cfg+" modules..." ) Return False
+		Next
+		
+		Return True
+	End
+	
+	Method BuildModules:Bool( clean:Bool )
+	
+		Local targets:=New StringStack
+		
+		For Local target:=Eachin _validTargets
+			targets.Push( target="ios" ? "iOS" Else target.Capitalize() )
+		Next
+
+		targets.Push( "All!" )
+		targets.Push( "Cancel" )
+		
+		Local i:=TextDialog.Run( "Build Modules","Select target..",targets.ToArray(),0,targets.Length-1 )
+		
+		Local result:=True
+		
+		Select i
+		Case targets.Length-1	'Cancel
+			Return False
+		Case targets.Length-2	'All!
+			For Local i:=0 Until targets.Length-2
+				If BuildModules( clean,targets[i] ) Continue
+				result=False
+				Exit
+			Next
+		Default
+			result=BuildModules( clean,targets[i] )
+		End
+		
+		If result
+			_console.Write( "~nBuild modules completed successfully!~n" )
+		Else
+			_console.Write( "~nBuild modules failed.~n" )
+		Endif
+		
+		Return result
+	End
+	
+	Method MakeDocs:Bool()
+	
+		Return BuildMx2( MainWindow.Mx2ccPath+" makedocs","Rebuilding documentation..." )
+	End
+	
+	Method BuildApp:Bool( config:String,target:String,action:String )
+	
+		Local buildDoc:=BuildDoc()
+		If Not buildDoc Return False
+		
+		Local product:=BuildProduct.GetBuildProduct( buildDoc.Path,target,False )
+		If Not product Return False
+		
+		Local opts:=product.GetMx2ccOpts()
+		
+		Local run:=(action="run")
+		If run action="build"
+
+		Local cmd:=MainWindow.Mx2ccPath+" makeapp -"+action+" "+opts
+		cmd+=" -config="+config
+		cmd+=" -target="+target
+		cmd+=" ~q"+buildDoc.Path+"~q"
+		
+		Local title := action="build" ? "Building" Else "Checking"
+		Local msg:=title+" ~ "+target+" ~ "+config+" ~ "+StripDir( buildDoc.Path )
+		
+		If Not BuildMx2( cmd,msg,run ) Return False
+		
+		_console.Write("~nDone.")
+		
+		If Not run Return True
+		
+		Local exeFile:=product.GetExecutable()
+		If Not exeFile Return True
+		
+		Select target
+		Case "desktop"
+
+			_debugView.DebugApp( exeFile,config )
+
+		Case "emscripten","wasm"
+		
+			Local mserver:=GetEnv( "MX2_MSERVER" )
+			If mserver _console.Run( mserver+" ~q"+exeFile+"~q" )
+		
+		End
+		
+		Return True
+	End
+	
+	Method OnBuildAndRun()
+		
+		PreBuild()
+		
+		If _console.Running Return
+	
+		BuildApp( _buildConfig,_buildTarget,"run" )
+	End
+	
+	Method OnBuild()
+		
+		PreBuild()
+		
+		If _console.Running Return
+	
+		BuildApp( _buildConfig,_buildTarget,"build" )
+	End
+	
+	Method OnSemant()
+	
+		If _console.Running Return
+	
+		BuildApp( _buildConfig,_buildTarget,"semant" )
+	End
+	
+	Method OnNextError()
+	
+		While Not _errors.Empty And _errors.First.removed
+			_errors.RemoveFirst()
+		Wend
+		
+		If _errors.Empty Return
+		
+		_errors.AddLast( _errors.RemoveFirst() )
+			
+		GotoError( _errors.First )
+	End
+	
+	Method OnLockBuildFile()
+	
+		Local doc:=Cast<CodeDocument>( _docs.CurrentDocument )
+		If Not doc Return
+		
+		If _locked _locked.State=""
+		
+		If doc=_locked
+			_locked=Null
+			Return
+		Endif
+		
+		_locked=doc
+		_locked.State="+"
+		
+	End
+	
+	Method OnBuildFileSettings()
+
+		Local buildDoc:=BuildDoc()
+		If Not buildDoc Return
+		
+		local product:=BuildProduct.GetBuildProduct( buildDoc.Path,_buildTarget,True )
+	End
+	
+	Method OnUpdateModules()
+	
+		If _console.Running Return
+	
+		BuildModules( False )
+	End
+	
+	Method OnRebuildModules()
+	
+		If _console.Running Return
+	
+		BuildModules( True )
+	End
+	
+	Method OnModuleManager()
+	
+		If _console.Running Return
+	
+		Local modman:=New ModuleManager( _console )
+		
+		modman.Open()
+	End
+	
+	Method OnRebuildHelp()
+	
+		If _console.Running Return
+	
+		MakeDocs()
+		
+		MainWindow.UpdateHelpTree()
+	End
+	
+End

+ 155 - 0
actions/editactions.monkey2

@@ -0,0 +1,155 @@
+
+Namespace ted2go
+
+
+Class EditActions
+
+	Field undo:Action
+	Field redo:Action
+	Field cut:Action
+	Field copy:Action
+	Field paste:Action
+	Field selectAll:Action
+	Field wordWrap:Action
+	Field gotoLine:Action
+	Field gotoDeclaration:Action
+	
+	Method New( docs:DocumentManager )
+	
+		_docs=docs
+		
+		undo=New Action( "Undo" )
+		undo.Triggered=OnUndo
+		undo.HotKey=Key.Z
+		undo.HotKeyModifiers=Modifier.Menu|Modifier.Ignore
+
+		redo=New Action( "Redo" )
+		redo.Triggered=OnRedo
+#If __TARGET__="macos"
+		redo.HotKey=Key.Z
+		redo.HotKeyModifiers=Modifier.Menu|Modifier.Ignore|Modifier.Shift
+#Else
+		redo.HotKey=Key.Y
+		redo.HotKeyModifiers=Modifier.Menu|Modifier.Ignore
+#Endif
+		
+		cut=New Action( "Cut" )
+		cut.Triggered=OnCut
+		cut.HotKey=Key.X
+		cut.HotKeyModifiers=Modifier.Menu|Modifier.Ignore
+
+		copy=New Action( "Copy" )
+		copy.Triggered=OnCopy
+		copy.HotKey=Key.C
+		copy.HotKeyModifiers=Modifier.Menu|Modifier.Ignore
+
+		paste=New Action( "Paste" )
+		paste.Triggered=OnPaste
+		paste.HotKey=Key.V
+		paste.HotKeyModifiers=Modifier.Menu|Modifier.Ignore
+
+		selectAll=New Action( "Select all" )
+		selectAll.Triggered=OnSelectAll
+		selectAll.HotKey=Key.A
+		selectAll.HotKeyModifiers=Modifier.Menu|Modifier.Ignore
+		
+		wordWrap=New Action( "Toggle word wrap" )
+		wordWrap.Triggered=OnWordWrap
+		wordWrap.HotKey=Key.Z
+		wordWrap.HotKeyModifiers=Modifier.Alt
+		
+		gotoLine=New Action( "Goto line" )
+		gotoLine.Triggered=OnGotoLine
+		gotoLine.HotKey=Key.G
+		gotoLine.HotKeyModifiers=Modifier.Menu
+		
+		gotoDeclaration=New Action( "Goto declaration" )
+		gotoDeclaration.Triggered=OnGotoDeclaration
+		gotoDeclaration.HotKey=Key.F12
+		
+	End
+	
+	Method Update()
+	
+		Local tv:=Cast<TextView>( App.KeyView )
+		
+		undo.Enabled=tv And tv.CanUndo
+		redo.Enabled=tv And tv.CanRedo
+		cut.Enabled=tv And tv.CanCut
+		copy.Enabled=tv And tv.CanCopy
+		paste.Enabled=tv And tv.CanPaste
+		selectAll.Enabled=tv
+	End
+	
+	Private
+	
+	Field _docs:DocumentManager
+	
+	Method OnUndo()
+
+		Local tv:=Cast<TextView>( App.KeyView )
+		
+		If tv tv.Undo()
+	End
+	
+	Method OnRedo()
+	
+		Local tv:=Cast<TextView>( App.KeyView )
+		
+		If tv tv.Redo()
+	End
+	
+	Method OnCut()
+	
+		Local tv:=Cast<TextView>( App.KeyView )
+		
+		If tv tv.Cut()
+	End
+
+	Method OnCopy()
+
+		Local tv:=Cast<TextView>( App.KeyView )
+		
+		If tv tv.Copy()
+	End
+
+	Method OnPaste()		
+		
+		Local tv:=Cast<TextView>( App.KeyView )
+		
+		If tv tv.Paste()
+	End
+	
+	Method OnSelectAll()
+		
+		Local tv:=Cast<TextView>( App.KeyView )
+		
+		If tv tv.SelectAll()
+	End
+	
+	Method OnWordWrap()
+	
+		Local tv:=Cast<TextView>( App.KeyView )
+		
+		If tv tv.WordWrap=Not tv.WordWrap
+	End
+	
+	Method OnGotoLine()
+	
+		Local tv:=Cast<TextView>( App.KeyView )
+		If Not tv Return
+		
+		Local line:=RequestInt( "Goto line:","Goto line",tv.CursorLine+1,0,1,tv.Document.NumLines )
+		If Not line Return
+		
+		tv.GotoLine( line-1 )
+		
+		tv.MakeKeyView()
+	End
+
+	Method OnGotoDeclaration()
+	
+		MainWindow.GotoDeclaration()
+	End
+	
+End

+ 351 - 0
actions/fileactions.monkey2

@@ -0,0 +1,351 @@
+
+Namespace ted2go
+
+
+Class FileActions
+
+	Field new_:Action
+	Field open:Action
+	Field close:Action
+	Field closeOthers:Action
+	Field closeToRight:Action
+	Field closeAll:Action
+	Field save:Action
+	Field saveAs:Action
+	Field saveAll:Action
+	Field quit:Action
+	Field prefs:Action
+	
+	Method New( docs:DocumentManager )
+	
+		_docs=docs
+		
+		new_=New Action( "New" )
+#if __TARGET__="macos"
+		new_.HotKey=Key.N
+		new_.HotKeyModifiers=Modifier.Menu
+#else
+		new_.HotKey=Key.N
+		new_.HotKeyModifiers=Modifier.Menu
+#endif
+		new_.Triggered=OnNew
+		
+		open=New Action( "Open" )
+		open.HotKey=Key.O
+		open.HotKeyModifiers=Modifier.Menu
+		open.Triggered=OnOpen
+		
+		close=New Action( "Close tab" )
+		close.HotKey=Key.W
+		close.HotKeyModifiers=Modifier.Menu
+		close.Triggered=OnClose
+		
+		closeOthers=New Action( "Close other tabs" )
+		closeOthers.Triggered=OnCloseOthers
+		
+		closeToRight=New Action( "Close tabs to the right" )
+		closeToRight.Triggered=OnCloseToRight
+		
+		closeAll=New Action( "Close all tabs" )
+		closeAll.Triggered=OnCloseAll
+		
+		save=New Action( "Save" )
+		save.HotKey=Key.S
+		save.HotKeyModifiers=Modifier.Menu
+		save.Triggered=OnSave
+
+		saveAs=New Action( "Save as..." )
+		saveAs.Triggered=OnSaveAs
+
+		saveAll=New Action( "Save all" )
+		saveAll.HotKey=Key.S
+		saveAll.HotKeyModifiers=Modifier.Menu|Modifier.Shift
+		saveAll.Triggered=OnSaveAll
+		
+		quit=New Action( "Quit" )
+		quit.Triggered=OnQuit
+		
+#If __TARGET__="windows"
+		quit.HotKey=Key.F4
+		quit.HotKeyModifiers=Modifier.Alt|Modifier.Ignore
+#Elseif __TARGET__="macos"
+		quit.HotKey=Key.Q
+		quit.HotKeyModifiers=Modifier.Menu|Modifier.Ignore
+#Elseif __TARGET__="linux"
+		quit.HotKey=Key.F4
+		quit.HotKeyModifiers=Modifier.Alt|Modifier.Ignore
+#endif		
+
+		prefs=New Action( "Preferences..." )
+		prefs.Triggered=OnPrefs
+#if __TARGET__="macos"
+		prefs.HotKey=Key.Comma
+#Else
+		prefs.HotKey=Key.P
+#Endif
+		prefs.HotKeyModifiers=Modifier.Menu
+		
+	End
+	
+	Method Update()
+	
+		Local docs:=_docs.OpenDocuments
+
+		Local n:=0
+		Local anyDirty:Bool
+		For Local doc:=Eachin docs
+			If doc.Dirty anyDirty=True
+			n+=1
+		Next
+	
+		Local doc:=_docs.CurrentDocument
+
+		close.Enabled=doc
+		closeOthers.Enabled=n>1
+		closeToRight.Enabled=doc And doc<>docs[docs.Length-1]
+		closeAll.Enabled=n>0
+		save.Enabled=doc And (doc.Dirty Or MainWindow.IsTmpPath( doc.Path ))
+		saveAs.Enabled=doc
+		saveAll.Enabled=anyDirty
+	End
+	
+	
+	Private
+	
+	Field _docs:DocumentManager
+	Field _saveAllFlag:Bool,_discardAllFlag:Bool
+	Field _quit:Bool
+	
+	
+	Method SaveAs:Ted2Document()
+	
+		Local doc:=_docs.CurrentDocument
+		If Not doc Return Null
+		
+		Local path:=MainWindow.RequestFile( "Save As","",True )
+		If Not path Return Null
+				
+		If Not ExtractExt( path ) path+=ExtractExt( doc.Path )
+		
+		Return _docs.RenameDocument( doc,path )
+	End
+
+	Method CanClose:Ted2Document( doc:Ted2Document,manyFiles:Bool=False )
+	
+		If Not doc.Dirty Return doc
+		
+		'_docs.CurrentDocument=doc
+				
+		Local buttons:String[]
+		If manyFiles
+			buttons=New String[]( "Save","Save All","Discard","Discard All","Cancel" )
+		Else
+			buttons=New String[]( "Save","Discard","Cancel" )
+		Endif
+			
+		Local result:=-1
+		If manyFiles
+			If _saveAllFlag
+				result=1
+			Elseif _discardAllFlag
+				result=3
+			Endif
+		Endif
+		If result = -1 Then result=TextDialog.Run( "Close File","File '"+doc.Path+"' has been modified.",buttons )
+		
+		Select result
+		Case 0 'save
+			If MainWindow.IsTmpPath( doc.Path )
+				Return SaveAs()
+			Else
+				If Not doc.Save() Return Null
+			Endif
+		Case 1 'saveAll or discard
+			If manyFiles
+				If MainWindow.IsTmpPath( doc.Path )
+					Return SaveAs()
+				Else
+					If Not doc.Save() Return Null
+				Endif
+				_saveAllFlag=True
+			Endif
+		Case 2 'discard or cancel
+			Return manyFiles ? doc Else Null
+		Case 3 'discardAll
+			_discardAllFlag=True
+		Case 4 'cancel
+			Return Null
+		End
+		
+		Return doc
+	End
+	
+	Method OnNew()
+	
+		Local path:=MainWindow.AllocTmpPath( "untitled",".monkey2" )
+		If Not path
+			Alert( "Can't allocate temporary file" )
+			Return
+		Endif
+
+		SaveString( "",path )
+		
+		_docs.OpenDocument( path,True )
+	End
+		
+	Method OnOpen()
+	
+		Local path:=MainWindow.RequestFile( "Open File","",False )
+		If Not path Return
+		
+		path=RealPath( path )
+		
+		_docs.OpenDocument( path,True )
+	End
+	
+	Method OnClose()
+	
+		Local doc:=_docs.CurrentDocument
+		If Not doc Return
+		
+		doc=CanClose( doc )
+		If Not doc return
+		
+		doc.Close()
+	End
+	
+	Method OnCloseOthers()
+	
+		Local current:=_docs.CurrentDocument
+		If Not current Return
+	
+		_saveAllFlag=False
+		_discardAllFlag=False
+		
+		Local docs:=_docs.OpenDocuments
+		
+		For Local doc:=Eachin docs
+			If doc<>current And Not CanClose( doc,True ) Return
+		Next
+		
+		For Local doc:=Eachin docs
+			If doc<>current doc.Close()
+		Next
+	End
+	
+	Method OnCloseToRight()
+	
+		Local current:=_docs.CurrentDocument
+		If Not current Return
+	
+		_saveAllFlag=False
+		_discardAllFlag=False
+		
+		Local docs:=_docs.OpenDocuments
+		
+		Local close:=False
+		For Local doc:=Eachin docs
+			If close
+				If Not CanClose( doc,True ) Return
+			Else
+				If doc=current close=True
+			Endif
+		Next
+		
+		close=False
+		For Local doc:=Eachin docs
+			If close
+				doc.Close()
+			Else
+				If doc=current close=True
+			Endif
+		Next
+		
+	End
+	
+	Method OnCloseAll()
+
+		_saveAllFlag=False
+		_discardAllFlag=False
+		
+		Local docs:=_docs.OpenDocuments
+		
+		For Local doc:=Eachin docs
+			If Not CanClose( doc,True ) Return
+		Next
+		
+		For Local doc:=Eachin docs
+			doc.Close()
+		Next
+		
+	End
+	
+	Method OnSave()
+	
+		Local doc:=_docs.CurrentDocument
+		If Not doc Return
+		
+		If MainWindow.IsTmpPath( doc.Path )
+			SaveAs()
+		Else
+			doc.Save()
+		Endif
+	End
+	
+	Method OnSaveAs()
+	
+		SaveAs()
+	End
+	
+	Method OnSaveAll()
+	
+		For Local doc:=Eachin _docs.OpenDocuments
+
+			If MainWindow.IsTmpPath( doc.Path )
+				_docs.CurrentDocument=doc
+				If Not SaveAs() Return
+			Else
+				doc.Save()
+			Endif
+		Next
+	End
+	
+	Method OnQuit()
+		
+		If _quit Return
+		_quit=True
+		
+		_saveAllFlag=False
+		_discardAllFlag=False
+		
+		For Local doc:=Eachin _docs.OpenDocuments
+		
+			If MainWindow.IsTmpPath( doc.Path )
+				If Not doc.Save() Then _quit=False ; Return
+			Else
+				If Not CanClose( doc,True ) Then _quit=False ; Return
+			Endif
+		Next
+		
+		MainWindow.Terminate()
+	End
+	
+	Field _prefsDialog:PrefsDialog
+	
+	Method OnPrefs()
+	
+		If Not _prefsDialog
+			_prefsDialog=New PrefsDialog
+			
+			_prefsDialog.Apply+=Lambda()
+			
+				For Local d:=Eachin _docs.OpenDocuments
+					Local tv:=Cast<CodeTextView>( d.TextView )
+					If tv Then tv.ShowWhiteSpaces=Prefs.EditorShowWhiteSpaces
+				Next
+			End
+		Endif
+		_prefsDialog.Show()
+	End
+	
+End

+ 310 - 0
actions/findactions.monkey2

@@ -0,0 +1,310 @@
+
+Namespace ted2go
+
+
+Class FindActions
+
+	Field find:Action
+	Field findNext:Action
+	field findPrevious:Action
+	Field replace:Action
+	Field replaceAll:Action
+	Field findInFiles:Action
+	Field findAllInFiles:Action
+	
+	Method New( docs:DocumentManager,projView:ProjectView,findConsole:TreeViewExt )
+		
+		_docs=docs
+		_findConsole=findConsole
+		
+		find=New Action( "Find / Replace" )
+		find.Triggered=OnFind
+		find.HotKey=Key.F
+		find.HotKeyModifiers=Modifier.Menu
+		
+		findNext=New Action( "Find next" )
+		findNext.Triggered=OnFindNext
+		findNext.HotKey=Key.F3
+		
+		findPrevious=New Action( "Find previous" )
+		findPrevious.Triggered=OnFindPrevious
+		findPrevious.HotKey=Key.F3
+		findPrevious.HotKeyModifiers=Modifier.Shift
+		
+		replace=New Action( "Replace" )
+		replace.Triggered=OnReplace
+		
+		replaceAll=New Action( "Replace all" )
+		replaceAll.Triggered=OnReplaceAll
+		
+		findInFiles=New Action( "Find in files..." )
+		findInFiles.Triggered=OnFindInFiles
+		findInFiles.HotKey=Key.F
+		findInFiles.HotKeyModifiers=Modifier.Menu|Modifier.Shift
+		
+		findAllInFiles=New Action( "Find all" )
+		findAllInFiles.Triggered=OnFindAllInFiles
+		
+		_findDialog=New FindDialog( Self )
+		_findInFilesDialog=New FindInFilesDialog( Self,projView )
+	End
+	
+	Method Update()
+	
+		Local tv:=_docs.CurrentTextView
+		findNext.Enabled=tv
+		findPrevious.Enabled=tv
+		replace.Enabled=tv
+		replaceAll.Enabled=tv
+	End
+	
+	Private
+	
+	Field _docs:DocumentManager
+	
+	Field _findDialog:FindDialog
+	Field _findInFilesDialog:FindInFilesDialog
+	Field _findConsole:TreeViewExt
+	
+	
+	Method OnFind()
+		
+		_findDialog.Show()
+		
+		Local tv:=_docs.CurrentTextView
+		If tv <> Null
+			If tv.Cursor <> tv.Anchor
+				Local min:=Min( tv.Cursor,tv.Anchor )
+				Local max:=Max( tv.Cursor,tv.Anchor )
+				Local s:=tv.Text.Slice( min,max )
+				_findDialog.SetInitialText( s )
+			Endif
+		Endif
+	End
+	
+	Method OnFindInFiles()
+	
+		_findInFilesDialog.Show()
+	
+		Local tv:=_docs.CurrentTextView
+		If tv <> Null
+			If tv.Cursor <> tv.Anchor
+				Local min:=Min( tv.Cursor,tv.Anchor )
+				Local max:=Max( tv.Cursor,tv.Anchor )
+				Local s:=tv.Text.Slice( min,max )
+				_findInFilesDialog.SetInitialText( s )
+			Endif
+		Endif
+	End
+	
+	Method OnFindNext()
+	
+		Local tv:=_docs.CurrentTextView
+		If Not tv Return
+		
+		Local text:=_findDialog.FindText
+		If Not text Return
+		
+		Local tvtext:=tv.Text
+		Local cursor:=Max( tv.Anchor,tv.Cursor )
+		
+		If Not _findDialog.CaseSensitive
+			tvtext=tvtext.ToLower()
+			text=text.ToLower()
+		Endif
+		
+		Local i:=tvtext.Find( text,cursor )
+		If i=-1
+			i=tvtext.Find( text )
+			If i=-1 Return
+		Endif
+		
+		tv.SelectText( i,i+text.Length )
+	End
+	
+	Method OnFindAllInFiles()
+	
+		If Not _findInFilesDialog.FindText Return
+		
+		If Not _findInFilesDialog.SelectedProject Return
+		
+		_findInFilesDialog.Hide()
+		MainWindow.ShowFindResults()
+		
+		New Fiber( Lambda()
+		
+			Local what:=_findInFilesDialog.FindText
+			If Not what Return
+			
+			Local proj:=_findInFilesDialog.SelectedProject
+			If Not proj Return
+			
+			Local filter:=_findInFilesDialog.FilterText
+			If Not filter Then filter="monkey2"
+			
+			Local exts:=filter.Split( "," )
+			
+			proj+="/"
+			
+			Local sens:=_findInFilesDialog.CaseSensitive
+			
+			If Not sens Then what=what.ToLower()
+			
+			Local files:=New Stack<String>
+			Utils.GetAllFiles( proj,exts,files )
+			
+			Local root:=_findConsole.RootNode
+			root.RemoveAllChildren()
+			
+			root.Text="Finding of '"+what+"'"
+						
+			Local subRoot:TreeView.Node
+			Local items:=New Stack<FileJumpData>
+			Local len:=what.Length
+			
+			Local doc:=New TextDocument 'use it to get line number
+			For Local f:=Eachin files
+				
+				Local text:=LoadString( f )
+				
+				If Not sens Then text=text.ToLower()
+				text=text.Replace( "~r~n","~n" )
+				text=text.Replace( "~r","~n" )
+				
+				doc.Text=text
+				
+				Local i:=0
+				items.Clear()
+				
+				Repeat
+					i=text.Find( what,i )
+					If i=-1 Exit
+					
+					Local data:=New FileJumpData
+					data.path=f
+					data.pos=i
+					data.len=len
+					data.line=doc.FindLine( i )+1
+					
+					items.Add( data )
+					
+					i+=len
+				Forever
+				
+				If Not items.Empty
+
+					subRoot=New TreeView.Node( f.Replace( proj,"" )+" ("+items.Length+")",root )
+					
+					For Local d:=Eachin items
+						Local node:=New NodeWithData<FileJumpData>( " at line "+d.line,subRoot )
+						node.data=d
+					Next
+					
+				Endif
+			Next
+			
+			If root.NumChildren=0 Then New TreeView.Node( "not found :(",root )
+			
+			root.Expanded=True
+			
+		End)
+		
+	End
+	
+	Method OnFindPrevious()
+	
+		Local tv:=_docs.CurrentTextView
+		If Not tv Return
+
+		Local text:=_findDialog.FindText
+		If Not text Return
+
+		Local tvtext:=tv.Text
+		Local cursor:=Min( tv.Anchor,tv.Cursor )
+		
+		If Not _findDialog.CaseSensitive
+			tvtext=tvtext.ToLower()
+			text=text.ToLower()
+		Endif
+		
+		Local i:=tvtext.Find( text )
+		If i=-1 Return
+		
+		If i>=cursor
+			i=tvtext.FindLast( text )
+		Else
+			Repeat
+				Local n:=tvtext.Find( text,i+text.Length )
+				If n>=cursor Exit
+				i=n
+			Forever
+		End
+		
+		tv.SelectText( i,i+text.Length )
+	End
+	
+	Method OnReplace()
+	
+		Local tv:=_docs.CurrentTextView
+		If Not tv Return
+		
+		Local text:=_findDialog.FindText
+		If Not text Return
+		
+		Local min:=Min( tv.Anchor,tv.Cursor )
+		Local max:=Max( tv.Anchor,tv.Cursor )
+		
+		Local tvtext:=tv.Text.Slice( min,max )
+
+		If Not _findDialog.CaseSensitive
+			tvtext=tvtext.ToLower()
+			text=text.ToLower()
+		Endif
+		
+		If tvtext<>text Return
+		
+		tv.ReplaceText( _findDialog.ReplaceText )
+		
+		OnFindNext()
+
+	End
+	
+	Method OnReplaceAll()
+	
+		Local tv:=_docs.CurrentTextView
+		If Not tv Return
+		
+		Local text:=_findDialog.FindText
+		If Not text Return
+		
+		Local rtext:=_findDialog.ReplaceText
+		
+		Local tvtext:=tv.Text
+
+		If Not _findDialog.CaseSensitive
+			tvtext=tvtext.ToLower()
+			text=text.ToLower()
+		Endif
+		
+		Local anchor:=tv.Anchor
+		Local cursor:=tv.Cursor
+		
+		Local i:=0,t:=0
+		Repeat
+		
+			i=tvtext.Find( text,i )
+			If i=-1 Exit
+			
+			tv.SelectText( i+t,i+text.Length+t )
+			tv.ReplaceText( rtext )
+			
+			t+=rtext.Length-text.Length
+			i+=text.Length
+			
+		Forever
+		
+		tv.SelectText( anchor,cursor )
+		
+	End
+	
+End

+ 98 - 0
actions/helpactions.monkey2

@@ -0,0 +1,98 @@
+
+Namespace ted2go
+
+
+Class HelpActions
+
+	Field quickHelp:Action
+	Field onlineHelp:Action
+	Field viewManuals:Action
+	Field uploadModules:Action
+	Field about:Action
+	Field aboutTed2go:Action
+	Field makeBetter:Action
+	Field mx2homepage:Action
+	
+
+	Method New()
+	
+		quickHelp=New Action( "Quick help" )
+		quickHelp.Triggered=OnQuickHelp
+		quickHelp.HotKey=Key.F1
+		
+		onlineHelp=New Action( "Online help" )
+		onlineHelp.Triggered=lambda()
+		
+			OpenUrl( "http://monkey2.monkey-x.com/monkey2-docs/" )
+		End
+		
+		viewManuals=New Action( "Browse manuals" )
+		viewManuals.Triggered=Lambda()
+		
+			OpenUrl( RealPath( "docs/index.html" ) )
+		End
+		
+		uploadModules=New Action( "Upload module" )
+		uploadModules.Triggered=Lambda()
+		
+			Alert( "Now taking you to the module manager page at monkey2.monkey-x.com~n~nNote: You must have an account at monkey2.monkey-x.com and be logged in to upload modules" )
+		
+			OpenUrl( RealPath( "http://monkey2.monkey-x.com/module-manager/" ) )
+		End
+
+		about=New Action( "About monkey2" )
+		about.Triggered=Lambda()
+		
+			Local htmlView:=New HtmlView
+			htmlView.Go( "asset::ted2/about.html" )
+	
+			Local dialog:=New Dialog( "About monkey2" )
+			dialog.ContentView=htmlView
+
+			dialog.MinSize=New Vec2i( 640,600 )
+
+			dialog.AddAction( "Okay!" ).Triggered=dialog.Close
+			
+			dialog.Open()
+		End
+
+		aboutTed2go=New Action( "About ted2go" )
+		aboutTed2go.Triggered=Lambda()
+		
+			Local htmlView:=New HtmlView
+			htmlView.Go( "asset::ted2/aboutTed2Go.html" )
+	
+			Local dialog:=New Dialog( "About ted2go" )
+			dialog.ContentView=htmlView
+
+			dialog.MinSize=New Vec2i( 640,600 )
+
+			dialog.AddAction( "Okay!" ).Triggered=dialog.Close
+			
+			dialog.Open()
+		End
+		
+		makeBetter=New Action( "Make this app better! (paypal)" )
+		makeBetter.Triggered=Lambda()
+		
+			OpenUrl( "https://paypal.me/engor/10" )
+		End
+		
+		mx2homepage=New Action( "Monkey2 homepage" )
+		mx2homepage.Triggered=lambda()
+		
+			OpenUrl( "http://monkey2.monkey-x.com/" )
+		End
+	End
+
+	
+	Private
+	
+	Field _docs:DocumentManager
+	
+	Method OnQuickHelp()
+	
+		MainWindow.ShowQuickHelp()
+	End
+	
+End

+ 81 - 0
actions/viewactions.monkey2

@@ -0,0 +1,81 @@
+
+Namespace ted2go
+
+
+Class ViewActions
+	
+	Field goBack:Action
+	Field goForward:Action
+	Field comment:Action
+	Field uncomment:Action
+	
+	Method New( docs:DocumentManager )
+		
+		_docs=docs
+		
+		goBack=New Action( "Go back" )
+		goBack.Triggered=OnGoBack
+		goBack.HotKey=Key.Left
+		goBack.HotKeyModifiers=Modifier.Alt
+		
+		goForward=New Action( "Go forward" )
+		goForward.Triggered=OnGoForward
+		goForward.HotKey=Key.Right
+		goForward.HotKeyModifiers=Modifier.Alt
+		
+		comment=New Action( "Comment block" )
+		comment.Triggered=OnComment
+#If __TARGET__="macos"
+		comment.HotKey=Key.Backslash
+#Else
+		comment.HotKey=Key.Apostrophe
+#Endif
+		comment.HotKeyModifiers=Modifier.Menu
+		
+		uncomment=New Action( "Uncomment block" )
+		uncomment.Triggered=OnUncomment
+#If __TARGET__="macos"
+		uncomment.HotKey=Key.Backslash
+#Else
+		uncomment.HotKey=Key.Apostrophe
+#Endif
+		uncomment.HotKeyModifiers=Modifier.Menu|Modifier.Shift
+	End
+	
+	
+	Private
+	
+	Field _docs:DocumentManager
+	
+	Method OnGoBack()
+		
+		Local doc:=Cast<CodeDocument>( _docs.CurrentDocument )
+		If Not doc Return
+		
+		doc.GoBack()
+	End
+	
+	Method OnGoForward()
+	
+		Local doc:=Cast<CodeDocument>( _docs.CurrentDocument )
+		If Not doc Return
+	
+		doc.GoForward()
+	End
+	
+	Method OnComment()
+	
+		Local doc:=Cast<CodeDocument>( _docs.CurrentDocument )
+		If Not doc Return
+	
+		doc.Comment()
+	End
+	
+	Method OnUncomment()
+	
+		Local doc:=Cast<CodeDocument>( _docs.CurrentDocument )
+		If Not doc Return
+	
+		doc.Uncomment()
+	End
+End

+ 312 - 0
assets/about.html

@@ -0,0 +1,312 @@
+<!doctype html>
+<html>
+<head>
+<style>
+
+body{
+	background: transparent;
+	color: #eee;
+	font-size: 18px;
+	margin: 8px;
+	padding: 0px;
+	line-height:20px;
+}
+
+h1{
+	color: #fc0;
+	font-size: 28px;
+	text-align: center;
+}
+
+h2{
+	color: #fc0;
+	font-size: 24px;
+	text-align: center;
+}
+
+div.awesome{
+	color: #ccc;
+	font-size: 14px;
+}
+
+a{
+	color: #4ef;
+	text-decoration: none;
+	cursor: pointer;
+}
+
+a:hover{
+	color: #0e0;
+}
+
+</style>
+</head>
+
+<body>
+
+<h1>Monkey2 v1.1.02</h1>
+
+<p>Welcome to monkey2, a new, open source, user friendly, multi target programming language by Mark Sibly.
+
+<p>Please post any bug reports or feature requests to the monkey2 github repository: <a href="https://github.com/blitz-research/monkey2">https://github.com/blitz-research/monkey2</a>.
+
+<p>For monkey2 discussion and programming help, feel free to drop by the monkey2 forums: <a href="http://monkey2.monkey-x.com/forums">http://monkey2.monkey-x.com/forums</a>.
+
+<p>Monkey2 is a crowd funded project. If you like what you see, please consider contributing to development either via paypal donation or by becoming a Patreon supporter.
+
+<h2>Building Desktop apps</h2>
+
+<p>If you are reading this in Ted2 on a Windows machine, you should theoretically be able to build desktop apps with no extra hassle.
+
+<p>On Macos, it's a little bit trickier but not much. First, you will need to install xcode from the App Store. Once that's done, go into a shell and enter 'xcode-select --install' to install the 'xcode command line tools'. Note that if you are already using Blitzmax or Monkey1 on a Mac, you may not have to do anything.
+
+<p>On Linux, you will need the standard set of development tools and libs such as g++, mesa-gl, a ton of X stuff etc. Sorry I can't be more specific here, but past attempts to produce a definitive list of 'what you need to code in linux' have proved fruitless - it changes from distro to distro and version to version.
+
+<p>Once you're ready to go, try clicking on the 'hello-world.monkey2' file in the 'Files' browser to the right, and then selecting 'Build and Run' from the 'Build' menu.
+
+<p>This will bring up a little 'Build Settings' dialog. Just click OK to use the defaults and build and run the app. If everything is working properly, a simple 'Hello World' window should appear.
+
+<p>Note that the build settings dialog will only appear automatically the first time you build an app for each target. After that, you can manually
+activate it by selecting 'Build Settings' from the 'Build' menu - not that it does a lot right now!
+
+<p>There are a few more examples in the 'bananas' directory on the right - more coming!
+
+<h2>Building Emscripten apps</h2>
+
+<p>To build emscripten apps, you will first need to install emscripten: 
+
+<p><a href="http://kripken.github.io/emscripten-site">http://kripken.github.io/emscripten-site</a>.
+
+<p>(On MacOS, you may also need to modify your bin/env_macos.txt file to let monkey2 know where emscripten has been installed).
+
+<p>Once emscripten is installed, you will then need to 'rebuild modules' for the emscripten target. This involves selecting 'Rebuild modules' from the 'Build' menu in Ted2, and then selecting 'Emscripten'. This will take a while, as monkey2 needs to rebuild ALL source code used behind the scenes.
+
+<p>Once done, you should be able to build emscripten apps. However, to also actually run them you will need to install the 'mserver' package:
+
+<p><a href="http://www.monkey-x.com/mak/devtools/mserver-v86c.zip">http://www.monkey-x.com/mak/devtools/mserver-v86c.zip</a>.
+
+<p>(On Macos and Linux, you may also need to change file permissions to 'execute').
+
+<p>This needs to be unzipped into your monkey2 'devtools' directory. MServer is actually a mini 'http' server, and is necessary because emscripten apps can't be run directly from the filesystem - they must always be run from a server.
+
+<p>Now, select the 'Emscripten' target from the 'Build Targets' menu and you should be able to build and run emscripten apps.
+
+
+<h2>Building Android apps</h2>
+
+<p>To build android apps, you will first need to install Android Studio:
+
+<p><a href="https://developer.android.com/studio/index.html">https://developer.android.com/studio/index.html</a>.
+
+<p>Once installed, make sure everything's working properly and that you can build and deploy android apps from inside Android studio. The best way to do this is by building and deploying one of the simple 'template' apps in android studio.
+
+<p>Next, install the Android NDK (native development kit) via the SDK Manager->SDK Tools section.
+
+<p>Once android studio and the NDK are installed, you will then need to rebuild modules for android. Once this is done, you should (finally!) be able to build android apps.
+
+<p>Android apps are produced in the form of android studio projects, and can be found in the '.products' directory next to your monkey2 source file.
+
+<p>Note that monkey2 only currently builds for 'armv7' hardware.
+
+
+<h2>Building iOS apps</h2>
+
+<p>Monkey2 iOS apps cannot currently be run on the simulator, so the first thing you will need is a real iOS device plus the necessary 'code signing skills' to be able to actually deploy to it.
+
+<p>Apart from that, all you need to build for iOS is the latest version of xcode. Once you have xcode installed, you will to 'rebuild modules' for iOS after which you should be able to build iOS apps.
+
+<p>iOS apps are produced in the form of xcode projects, and can be found in the '.products' directory next to your monkey2 source file.
+
+<p>Note that monkey2 only currently builds for 'armv7' hardware.
+
+
+<h2>That's all Folks!</h2>
+
+<p>Monkey2 is a crowd funded project. If you like what you see, please consider contributing to development either via paypal donation or by becoming a Patreon supporter.
+
+<p>Finally, a big shout out to everyone who has contributed to Monkey2 to date, including...
+
+<div class="awesome">
+Shane Raffa,
+Danilo,
+Blaine Hodge,
+Lucien Bulles,
+Daniel,
+Martin,
+Tony Smits,
+Peter Rigby,
+Jake Birkett,
+Pharmhaus,
+James Boyd,
+David Maziarka,
+starfruit,
+Stephen	Greener,
+Jonathan Pittock,
+Aaron Woodard,
+Lee Wade,
+abakobo,
+York Burkhardt,
+Rene Damm,
+Capn Lee,
+Jesse M Perez,
+Matthew,
+neuro,
+Paul Apgar,
+Matthew	Camerer,
+Difference,
+Kirsty,
+kmac,
+Richard	Betson,
+Javier,
+Adam,
+Phil7,	
+Erik Thon,
+Noel Cole,
+Ole Jostein Røtne,
+Patrik Strandell,
+Darryl,
+Lars Kristian Gretnes,
+C.E.,
+Roger Lockerbie,
+Philippe Back,
+Bill Stanbrook,
+Hotcakes,
+Christian Leth Jeppesen,
+Makarienkov Vladimir,
+Alan Broad,
+David,
+Christian,
+Leo Santos,
+Pierrou,
+Arthur,
+Richard McLoughlin,
+zui,
+Dennis Rohn,
+Daniele Prandini,
+Hezkore,
+Bill Murray,
+Felipe Alfonso,
+Annika Terrortante,
+Panayiotis Yianni,
+RenK,
+Zachary Cassity,
+Jules Duquette,
+Ian Martin,
+Richard Keam,
+James Freeman,
+Paul Huckstepp,
+Graham,
+Hubert BAYRE,
+Jochen Heizmann,
+Boz	
+Aroldo Carvalho,
+Mattias Hansson,
+Catalin Lucaciu,
+Jochen Heizmann,
+Boz,
+Zachary Cassity,
+Hubert BAYRE,
+Cory Estes,
+Paul Huckstepp,
+Stephen Maden,
+degac,
+sal gunduz,
+Ole Jostein Røtne,
+Alan Rawkins,
+Dennis Rohn,
+Christian,
+Philipp Moeller,
+Roger Lockerbie,
+Pierrou,
+Philippe Back,
+Patrik Strandell,
+Bill Stanbrook,
+Erik Thon,
+Richard Keam,
+James Freeman,
+Danilo,
+Juan Camilo,
+Lars Kristian Gretnes,
+Noel Cole,
+Michael Hartlef,
+Jules Duquette,
+Ian Martin,
+Leigh Bowers,
+Daniele Prandini,
+Alan Broad,
+Christian Leth Jeppesen!,
+Rene Damm,
+Richard McLoughlin,
+Kennie,
+ ussell King,
+gcmartijn,
+Darryl,
+Michael Hauck,
+Graham,
+sal gunduz,
+Danilo,
+Daniele Prandini,
+York Burkhardt,
+Peter Rigby,
+Michael Hartlef,
+Leonardo Teixeira,
+Daniel Murphy,
+Gloomywood,
+Adam,
+Arthur,
+Richard Betson,
+Jake Birkett,
+Simon Harrison,
+Daniel Born,
+David Maziarka,
+starfruit,
+David,
+Markus L,
+Capn Lee,
+Jesus M Perez,
+Hotcakes,
+Amon,
+Blaine Hodge,
+Jeffrey Nofsinger,
+Felipe Alfonso,
+Matthew,
+Robin Columbus,
+Alan Rawkins,
+TeaBoy,
+Brian Kramer,
+Bill Murray,
+neuro,
+degac,
+Javier San Juan Cervera,
+Sander Voorn,
+Makarienkov Vladimir,
+impixi,
+kmac,
+Paul Apgar,
+Shane Woolcock,
+Stephen Greener,
+Tony Smits,
+Lucien Bulles,
+SecondGear,
+Matthew Camerer,
+Jonathan Pittock,
+Annika Terrortante,
+Josh Klint,
+Aaron woodard,
+Lee Wade,
+taumel,
+Arthur Bikmullin,
+Difference,
+Michael Denathorn,
+Jose Faeti,
+Martin Leidel,
+abakobo,
+Kirsty,
+Benjamin Aregger,
+James Boyd,
+Simon Armstrong.
+</div>
+
+</body>
+
+</html>

+ 125 - 0
assets/aboutTed2Go.html

@@ -0,0 +1,125 @@
+<!doctype html>
+<html>
+<head>
+<style>
+
+body{
+	background: transparent;
+	color: #eee;
+	font-size: 18px;
+	margin: 8px;
+	padding: 0px;
+	line-height:20px;
+}
+
+h1{
+	color: #fc0;
+	font-size: 28px;
+	text-align: center;
+}
+
+h2{
+	color: #fc0;
+	font-size: 24px;
+	text-align: center;
+}
+
+div.awesome{
+	color: #ccc;
+	font-size: 14px;
+}
+
+a{
+	color: #4ef;
+	text-decoration: none;
+	cursor: pointer;
+}
+
+a:hover{
+	color: #0e0;
+}
+
+</style>
+</head>
+
+<body>
+
+<h2>Ted2Go is a fork of an official Ted2 IDE.</h2>
+
+<a href="https://github.com/engor/Ted2Go">Sources on Github</a> | <a href="https://trello.com/b/6FHUXCBF/ted2go">Todo on Trello</a> | <a href="http://monkey2.monkey-x.com/forums/topic/ted2go-fork/">Discuss on Forum</a> | <a href="https://paypal.me/engor/10">Donate</a><br>
+
+<h3>Features</h3>
+
+<ul>
+<li><b>Autocompletion List</b><br>
+It is based on real parsing of sources, parse all modules and user's code.<br>
+(WIP, don't parse locals yet.)
+</li>
+<br>
+<li><b>CodeTree View</b><br>
+Shows code structure, gives us comfortable code jumping.
+</li>
+<br>
+<li><b>Goto definition</b><br>
+Press F12 to goto definition of ident under cursor.
+</li>
+<br>
+<li><b>Parsing on-the-fly</b><br>
+You can see parse errors in realtime. Point the mouse to see a hint.
+</li>
+<br>
+<li><b>ToolBars</b><br>
+MainToolBar - to simplify access to actions: open/save/undo/redo/build.<br>
+EditorToolBar: find/comment/shift.
+</li>
+<br>
+<li><b>StatusBar</b><br>
+You can see some useful info here:<br>
+* quick help for any (almost) code member by F1;<br>
+* cursor line number and position in line;<br>
+* building dialog moved here, so you can comfortable write code while compiling.<br>
+</li>
+<br>
+<li><b>Quick help</b><br>
+Press F1 first time and you'll see quick help in status bar.<br>
+Press F1 again and you'll see the full help for module members, or will be jumped to member declaration.<br>
+Help system find idents more accurately (in comparison with original ted2).
+</li>
+<br>
+<li><b>"Find in files" dialog</b> (Ctrl+Shift+F)</li>
+Allow you to find in whole project.
+</ul>
+
+
+<h3>Quick Help</h3>
+<ul>
+<li>F1 - show help for ident under cursor;</li>
+<li>F12 - goto ident declaration;</li>
+<li>Alt+Left / Alt+Right - go back / go forward through navigation stack;</li>
+<li>Ctrl+' - comment selected lines (macos: Ctrl+\);</li>
+<li>Ctrl+Shift+' - uncomment selected lines (macos: Ctrl+Shift+\);</li>
+<li>Ctrl+E - delete whole line under cursor (on windows).</li>
+<li>Ctrl+Shift+F - open "Find in files" dialog.</li>
+<li>Shift+F5 - stop current process (cancel building, etc).</li>
+</ul>
+
+
+<h3>Author</h3>
+
+<p>By Evgeniy Goroshkin (nerobot/engor).<br>
+Welcome to say me thanks with <a href="https://paypal.me/engor/10">PayPal donation</a>.<br>
+Enjoy coding!</p>
+
+
+<h3>Third party</h3>
+
+<p>Almost all icons for CodeTree were taken from Netbeans IDE.</p>
+
+
+<h3>Special Thanks</h3>
+
+<p>Leonardo Teixeira, Jesus Perez, Mark Sibly, Philipp Moeller, Lee Wade.</p>
+
+</body>
+
+</html>

BIN=BIN
assets/fonts/verdana.ttf


BIN=BIN
assets/fonts/verdanab.ttf


+ 54 - 0
assets/newfiles/Letterboxed_Mojo_App.monkey2

@@ -0,0 +1,54 @@
+
+Namespace myapp
+
+#Import "<std>"
+#Import "<mojo>"
+
+Using std..
+Using mojo..
+
+Const Size:=New Vec2i( 640,360 )
+
+Class MyWindow Extends Window
+
+	Method New()
+		Super.New( "My Window",640,480,WindowFlags.Resizable )
+	
+		Layout="letterbox"
+	
+	End
+
+	Method OnRender( canvas:Canvas ) Override
+	
+		App.RequestRender()
+	
+		canvas.DrawText( "Hello World",Width/2,Height/2,.5,.5 )
+	
+	End
+	
+	Method OnKeyEvent( event:KeyEvent ) Override
+	
+		If event.Type=EventType.KeyDown And event.Key=Key.Enter And event.Modifiers & Modifier.Alt
+		
+			Fullscreen=Not Fullscreen
+			
+		Endif
+	
+	End
+	
+	Method OnMeasure:Vec2i() Override
+	
+		Return Size
+		
+	End
+	
+End
+
+Function Main()
+
+	New AppInstance
+	
+	New MyWindow
+	
+	App.Run()
+End

+ 12 - 0
assets/newfiles/Simple_Console_App.monkey2

@@ -0,0 +1,12 @@
+
+Namespace myapp
+
+#Import "<std>"
+
+Using std..
+
+Function Main()
+
+	Print "Hello World"
+	
+End

+ 33 - 0
assets/newfiles/Simple_Mojo_App.monkey2

@@ -0,0 +1,33 @@
+
+Namespace myapp
+
+#Import "<std>"
+#Import "<mojo>"
+
+Using std..
+Using mojo..
+
+Class MyWindow Extends Window
+
+	Method New( title:String="Simple mojo app",width:Int=640,height:Int=480,flags:WindowFlags=Null )
+
+		Super.New( title,width,height,flags )
+	End
+
+	Method OnRender( canvas:Canvas ) Override
+	
+		App.RequestRender()
+	
+		canvas.DrawText( "Hello World!",Width/2,Height/2,.5,.5 )
+	End
+	
+End
+
+Function Main()
+
+	New AppInstance
+	
+	New MyWindow
+	
+	App.Run()
+End

+ 26 - 0
assets/newfiles/Simple_Mojox_Gui_App.monkey2

@@ -0,0 +1,26 @@
+
+#Import "<std>"
+#Import "<mojo>"
+#Import "<mojox>"
+
+Using std..
+Using mojo..
+Using mojox..
+
+Class MyWindow Extends Window
+
+	Method New()
+		Super.New( "Simple Mojo Gui App",640,480,WindowFlags.Resizable )
+	End
+
+End
+
+Function Main()
+
+	New AppInstance
+	
+	New MyWindow
+	
+	App.Run()
+End
+

BIN=BIN
assets/themes/cancel.png


BIN=BIN
assets/themes/codeicons/alias.png


BIN=BIN
assets/themes/codeicons/annotation.png


BIN=BIN
assets/themes/codeicons/class.png


BIN=BIN
assets/themes/codeicons/class_private.png


BIN=BIN
assets/themes/codeicons/class_protected.png


BIN=BIN
assets/themes/codeicons/code_template.png


BIN=BIN
assets/themes/codeicons/const.png


BIN=BIN
assets/themes/codeicons/constructor.png


BIN=BIN
assets/themes/codeicons/constructor_private.png


BIN=BIN
assets/themes/codeicons/constructor_protected.png


BIN=BIN
assets/themes/codeicons/enum.png


BIN=BIN
assets/themes/codeicons/enum_private.png


BIN=BIN
assets/themes/codeicons/enum_protected.png


BIN=BIN
assets/themes/codeicons/error.png


BIN=BIN
assets/themes/codeicons/field.png


BIN=BIN
assets/themes/codeicons/field_func.png


BIN=BIN
assets/themes/codeicons/field_private.png


BIN=BIN
assets/themes/codeicons/field_protected.png


BIN=BIN
assets/themes/codeicons/field_static.png


BIN=BIN
assets/themes/codeicons/field_static_private.png


BIN=BIN
assets/themes/codeicons/field_static_protected.png


BIN=BIN
assets/themes/codeicons/folder.png


BIN=BIN
assets/themes/codeicons/interface.png


BIN=BIN
assets/themes/codeicons/keyword.png


BIN=BIN
assets/themes/codeicons/local.png


BIN=BIN
assets/themes/codeicons/method.png


BIN=BIN
assets/themes/codeicons/method_private.png


BIN=BIN
assets/themes/codeicons/method_protected.png


BIN=BIN
assets/themes/codeicons/method_static.png


BIN=BIN
assets/themes/codeicons/method_static_private.png


BIN=BIN
assets/themes/codeicons/method_static_protected.png


BIN=BIN
assets/themes/codeicons/operator.png


BIN=BIN
assets/themes/codeicons/other.png


BIN=BIN
assets/themes/codeicons/package.png


BIN=BIN
assets/themes/codeicons/property.png


BIN=BIN
assets/themes/codeicons/property_private.png


BIN=BIN
assets/themes/codeicons/property_protected.png


BIN=BIN
assets/themes/codeicons/struct.png


BIN=BIN
assets/themes/codeicons/struct_private.png


BIN=BIN
assets/themes/codeicons/struct_protected.png


BIN=BIN
assets/themes/codeicons/warning.png


BIN=BIN
assets/themes/debug_icons.png


+ 337 - 0
assets/themes/default.json

@@ -0,0 +1,337 @@
+{
+	"colors":{
+
+		"clear": "#181818",
+		"gutter": "#262626",
+		"content": "#323232",
+		"panel": "#4c4c4c",
+		"knob": "#666666",
+		"hover": "#888888",
+		"active" : "#989898",
+		
+		"text-default": "#fff",
+		"text-highlight": "#ff0",
+		"text-disabled": "#888",
+		"text-background": "#888",
+		
+		"textview-cursor":"#fff",
+		"textview-selection":"#88f",
+		"textview-cursor-line":"#2000",
+		"textview-whitespaces":"#2aaa",
+
+		"textview-color0":"#0000",
+		"textview-color1":"#fff",
+		"textview-color2":"#ff0",
+		"textview-color3":"#0f8",
+		"textview-color4":"#0f8",
+		"textview-color5":"#0ff",
+		"textview-color6":"#fc0",
+		"textview-color7":"#fff",
+		
+		"windowClearColor":"clear"
+	},
+	
+	"fonts":{
+	
+		"normal":"DejaVuSans.ttf,14",
+		"fixedWidth":"DejaVuSansMono.ttf,14",
+		"small":"DejaVuSans.ttf,13",
+		"editor":"DejaVuSansMono.ttf,16"
+	},
+	
+	"styles":{
+
+		"default":{
+			"font":"normal",
+			"textColor":"text-default",
+			"iconColor":"#ffff",
+			"states":{
+				"disabled":{
+					"textColor":"text-disabled",
+					"iconColor":"#8fff"
+				}
+			}
+		},
+		
+		"Label":{
+			"padding":[8,4]
+		},
+		
+		"Button":{
+			"extends":"Label",
+			"padding":[4,2],
+			"skin":"button_skin.png",
+			"skinColor":"content",
+			
+			"states":{
+				"hover":{
+					"skinColor":"hover"
+				},
+				"active":{
+					"skinColor":"active"
+				},
+				"selected":{
+					"skinColor":"active"
+				}
+			}
+		},
+		
+		"PushButton":{
+			"extends":"Button",
+			"margin":[4,4]
+		},
+		
+		"CheckButton":{
+			"extends":"Label"
+		},
+		
+		"CheckBox":{
+			"icons":"checkbox_icons.png",
+			"margin":[8,0,0,0]
+		},
+		
+		"ProgressBar":{
+			"icons":"progressbar_icons.png"
+		},
+		
+		"ScrollView":{
+		},
+		
+		"ScrollBar":{
+			"backgroundColor":"gutter"
+		},
+		
+		"ScrollKnob":{
+			"padding":[ 4 ],
+			"border":[ 1 ],
+			"borderColor":"#0000",
+			"skin":"button_skin.png",
+			"skinColor":"knob",
+			"states":{
+				"hover":{
+					"skinColor":"hover"
+				},
+				"active":{
+					"skinColor":"active"
+				}
+			}
+		},
+		
+		"TextView":{
+			"font":"editor",
+			"backgroundColor":"content"
+		},
+		
+		"TextViewContent":{
+			"padding":[4]
+		},
+		
+		"TextField":{
+			"font":"editor",
+			"padding":[ 2 ],
+			"margin":[ 2 ],
+			"skin":"button_skin.png",
+			"skinColor":"content"
+		},
+		
+		"DockingView":{
+		},
+		
+		"DockedView":{
+		},
+		
+		"DockKnob":{
+			"padding":[ 3 ],
+			"backgroundColor":"knob",
+			"states":{
+				"hover":{
+					"backgroundColor":"hover"
+				},
+				"active":{
+					"backgroundColor":"active"
+				}
+			}
+		},
+		
+		"ToolBar":{
+			"padding":[ 2 ],
+			"backgroundColor":"panel"
+		},
+		
+		"ToolButton":{
+			"extends":"Button",
+			"padding":[2,0],
+			"margin":[6,0]
+		},
+		
+		"Menu":{
+			
+			"padding":[ 0 ],
+			"skin":"dialog_skin.png",
+			"skinColor":"panel"
+		},
+		
+		"MenuButton":{
+			"extends":"Label",
+			"padding":[8,3],
+			"states":{
+				"hover":{
+					"backgroundColor":"hover"
+				},
+				"active":{
+					"backgroundColor":"active"
+				},
+				"selected":{
+					"backgroundColor":"active"
+				}
+			}
+		},
+		
+		"MenuBar":{
+			"extends":"ToolBar",
+			"backgroundColor":"content",
+			"margin":[ 0 ]
+		},
+		
+		"MenuSeparator":{
+			"padding":[ 0,0,0,1 ],
+			"backgroundColor":"content",
+			"border":[ 8,8,7,7 ]
+		},
+
+		"TabView":{
+		},
+		
+		"TabBar":{
+			"extends":"ToolBar",
+			"padding":[ 0,2,4,0 ],
+			"backgroundColor":"clear"
+		},
+		
+		"TabButton":{
+			"extends":"Button",
+//			"font":"small",
+			"padding":[1],
+			"margin":[2,0],
+			"backgroundColor":"#0000",
+			"skin":"tabbutton_skin.png",
+			"skinColor":"gutter",
+			"textColor":"text-background",
+			
+			"states":{
+				"hover":{
+					"skinColor":"gutter"
+				},
+				"active":{
+					"skinColor":"content"
+				},
+				"selected":{
+					"skinColor":"content",
+					"textColor":"text-default"
+				}
+			}
+		},
+		
+		"TabClose":{
+			"margin":[ 4,0,0,0 ],
+			"icons":"tabclose_icons.png",
+			"iconColor":"#cfff",
+			"states":{
+				"hover":{
+					"iconColor":"#ffff"
+				},
+				"active":{
+					"iconColor":"#ffff"
+				}
+			}
+		},
+		
+		"TableView":{
+			"extends":"DockingView"
+		},
+		
+		"TableHeader":{
+			"extends":"Label",
+			"textColor":"text-highlight",
+			"border":[0,0,0,1],
+			"borderColor":"panel"
+		},
+		
+		"TableColumn":{
+		},
+		
+		"TreeView":{
+			"backgroundColor":"content",
+			"icons":"treeview_icons.png",
+			"iconColor":"#8fff"
+		},
+		
+		"TreeViewContent":{
+			"padding":[2]
+		},
+
+		"TreeViewNode":{
+			"padding":[1],
+			"states":{
+				"hover":{
+					"backgroundColor":"panel"
+				},
+				"selected":{
+					"backgroundColor":"panel",
+					"textColor":"text-highlight"
+				}
+			}
+		},
+		
+		"ListView":{
+			"backgroundColor":"content"
+		},
+		
+		"ListViewContent":{
+			"padding":[2]
+		},
+		
+		"ListViewItem":{
+			"padding":[1],
+			"states":{
+				"hover":{
+					"backgroundColor":"panel"
+				},
+				"selected":{
+					"backgroundColor":"panel",
+					"textColor":"text-highlight"
+				}
+			}
+		},
+		
+		"FileBrowser":{
+			"extends":"TreeView"
+		},
+		
+		"HtmlView":{
+		},
+		
+		"Console":{
+			"backgroundColor":"content"
+		},
+		
+		"Dialog":{
+			"skin":"dialog_skin.png",
+			"skinColor":"panel"
+		},
+		
+		"DialogTitle":{
+			"extends":"Label",
+			"backgroundColor":"knob"
+		
+		},
+		
+		"DialogContent":{
+			"padding":[ 8,8,8,4 ]
+		},
+		
+		"DialogActions":{
+			"padding":[ 8,4,8,4 ]
+		}
+	}
+}

BIN=BIN
assets/themes/docbar/back.png


BIN=BIN
assets/themes/docbar/forward.png


BIN=BIN
assets/themes/docbar/home.png


BIN=BIN
assets/themes/editorbar/back.png


BIN=BIN
assets/themes/editorbar/comment.png


BIN=BIN
assets/themes/editorbar/find_next.png


BIN=BIN
assets/themes/editorbar/find_previous.png


BIN=BIN
assets/themes/editorbar/find_selection.png


BIN=BIN
assets/themes/editorbar/forward.png


BIN=BIN
assets/themes/editorbar/last_edit.png


BIN=BIN
assets/themes/editorbar/next_bookmark.png


BIN=BIN
assets/themes/editorbar/previous_bookmark.png


BIN=BIN
assets/themes/editorbar/shift_left.png


BIN=BIN
assets/themes/editorbar/shift_right.png


BIN=BIN
assets/themes/editorbar/toggle_bookmark.png


BIN=BIN
assets/themes/editorbar/uncomment.png


BIN=BIN
assets/themes/project/package.png


BIN=BIN
assets/themes/smooth_assets/button_skin.png


BIN=BIN
assets/themes/smooth_assets/checkbox_icons.png


BIN=BIN
assets/themes/smooth_assets/dialog_skin.png


BIN=BIN
assets/themes/smooth_assets/progressbar_icons.png


BIN=BIN
assets/themes/smooth_assets/tabbutton_skin.png


BIN=BIN
assets/themes/smooth_assets/tabclose_icons.png


BIN=BIN
assets/themes/smooth_assets/treeview_icons.png


BIN=BIN
assets/themes/sourcebar/filter_inherited.png


BIN=BIN
assets/themes/sourcebar/sort_alpha.png


BIN=BIN
assets/themes/sourcebar/sort_position.png


+ 89 - 0
assets/themes/ted2-default.json

@@ -0,0 +1,89 @@
+{
+	"extends":"default",
+	
+	"styles":{
+	
+		"GutterView":{
+			"extends":"TextView",
+			"textColor":"text-disabled"
+		},
+		
+		"DebugToolBar":{
+			"extends":"ToolBar",
+			"border":[ 4 ],
+			"borderColor":"content",
+			"icons":"debug_icons.png"
+		},
+		
+		"HelpTextField":{
+			"extends":"TextField",
+			"skinColor":"panel"
+		},
+
+		"Hint":{
+			"border":[ 1 ],
+			"borderColor":"clear",
+			"backgroundColor":"panel"
+		},
+
+		"ToolBarExt":{
+			"extends":"ToolBar",
+			"padding":[ 0 ],
+			"margin":[ 0 ],
+			"backgroundColor":"content",
+			"border":[ 0,0,0,1 ],
+			"borderColor":"clear"
+		},
+
+		"MainToolBar":{
+			"extends":"ToolBarExt"
+		},
+
+		"EditorToolBar":{
+			"extends":"ToolBarExt"
+		},
+
+		"SourceToolBar":{
+			"extends":"ToolBarExt"
+		},
+
+		"ToolButton":{
+			"extends":"Button",
+			"padding":[ 2,0 ],
+			"margin":[ 3,0 ]
+		},
+
+		"TabViewArrowPrev":{
+			"extends":"Button",
+			"padding":[ 4,1 ],
+			"margin":[ 2,0,1,0 ]
+		},
+
+		"TabViewArrowNext":{
+			"extends":"Button",
+			"padding":[ 4,1 ],
+			"margin":[ 1,0,2,0 ]
+		},
+
+		"StatusBar":{
+			"extends":"DockingView",
+			"padding":[ 0 ],
+			"backgroundColor":"content",
+			"border":[ 0,1,0,0 ]
+		},
+		"StatusBarText":{
+			"extends":"Label"
+		},
+		"StatusBarLineInfo":{
+			"extends":"Label",
+			"margin":[ 30,0,0,0 ]
+		},
+		"StatusBarIns":{
+			"extends":"Label"
+		},
+		"StatusBarProgress":{
+			"extends":"ProgressBar",
+			"margin":[ 6,0 ]
+		}
+	}
+}

+ 40 - 0
assets/themes/theme-Basic-Blue.json

@@ -0,0 +1,40 @@
+{
+	"extends":"ted2-default",
+	
+	"colors":{
+
+		"content": "#005",
+		"clear": "#000",
+		"panel": "#00b",
+		"gutter": "#000",
+		
+		"knob": "#009",
+		"hover": "#09f",
+		"active" : "#009",
+
+		"text-default": "#fff",
+		"text-highlight": "#09f",
+		"text-disabled":  "#888",
+		"text-background": "#09f",
+		
+		"textview-cursor":"#fff",
+		"textview-selection":"#222",
+		
+		"textview-color0": "#0000",
+		"textview-color1": "#07e",	//identifiers
+		"textview-color2": "#ff0",	//keywords
+		"textview-color3": "#e0e",	//strings
+		"textview-color4": "#0f0",	//numbers
+		"textview-color5": "#fff",	//comment
+		"textview-color6": "#d82",	//preproc
+		"textview-color7": "#222"	//default
+	},
+	
+	"fonts":{
+	
+		"normal":"Verdana.ttf,16",
+		"fixedWidth":"Verdana.ttf,16",
+		"editor":"Verdana.ttf,16",
+		"small":"Verdana.ttf,14"
+	}
+}

+ 32 - 0
assets/themes/theme-blitzed.json

@@ -0,0 +1,32 @@
+{
+	"extends":"ted2-default",
+	
+	"colors":{
+
+		"content": "#345",
+		"clear": "#123",
+		"panel": "#456",
+		"gutter": "#234",
+		
+		"knob": "#567",
+		"hover": "#678",
+		"active" : "#789",
+		
+		"text-default": "#fff",
+		"text-highlight": "#ff0",
+		"text-disabled": "#89a",
+		"text-background": "#89a",
+		
+		"textview-cursor":"#08f",
+		"textview-selection":"#888",
+		
+		"textview-color0":"#0000",
+		"textview-color1":"#fff",
+		"textview-color2":"#ff0",
+		"textview-color3":"#0f8",
+		"textview-color4":"#0f8",
+		"textview-color5":"#0ff",
+		"textview-color6":"#fc0",
+		"textview-color7":"#fff"
+	}
+}

+ 32 - 0
assets/themes/theme-classic-dark.json

@@ -0,0 +1,32 @@
+{
+	"extends":"ted2-default",
+
+	"colors":{
+
+		"clear": "#181818",
+		"gutter": "#262626",
+		"content": "#323232",
+		"panel": "#4c4c4c",
+		
+		"knob": "#666666",
+		"hover": "#888888",
+		"active" : "#989898",
+		
+		"text-default": "#fff",
+		"text-highlight": "#ff0",
+		"text-disabled": "#888",
+		"text-background": "#888",
+		
+		"textview-cursor":"#fff",
+		"textview-selection":"#888",
+		
+		"textview-color0":"#0000",
+		"textview-color1":"#fff",
+		"textview-color2":"#ff0",
+		"textview-color3":"#0f8",
+		"textview-color4":"#0f8",
+		"textview-color5":"#0ff",
+		"textview-color6":"#fc0",
+		"textview-color7":"#fff"
+	}
+}

+ 41 - 0
assets/themes/theme-monkey1.json

@@ -0,0 +1,41 @@
+{
+	"extends":"ted2-default",
+
+	"colors":{
+
+		"content": "#ffffff",
+		"clear": "#e0e0e0",
+		"panel": "#e8e8e8",
+		"gutter": "#f0f0f0",
+		
+		"knob": "#cdcdcd",
+		"hover": "#a6a6a6",
+		"active" : "#606060",
+		
+		"text-default": "#222",
+		"text-highlight": "#484",
+		"text-disabled":  "#888",
+		"text-background": "#888",
+		
+		"textview-cursor":"#08f",
+		"textview-selection":"#888",
+		
+		"textview-color0": "#0000",
+		"textview-color1": "#222",	//identifiers
+		"textview-color2": "#26f",	//keywords
+		"textview-color3": "#282",	//strings
+		"textview-color4": "#228",	//numbers
+		"textview-color5": "#288",	//comment
+		"textview-color6": "#828",	//preproc
+		"textview-color7": "#222"	//default
+	},
+
+	"styles":{
+	
+		"TreeView":{
+			"backgroundColor":"content",
+			"icons":"treeview_icons.png",
+			"iconColor":"#aaa"
+		}
+	}
+}

+ 32 - 0
assets/themes/theme-overcast.json

@@ -0,0 +1,32 @@
+{
+	"extends":"ted2-default",
+	
+	"colors":{
+
+		"clear": "#989898",
+		"content": "#c8c8c8",
+		"panel": "#e8e8e8",
+		"gutter": "#a8a8a8",
+		
+		"knob": "#909090",
+		"hover": "#808080",
+		"active" : "#707070",
+		
+		"text-default": "#000",
+		"text-highlight": "#08f",
+		"text-disabled": "#444",
+		"text-background": "#444",
+		
+		"textview-cursor":"#08f",
+		"textview-selection":"#888",
+
+		"textview-color0":"#0000",
+		"textview-color1":"#000",
+		"textview-color2":"#008",
+		"textview-color3":"#080",
+		"textview-color4":"#080",
+		"textview-color5":"#808",
+		"textview-color6":"#840",
+		"textview-color7":"#000"
+	}
+}

+ 28 - 0
assets/themes/theme-smooth-warm.json

@@ -0,0 +1,28 @@
+//Theme by Ethernaut, vaguely based on "smooth" by Hezcore
+{
+	"extends":"ted2-default",
+ 
+	"colors":{
+		"border": "#211d12",
+		"clear": "#23211f",
+		"gutter": "#242324",
+		"content": "#282728",
+		"panel": "#594f45",
+ 
+		"knob": "#363330",
+		"hover": "#594f45",
+		"active" : "#7e7763",
+ 
+		"textview-cursor":"#FFDD55",
+		"textview-selection":"#3E4451",
+ 
+		"textview-color0":"#f2dba6",
+		"textview-color1": "#f6e4bc",	//identifiers
+		"textview-color2": "#ffbf00",	//keywords
+		"textview-color3": "#cbcb4d",	//strings
+		"textview-color4": "#66b3cc",	//numbers
+		"textview-color5": "#8E744A",	//comment
+		"textview-color6": "#729888",	//preproc
+		"textview-color7": "#fff9e6"	//default
+	}
+}

+ 271 - 0
assets/themes/theme-smooth.json

@@ -0,0 +1,271 @@
+//Theme by Hezkore
+
+{
+	"extends":"ted2-default",
+
+	"styles":{
+
+		"ToolButton":{
+			"iconColor":"#FFF",
+			"skinColor":"panel",
+			"extends":"Button",
+			"padding":[2,0],
+			"margin":[3,0],
+
+			"states":{
+				"hover":{
+					"skinColor":"#9EBEFF"
+				},
+				"active":{
+					"skinColor":"#BED3FF"
+				},
+				"selected":{
+					"skinColor":"#9EBEFF"
+				}
+			}
+		},
+
+		"MainToolBar":{
+			"extends":"ToolBar",
+			"padding":[ 0 ],
+			"backgroundColor":"content",
+			"border":[ 0,1,0,1 ],
+			"borderColor":"border"
+		},
+
+		"EditorToolBar":{
+			"extends":"ToolBar",
+			"padding":[ 0 ],
+			"backgroundColor":"content",
+			"border":[1,0,1,1],
+			"borderColor":"border"
+		},
+
+		"MenuSeparator":{
+			"padding":[ 0,0,0,1 ],
+			"backgroundColor":"content",
+			"border":[ 8,8,7,7 ]
+		},
+
+		"Hint":{
+			"textColor":"text-highlight",
+			"skin":"smooth_assets/button_skin.png",
+			"skinColor":"#9EBEFF"
+		},
+
+		"TextView":{
+			"border":[1,0,1,1],
+			"borderColor":"border",
+			"backgroundColor":"content"
+		},
+
+		"GutterView":{
+			"border":[0],
+			"extends":"TextView",
+			"textColor":"text-disabled"
+		},
+
+		"TextViewContent":{
+			"padding":[4]
+		},
+
+		"Console":{
+			"border":[1,0,1,1],
+			"borderColor":"border",
+			"font":"small",
+			"backgroundColor":"content"
+		},
+
+		"ProgressBar":{
+			"icons":"smooth_assets/progressbar_icons.png"
+		},
+
+		"Button":{
+			"font":"small",
+			"extends":"Label",
+			"padding":[4,2],
+			"skin":"smooth_assets/button_skin.png",
+			"skinColor":"panel",
+
+			"states":{
+				"hover":{
+					"skinColor":"active"
+				},
+				"active":{
+					"skinColor":"knob"
+				},
+				"selected":{
+					"skinColor":"clear"
+				}
+			}
+		},
+
+		"Dialog":{
+			"skin":"smooth_assets/dialog_skin.png",
+			"skinColor":"panel"
+		},
+
+		"DialogTitle":{
+			"extends":"Label",
+			"backgroundColor":"knob"
+		},
+
+		"TreeView":{
+			"border":[1,0,1,0],
+			"borderColor":"border",
+			"backgroundColor":"content",
+			"icons":"smooth_assets/treeview_icons.png",
+			"iconColor":"#9DA5B4"
+		},
+
+		"TreeViewContent":{
+			"border":[0],
+			"padding":[4]
+		},
+
+		"TreeViewNode":{
+			"border":[0],
+			"padding":[3],
+			"font":"small",
+			"states":{
+				"hover":{
+					"backgroundColor":"#3F3F3F"
+				},
+				"selected":{
+					"backgroundColor":"#3F3F3F",
+					"textColor":"text-highlight"
+				}
+			}
+		},
+
+		"CheckBox":{
+			"icons":"smooth_assets/checkbox_icons.png",
+			"margin":[8,0,0,0]
+		},
+
+		"DockKnob":{
+			"padding":[2],
+			"backgroundColor":"gutter",
+			"states":{
+				"hover":{
+					"backgroundColor":"hover"
+				},
+				"active":{
+					"backgroundColor":"active"
+				}
+			}
+		},
+
+		"ScrollBar":{
+			"backgroundColor":"content"
+		},
+
+		"ScrollKnob":{
+			"border":[2],
+			"padding":[1],
+			"margin":[3],
+			"skin":"button_skin.png",
+			"skinColor":"knob",
+			"states":{
+				"hover":{
+					"skinColor":"knob",
+					"margin":[1]
+				},
+				"active":{
+					"skinColor":"active",
+					"margin":[0]
+				}
+			}
+		},
+
+		"ToolBar":{
+			"padding":[2,2,0,2],
+			"backgroundColor":"panel"
+		},
+
+		"TabBar":{
+			"border":[0,0,0,1],
+			"borderColor":"border",
+			"extends":"ToolBar",
+			"padding":[ 0,2,4,0 ],
+			"backgroundColor":"clear"
+		},
+
+		"TabButton":{
+			"extends":"Button",
+			"font":"small",
+			"padding":[16,5,16,5],
+			"margin":[1,0],
+			"backgroundColor":"#0000",
+			"skin":"smooth_assets/tabbutton_skin.png",
+			"skinColor":"gutter",
+			"textColor":"text-background",
+			"states":{
+				"hover":{
+					"skinColor":"gutter"
+				},
+				"active":{
+					"skinColor":"content"
+				},
+				"selected":{
+					"border":[2,0,0,0],
+					"borderColor":"#507FDF",
+					"skinColor":"content",
+					"textColor":"text-default"
+				}
+			}
+		},
+
+		"TabClose":{
+			"margin":[4,0,0,0],
+			"icons":"smooth_assets/tabclose_icons.png",
+			"iconColor":"#373737",
+			"states":{
+				"hover":{
+					"iconColor":"#D7DAE0"
+				},
+				"active":{
+					"iconColor":"#D7DAE0"
+				}
+			}
+		}
+
+	},
+
+	"colors":{
+		"border": "#171A1E",
+		"clear": "#21252B",
+		"gutter": "#21252B",
+		"content": "#282C34",
+		"panel": "#444B59",
+
+		"knob": "#575F6F",
+		"hover": "#444B59",
+		"active" : "#636C7F",
+
+		"text-default": "#C1CFD1",
+		"text-highlight": "#fff",
+		"text-disabled": "#4B5262",
+		"text-background": "#737883",
+
+		"textview-cursor":"#7BA4F8",
+		"textview-selection":"#3E4451",
+
+		//FF0000
+		"textview-color0":"#C358F5",
+		"textview-color1": "#6EA4F5",	//identifiers
+		"textview-color2": "#CF84EB",	//keywords
+		"textview-color3": "#7FE37F",	//strings
+		"textview-color4": "#FFB254",	//numbers
+		"textview-color5": "#6E7480",	//comment
+		"textview-color6": "#E06C72",	//preproc
+		"textview-color7": "#C358F5"	//default
+	},
+
+	"fonts":{
+		"normal":"DejaVuSans.ttf,16",
+		"fixedWidth":"DejaVuSans.ttf,15",
+		"editor":"DejaVuSansMono.ttf,15",
+		"small":"DejaVuSans.ttf,15"
+	}
+}

+ 9 - 0
assets/themes/themes.json

@@ -0,0 +1,9 @@
+{
+	"Classic dark":"theme-classic-dark",
+	"Overcast":"theme-overcast",
+	"Monkey 1":"theme-monkey1",
+	"Blitzed":"theme-blitzed",
+	"Basic Blue":"theme-Basic-Blue",
+	"Smooth":"theme-smooth",
+	"Smooth warm":"theme-smooth-warm"
+}

BIN=BIN
assets/themes/toolbar/back.png


BIN=BIN
assets/themes/toolbar/build.png


BIN=BIN
assets/themes/toolbar/check.png


BIN=BIN
assets/themes/toolbar/debug.png


Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio