Browse Source

Ted2 tweaks.

Mark Sibly 9 years ago
parent
commit
854f83c0e5

+ 10 - 10
src/ted2/buildactions.monkey2

@@ -58,40 +58,40 @@ Class BuildActions
 #Endif
 #Endif
 		_mx2cc=RealPath( _mx2cc )
 		_mx2cc=RealPath( _mx2cc )
 		
 		
-		buildAndRun=New Action( "Build And Run" )
+		buildAndRun=New Action( "Build and run" )
 		buildAndRun.Triggered=OnBuildAndRun
 		buildAndRun.Triggered=OnBuildAndRun
 		buildAndRun.HotKey=Key.F5
 		buildAndRun.HotKey=Key.F5
 
 
-		build=New Action( "Build Only" )
+		build=New Action( "Build only" )
 		build.Triggered=OnBuild
 		build.Triggered=OnBuild
 		build.HotKey=Key.F6
 		build.HotKey=Key.F6
 		
 		
-		buildSettings=New Action( "Build Settings" )
+		buildSettings=New Action( "Build settings" )
 		buildSettings.Triggered=OnBuildFileSettings
 		buildSettings.Triggered=OnBuildFileSettings
 		
 		
-		nextError=New Action( "Next Error" )
+		nextError=New Action( "Next build error" )
 		nextError.Triggered=OnNextError
 		nextError.Triggered=OnNextError
 		nextError.HotKey=Key.F4
 		nextError.HotKey=Key.F4
 		
 		
-		lockBuildFile=New Action( "Lock Build File" )
+		lockBuildFile=New Action( "Lock build file" )
 		lockBuildFile.Triggered=OnLockBuildFile
 		lockBuildFile.Triggered=OnLockBuildFile
 		lockBuildFile.HotKey=Key.L
 		lockBuildFile.HotKey=Key.L
 		lockBuildFile.HotKeyModifiers=Modifier.Menu
 		lockBuildFile.HotKeyModifiers=Modifier.Menu
 		
 		
-		updateModules=New Action( "Update Modules" )
+		updateModules=New Action( "Update modules" )
 		updateModules.Triggered=OnUpdateModules
 		updateModules.Triggered=OnUpdateModules
 		updateModules.HotKey=Key.U
 		updateModules.HotKey=Key.U
 		updateModules.HotKeyModifiers=Modifier.Menu
 		updateModules.HotKeyModifiers=Modifier.Menu
 		
 		
-		rebuildModules=New Action( "Rebuild Modules" )
+		rebuildModules=New Action( "Rebuild modules" )
 		rebuildModules.Triggered=OnRebuildModules
 		rebuildModules.Triggered=OnRebuildModules
 		rebuildModules.HotKey=Key.U
 		rebuildModules.HotKey=Key.U
 		rebuildModules.HotKeyModifiers=Modifier.Menu|Modifier.Shift
 		rebuildModules.HotKeyModifiers=Modifier.Menu|Modifier.Shift
 		
 		
-		moduleManager=New Action( "Module Manager" )
+		moduleManager=New Action( "Module manager" )
 		moduleManager.Triggered=OnModuleManager
 		moduleManager.Triggered=OnModuleManager
 		
 		
-		rebuildHelp=New Action( "Rebuild Documentation" )
+		rebuildHelp=New Action( "Rebuild documentation" )
 		rebuildHelp.Triggered=OnRebuildHelp
 		rebuildHelp.Triggered=OnRebuildHelp
 		
 		
 		local group:=New CheckGroup
 		local group:=New CheckGroup
@@ -121,7 +121,7 @@ Class BuildActions
 		_iosTarget=New CheckButton( "iOS",,group )
 		_iosTarget=New CheckButton( "iOS",,group )
 		_iosTarget.Layout="fill-x"
 		_iosTarget.Layout="fill-x"
 		
 		
-		targetMenu=New Menu( "Build Target..." )
+		targetMenu=New Menu( "Build target..." )
 		targetMenu.AddView( _debugConfig )
 		targetMenu.AddView( _debugConfig )
 		targetMenu.AddView( _releaseConfig )
 		targetMenu.AddView( _releaseConfig )
 		targetMenu.AddSeparator()
 		targetMenu.AddSeparator()

+ 2 - 2
src/ted2/documentmanager.monkey2

@@ -27,12 +27,12 @@ Class DocumentManager
 			_openDocs=docs
 			_openDocs=docs
 		End
 		End
 		
 		
-		nextDocument=New Action( "Next File" )
+		nextDocument=New Action( "Next file" )
 		nextDocument.Triggered=OnNextDocument
 		nextDocument.Triggered=OnNextDocument
 		nextDocument.HotKey=Key.Tab
 		nextDocument.HotKey=Key.Tab
 		nextDocument.HotKeyModifiers=Modifier.Control
 		nextDocument.HotKeyModifiers=Modifier.Control
 
 
-		prevDocument=New Action( "Previous File" )
+		prevDocument=New Action( "Previous file" )
 		prevDocument.Triggered=OnPrevDocument
 		prevDocument.Triggered=OnPrevDocument
 		prevDocument.HotKey=Key.Tab
 		prevDocument.HotKey=Key.Tab
 		prevDocument.HotKeyModifiers=Modifier.Control|Modifier.Shift
 		prevDocument.HotKeyModifiers=Modifier.Control|Modifier.Shift

+ 1 - 1
src/ted2/editactions.monkey2

@@ -29,7 +29,7 @@ Class EditActions
 		paste=New Action( "Paste" )
 		paste=New Action( "Paste" )
 		paste.Triggered=OnPaste
 		paste.Triggered=OnPaste
 
 
-		selectAll=New Action( "Select All" )
+		selectAll=New Action( "Select all" )
 		selectAll.Triggered=OnSelectAll
 		selectAll.Triggered=OnSelectAll
 	End
 	End
 	
 	

+ 0 - 133
src/ted2/editproductdialog.monkey2

@@ -1,139 +1,6 @@
 
 
 Namespace ted2
 Namespace ted2
 
 
-Class OptionsField Extends DockingView
-
-	Field CurrentChanged:Void()
-
-	Method New( options:String[],current:Int=0 )
-	
-		_options=options
-		
-		_current=current
-		
-		_group=New CheckGroup
-		
-		_group.CheckedChanged+=Lambda()
-		
-			For Local i:=0 Until _checks.Length
-				If _group.Checked=_checks[i]
-					_current=i
-					CurrentChanged()
-					Return
-				Endif
-			Next
-			
-		End
-
-		_checks=New CheckButton[options.Length]
-		
-		For Local i:=0 Until options.Length
-		
-			_checks[i]=New CheckButton( _options[i],,_group )
-			
-			AddView( _checks[i],"left" )
-		
-		Next
-		
-		_checks[_current].Checked=True
-	End
-	
-	Property Current:Int()
-	
-		Return _current
-	
-	Setter( current:Int )
-	
-		_current=current
-		
-		_checks[_current].Checked=True
-	End
-	
-	Private
-
-	Field _options:String[]
-	
-	Field _current:Int
-	
-	Field _group:CheckGroup
-	
-	Field _checks:CheckButton[]
-	
-End
-
-Class FilePathField Extends DockingView
-
-	Field FilePathChanged:Void()
-
-	Method New( path:String="",fileType:FileType=FileType.File )
-	
-		_fileType=fileType
-
-		_textField=New TextField( path )
-		
-		_textField.TextChanged+=Lambda()
-		
-			FilePathChanged()
-		End
-
-		_pathButton=New PushButton( "..." )
-		
-		_pathButton.Clicked=Lambda()
-		
-			New Fiber( Lambda()
-		
-				Local future:=New Future<String>
-			
-				App.Idle+=Lambda()
-					If _fileType=FileType.Directory
-						future.Set( requesters.RequestDir( "Select Directory",_textField.Text ) )
-					Else
-						future.Set( requesters.RequestFile( "Select File",_textField.Text ) )
-					Endif
-				End
-				
-				Local path:=future.Get()
-				If Not path Return
-				
-				_textField.Text=path
-				
-				FilePathChanged()
-			End )
-		End
-		
-		AddView( _pathButton,"right" )
-
-		ContentView=_textField
-
-		MaxSize=New Vec2i( 320,0 )
-	End
-	
-	Property FilePath:String()
-	
-		Return _textField.Text
-	
-	Setter( path:String )
-	
-		_textField.Text=path
-	End
-	
-	Property FileType:FileType()
-	
-		Return _fileType
-	
-	Setter( fileType:FileType )
-	
-		_fileType=fileType
-	End
-	
-	Private
-	
-	Field _textField:TextField
-	Field _pathButton:PushButton
-	Field _fileType:FileType
-
-End
-
 Class ProductVar
 Class ProductVar
 
 
 	Field name:String
 	Field name:String

+ 5 - 5
src/ted2/fileactions.monkey2

@@ -38,13 +38,13 @@ Class FileActions
 #endif		
 #endif		
 		close.Triggered=OnClose
 		close.Triggered=OnClose
 		
 		
-		closeOthers=New Action( "Close Other Tabs" )
+		closeOthers=New Action( "Close other tabs" )
 		closeOthers.Triggered=OnCloseOthers
 		closeOthers.Triggered=OnCloseOthers
 		
 		
-		closeToRight=New Action( "Close Tabs To The Right" )
+		closeToRight=New Action( "Close tabs to the right" )
 		closeToRight.Triggered=OnCloseToRight
 		closeToRight.Triggered=OnCloseToRight
 		
 		
-		closeAll=New Action( "Close All" )
+		closeAll=New Action( "Close all" )
 		closeAll.Triggered=OnCloseAll
 		closeAll.Triggered=OnCloseAll
 		
 		
 		save=New Action( "Save" )
 		save=New Action( "Save" )
@@ -52,12 +52,12 @@ Class FileActions
 		save.HotKeyModifiers=Modifier.Menu
 		save.HotKeyModifiers=Modifier.Menu
 		save.Triggered=OnSave
 		save.Triggered=OnSave
 
 
-		saveAs=New Action( "Save As" )
+		saveAs=New Action( "Save as" )
 		saveAs.HotKey=Key.S
 		saveAs.HotKey=Key.S
 		saveAs.HotKeyModifiers=Modifier.Menu|Modifier.Shift
 		saveAs.HotKeyModifiers=Modifier.Menu|Modifier.Shift
 		saveAs.Triggered=OnSaveAs
 		saveAs.Triggered=OnSaveAs
 
 
-		saveAll=New Action( "Save All" )
+		saveAll=New Action( "Save all" )
 		saveAll.Triggered=OnSaveAll
 		saveAll.Triggered=OnSaveAll
 		
 		
 		quit=New Action( "Quit" )
 		quit=New Action( "Quit" )

+ 3 - 3
src/ted2/findactions.monkey2

@@ -18,11 +18,11 @@ Class FindActions
 		find.HotKey=Key.F
 		find.HotKey=Key.F
 		find.HotKeyModifiers=Modifier.Menu
 		find.HotKeyModifiers=Modifier.Menu
 		
 		
-		findNext=New Action( "Find Next" )
+		findNext=New Action( "Find next" )
 		findNext.Triggered=OnFindNext
 		findNext.Triggered=OnFindNext
 		findNext.HotKey=Key.F3
 		findNext.HotKey=Key.F3
 		
 		
-		findPrevious=New Action( "Find Previous" )
+		findPrevious=New Action( "Find previous" )
 		findPrevious.Triggered=OnFindPrevious
 		findPrevious.Triggered=OnFindPrevious
 		findPrevious.HotKey=Key.F3
 		findPrevious.HotKey=Key.F3
 		findPrevious.HotKeyModifiers=Modifier.Shift
 		findPrevious.HotKeyModifiers=Modifier.Shift
@@ -30,7 +30,7 @@ Class FindActions
 		replace=New Action( "Replace" )
 		replace=New Action( "Replace" )
 		replace.Triggered=OnReplace
 		replace.Triggered=OnReplace
 		
 		
-		replaceAll=New Action( "Replace All" )
+		replaceAll=New Action( "Replace all" )
 		replaceAll.Triggered=OnReplaceAll
 		replaceAll.Triggered=OnReplaceAll
 		
 		
 		_findDialog=New FindDialog( Self )
 		_findDialog=New FindDialog( Self )

+ 5 - 5
src/ted2/helpactions.monkey2

@@ -10,19 +10,19 @@ Class HelpActions
 
 
 	Method New()
 	Method New()
 	
 	
-		onlineHelp=New Action( "Online Help" )
+		onlineHelp=New Action( "Online help" )
 		onlineHelp.Triggered=lambda()
 		onlineHelp.Triggered=lambda()
 		
 		
 			OpenUrl( "http://monkey2.monkey-x.com/modules-reference/" )
 			OpenUrl( "http://monkey2.monkey-x.com/modules-reference/" )
 		End
 		End
 		
 		
-		viewManuals=New Action( "View Manuals" )
+		viewManuals=New Action( "Browse manuals" )
 		viewManuals.Triggered=Lambda()
 		viewManuals.Triggered=Lambda()
 		
 		
 			OpenUrl( RealPath( "docs/index.html" ) )
 			OpenUrl( RealPath( "docs/index.html" ) )
 		End
 		End
 		
 		
-		uploadModules=New Action( "Upload Module" )
+		uploadModules=New Action( "Upload module" )
 		uploadModules.Triggered=Lambda()
 		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" )
 			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" )
@@ -30,13 +30,13 @@ Class HelpActions
 			OpenUrl( RealPath( "http://monkey2.monkey-x.com/module-manager/" ) )
 			OpenUrl( RealPath( "http://monkey2.monkey-x.com/module-manager/" ) )
 		End
 		End
 
 
-		about=New Action( "About Monkey 2" )
+		about=New Action( "About monkey2" )
 		about.Triggered=Lambda()
 		about.Triggered=Lambda()
 		
 		
 			Local htmlView:=New HtmlView
 			Local htmlView:=New HtmlView
 			htmlView.Go( "asset::ted2/about.html" )
 			htmlView.Go( "asset::ted2/about.html" )
 	
 	
-			Local dialog:=New Dialog( "About Monkey2" )
+			Local dialog:=New Dialog( "About monkey2" )
 			dialog.ContentView=htmlView
 			dialog.ContentView=htmlView
 
 
 			dialog.MinSize=New Vec2i( 640,600 )
 			dialog.MinSize=New Vec2i( 640,600 )

+ 38 - 1
src/ted2/imagedocument.monkey2

@@ -7,15 +7,46 @@ Class ImageDocumentView Extends View
 		_doc=doc
 		_doc=doc
 		
 		
 		Layout="fill"
 		Layout="fill"
+		
+		_label=New Label( " " )
+		_label.Style=App.Theme.GetStyle( "PushButton" )
+		_label.Layout="float"
+		_label.Gravity=New Vec2f( .5,1 )
+		
+		_doc.ImageChanged=Lambda()
+		
+			If Not _doc.Image 
+				_label.Text=""
+				Return
+			Endif
+			
+			Local format:="?????"
+			Select _doc.Image.Texture.Format
+			Case PixelFormat.I8 format="PixelFormat.I8"
+			Case PixelFormat.A8 format="PixelFormat.A8"
+			Case PixelFormat.IA16 format="PixelFormat.IA16"
+			Case PixelFormat.RGB24 format="PixelFormat.RGB24"
+			Case PixelFormat.RGBA32 format="PixelFormat.RGBA32"
+			End
+			
+			_label.Text="Width="+_doc.Image.Width+", Height="+_doc.Image.Height+", BytesPerPixel="+PixelFormatDepth( _doc.Image.Texture.Format )+", format="+format
+		End
+		
+		AddChildView( _label )
 	End
 	End
 	
 	
 	Protected
 	Protected
 	
 	
+	Method OnLayout() Override
+	
+		_label.Frame=Rect
+	End
+	
 	Method OnRender( canvas:Canvas ) Override
 	Method OnRender( canvas:Canvas ) Override
 	
 	
 		For Local x:=0 Until Width Step 64
 		For Local x:=0 Until Width Step 64
 			For Local y:=0 Until Height Step 64
 			For Local y:=0 Until Height Step 64
-				canvas.Color=(x~y) & 64 ? New Color( .1,.1,.1 ) Else New Color( .2,.2,.2 )
+				canvas.Color=(x~y) & 64 ? New Color( .1,.1,.1 ) Else New Color( .05,.05,.05 )
 				canvas.DrawRect( x,y,64,64 )
 				canvas.DrawRect( x,y,64,64 )
 			Next
 			Next
 		Next
 		Next
@@ -50,10 +81,14 @@ Class ImageDocumentView Extends View
 	Field _zoom:Float=1
 	Field _zoom:Float=1
 		
 		
 	Field _doc:ImageDocument
 	Field _doc:ImageDocument
+	
+	Field _label:Label
 End
 End
 
 
 Class ImageDocument Extends Ted2Document
 Class ImageDocument Extends Ted2Document
 
 
+	Field ImageChanged:Void()
+
 	Method New( path:String )
 	Method New( path:String )
 		Super.New( path )
 		Super.New( path )
 		
 		
@@ -74,6 +109,8 @@ Class ImageDocument Extends Ted2Document
 		
 		
 		_image.Handle=New Vec2f( .5,.5 )
 		_image.Handle=New Vec2f( .5,.5 )
 		
 		
+		ImageChanged()
+		
 		Return True
 		Return True
 	End
 	End
 	
 	

+ 2 - 2
src/ted2/mainwindow.monkey2

@@ -21,8 +21,8 @@ Class MainWindowInstance Extends Window
 		_browsersTabView=New TabView( TabViewFlags.DraggableTabs )
 		_browsersTabView=New TabView( TabViewFlags.DraggableTabs )
 		_consolesTabView=New TabView( TabViewFlags.DraggableTabs )
 		_consolesTabView=New TabView( TabViewFlags.DraggableTabs )
 		
 		
-		_recentFilesMenu=New Menu( "Recent Files..." )
-		_closeProjectMenu=New Menu( "Close Project..." )
+		_recentFilesMenu=New Menu( "Recent files..." )
+		_closeProjectMenu=New Menu( "Close project..." )
 		
 		
 		_docsManager=New DocumentManager( _docsTabView )
 		_docsManager=New DocumentManager( _docsTabView )