Forum Replies Created
-
AuthorPosts
-
Nice work!
About scroll. There is no such property in mojox. Try to use
maxScroll=Max ( 0, Rect.Height-VisibleRect.Height )
There is a short article “How to use SourceTree app for managing git repository”.
Install & Account
Install app from here: https://www.sourcetreeapp.com
Enter your git account info to get access to github (there is a prompt for first start).
Clone monkey2
Start app and press Clone/Add (see st-1.png).
In clone dialog (see st-2.png):
- paste monkey2 repository url,
- select folder to copy into (if folder exists it must be empty),
- enter name for repo (it’s bookmark for soursetree),
- and press Clone button.
- wait loading
App overview
See st-3.png
After loading you will stay on default branch – master.
To use develop or any other branch, you need to checkout it.
- Look at Remotes list below master branch.
- Right-click on remotes::origin::develop and choose “Checkout origin/develop…” and press Ok.
- Ok, now you stay on develop branch (bold font).
To change local branch simply double-click on one of them.
To grab new stuff – just press Pull button on main toolbar.
Pull and run rebuildall script if needed.
Any questions?
I have a few game prototypes written on monkey1, not completed yet.
After I tried unity3d I thought that I don’t want to use only ‘raw’ code now, editor-based development is fast and comfortable! A huge resulting package is a ‘minus’…
The biggest negative thing in monkey1 for me was that there is no ‘normal’ fonts (ttf).
But I was impressed with awarded New Star Soccer game written on monkey1: http://www.monkey-x.com/Apps/app.php?id=146
and Crypt of the NecroDancer http://store.steampowered.com/app/247080
This time you can change existing colors via themes – look into ted2go/assets/themes/.
There are text-color1, text-color2,…. inside of theme’s files. They used for highlighting.
Info about each of color is here http://monkey2.monkey-x.com/forums/topic/ted2go-fork/page/4/#post-5071
I looked the code. The file ted2textview.monkey2 contains needed logic
Monkey12345678910111213141516171819202122232425262728293031323334353637Class Ted2CodeTextView Extends CodeTextViewProperty FileType:String() 'where else we can store this type?return _typeSetter( value:String )_type=valueKeywords = KeywordsManager.Get(_type)Highlighter = HighlightersManager.Get(_type) '<==== HEREFormatter = FormattersManager.Get(_type)Document.TextHighlighter = Highlighter.PainterEndProperty FilePath:String()return _pathSetter(value:String)_path = valueEndProtectedMethod OnKeyEvent( event:KeyEvent ) OverrideTextViewKeyEventFilter.FilterKeyEvent( event,Self,FileType )If Not event.EatenSuper.OnKeyEvent( event )EndifEndPrivateField _type:StringField _path:StringEndSo you should extend Ted2CodeTextView and set properly FileType property to make it works.
Also ReadOnly=True will be good.
To avoid applying to the normal CodeTextView you should add custom style for CodeMap – add new style in ted-default.json theme and then load it in CodeMap :: New()
Monkey12345Method New()Super.New()Style=GetStyle( "CodeMap" )Style.Font = Font.Load(“DejaVuSansMono.ttf”,5)EndRight, not all is easy as we want.
But in your case you can ‘just’ use my CodeTextView to draw codemap, only thing is to set small font.
Or maybe change canvas.scale (not sure that will works) inside on your codemap OnRender.
Monkey1234Method OnRender( canvas:Canvas )canvas.Scale=0.1Super.OnRender( canvas )EndIn two words..
All Views extends base class View.
You need to draw text with highlighting, so is better to extends codetextview class (from ted2go/views folder) and customize font size.
Then add this view into codedocument in place where original codetextview added.
And write custom logic in OnRender and OnContentMouseEvent.
Also need to subscribe on codeView.TextChanged event to refresh text in your codemap view.
In the latest example we got endless loop. Should replace ‘continue’ with ‘exit’.
Thanks.:)
Oh.. I never work on macos and don’t know about usual shortcuts for it. But I think I’ll add correct values soon.
New stuff in repository!
New / Improve:
- Feature – navigate back / forward via alt+left / alt+right or toolbal buttons. Stored points – jumping via CodeTree or via ‘Goto declaration’.
- Feature – open docs from args, so we can create file association for .monkey2 files with ted2. Worked fine, but files looked bad because there is no good ted2.exe icon.
- Editor – added smart text insertion (with correct indent of whole inserted block, I hope you’ll see the profit).
- Goto declaration – added shortcut F12, like in VStudio. I am going to remove F2 later.
- Macos – added cmd+left/right to go home/end of line. (not tested)
Fixes
- Fixed multiline string highlighting.
- Fixed tab behaviour in code view.
- Fixed capitalization not worked (grabbed from ted2).
- Fixed first-start window size – make window smaller than real desktop size.
- Macos – disabled line removing via ctrl+e. (not tested)
Autocompletion
- Choose by TAB now! So we can comfortable using Enter when a/c list is opened. It’s useful at least until working parsing of local variables. I think to add Enter key as optional case.
- Show entities from super class and interfaces.
- Show entities from aliases.
Attachments:
So there is no bug in monkey. We should check numpad state. I will add it.
Ok. I’ve added a new issue to Mark.
Open ted2go project and there open views/textviewext.monkey2. There goto OnKeyEvent () and add line
Print “key: “+event.Key
Run project and see console when pressing your keys.
Can you check what values are stored in event.Key for your desired keys ?
-
AuthorPosts



