Forum Replies Created
-
AuthorPosts
-
@bosh77 also you can add keys filter and use KeyChar inside:
Monkey123456789101112131415161718192021222324252627282930313233343536373839404142434445464748Namespace myapp#Import "<std>"#Import "<mojo>"Using std..Using mojo..Class MyWindow Extends WindowMethod New( title:String="Keys filtering app",width:Int=640,height:Int=480,flags:WindowFlags=Null )Super.New( title,width,height,flags )EndMethod OnRender( canvas:Canvas ) OverrideApp.RequestRender()canvas.DrawText( "Press key and look at IDE's output",Width/2,Height/2,.5,.5 )EndEndFunction Main()New AppInstanceNew MyWindow' subscribint to key events'App.KeyEventFilter+=Lambda( event:KeyEvent )If event.Type=EventType.KeyCharPrint "char: "+event.Text' we can "eat" event if needed here,' so that other listeners will not get the eventIf event.Text="@" Then event.Eat()EndifEndApp.Run()EndHi, slow answer, but maybe anyone is still interested in.
I created example app with android notifications.
There are java (native folder) and mx2 sources.
Click on notification will open your app again.
But for your purposes there is a background service needed, or not?
Sources: https://yadi.sk/d/zzm5anlVfbEYYQ
Hi, there are mojox tests – you can see them right inside ted2go ide in the Examples tab:
Attachments:
Yeah! Thanks.
There are some improvements in params hinting system, see screenshots.
This time it can show just brackets – there is no actual default value shown.
Available in dev-branch.
Is momentumscroller the same as inertial scrolling?
Little suggestion is to use floating type of incoming vectors.
Nice. But timestamp format looks like
yyyy-mm-dd hh:mm:ss
2018-11-01 18:36:10
Easy to adopt your code to that.
I will test and add realisation for all external dirs.
Hi. There is the function GetSpecialDir:String( name:String ) but it understand only “internal” and “external” params for android,
but you can extend it by changing this file
/monkey2/modules/std/filesystem/native/Monkey2FileSystem.java
add one more else branch:
Monkey1234567if( name.equals( "internal" ) ){f=Monkey2Activity.instance().getFilesDir();}else if( name.equals( "external" ) ){f=Monkey2Activity.instance().getExternalFilesDir( null );}else if( name.equals( "pictures" ) ){f=Environment.getExternalStoragePublicDirectory( Environment.DIRECTORY_PICTURES );}and rebuild std module for android target.
BoxF is an alias for Box<Float>, Box type allow us to set cubic bounds.
It has many constructors, see the sources:
https://github.com/blitz-research/monkey2/blob/develop/modules/std/geom/box.monkey2
And aren’t you gonna confuse a whole bunch of php users?!?
agree, it’s very bad idea.
If the ‘type’ of Lifestyle is Int thanks to its getter operator, how can we access Lifestyle.Changed?
yes! it’s looks impossible, and I miss it in my minds, if we have getter that return any type – we cant easily access to our parent type,
the way via casting is not what we want.
And what happens with prop1=prop2? If they are both Int Getters of the same type, should it get/set the int, or assign the entire getter, ‘Changed’ listeners and all? The sensible thing to do in all these cases is probably to treat any value with a Getter as a value of the Getters type instead (just like properties), and add new syntax to somehow ‘ignore’ the getter when you want work with the actual property-like container.
I expected to have type conversion for expressions with our type, but not for dot access case, but I see now that it’s kind of impossible.
Even if we’ll have assignment operator we’ll have no proper get operator and need to write getter explicitly:
Monkey123Local prop:=New Property<String>prop="hello"Local s:=prop.Value ' or prop.Get()Operator To:T can help in some cases but not all.
And I think now that using explicit prop.Value for setter and getter is the best solution.
Thanks for the detailed answer, Mark!
I’m thinking about assignment operator, again
And it would be enough for me to have []= operator as a special kind of assignment.
Monkey1234567891011121314151617181920212223242526272829Function Main()Local t:=New Test<Float>' special kind of assignment' equals to t.value=3.0t[]=3.0' special king of return value' equals to 10+t.valueLocal sum:=10+t[]Print t.valueEndClass Test<T>Field value:TOperator []=( value:T )Self.value=valueEndOperator []:T( i:Int=0 )Return Self.valueEndEndThis time both of these operators don’t work.
and this sounds interesting:
With a 2 line change to parser.monkey2 I can compile this
What are anyone think about it?:)
As for me – it could be a part of language, we don’t need to use it every time…
I’m using windows 10 on macbook via virtualbox.
And touchpad gestures work bad here, in ted2go too.
Cool stuff!
-
AuthorPosts


