About Monkey 2 › Forums › Monkey 2 Projects › Ted21 progress
This topic contains 85 replies, has 22 voices, and was last updated by
AdamStrange
2 years, 7 months ago.
-
AuthorPosts
-
August 21, 2016 at 8:44 am #3318
There are 3 things I would like to change in Ted.
- hiding monkey2 extension in the treeview (its’ annoying, and the icon should be enough)
- hiding .vbuilXXX folder – they are not very useful
- auto .monkey2 extension when saving (I’m quite sure you already did this at the start!)
Of course 1+2 should be something optional, and maybe a new voice in the contextual menu in the treeview – now it has New File, New Folder, Delete – like ‘Show All Folder’
ps: where I can download the source of your Ted2 (ASted?)
Thanks!
August 21, 2016 at 9:23 am #3321Ted21 can be found here:
https://github.com/StrangeIsMyName/monkey2
You will need V1.02 to compile ted21. it WON’T compile under V1.03!
August 21, 2016 at 10:56 am #3325Perfect, thanks!
August 21, 2016 at 11:33 am #3326let me know how you get on, I’ll sort out the monkey2 extensions for the next version for you
August 21, 2016 at 2:44 pm #3330Ok. I started with the ‘original’ Ted2 source (sorry, but the source is already here without download anything!)
I suppose this ‘piece’ of code is still the same even in your version
I changed fileactions.monkey2
Monkey123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475Method OnSave()Local doc:=_docs.CurrentDocumentIf Not doc ReturnIf MainWindow.IsTmpPath( doc.Path )Local path:=RequestFile( "Save As","",True )If Not path Return'check for .monkey2 extensionIf path.ToLower().Contains(".monkey2")=Falsepath=path+".monkey2"End Ifdoc.Rename( path )Endifdoc.Save()EndMethod OnSaveAs()Local doc:=_docs.CurrentDocumentIf Not doc ReturnLocal path:=RequestFile( "Save As","",True )If Not path Return'check for .monkey2 extensionIf path.ToLower().Contains(".monkey2")=Falsepath=path+".monkey2"End IfLocal index:=0For Local doc2:=Eachin _docs.OpenDocumentsIf doc=doc2 Exitindex+=1Nextdoc.Rename( path )doc.Save()doc.Close()_docs.OpenDocument( path,True )EndMethod OnSaveAll()For Local doc:=Eachin _docs.OpenDocumentsIf MainWindow.IsTmpPath( doc.Path )Local path:=RequestFile( "Save As","",True )If Not path Return'check for .monkey2 extensionIf path.ToLower().Contains(".monkey2")=Falsepath=path+".monkey2"End Ifdoc.Rename( path )doc.Save()doc.Close()_docs.OpenDocument( path,True )Elsedoc.Save()EndifNextEndThese are ONLY the methods I changed (OnSave, OnSaveAs, OnSaveAll).
I’ve added a simple check about the presence of ‘.monkey2’ string in Path, otherwise it will be added.
No check if there’s any other extension on it (I would like to use myname.001 as numbering version…)
I’m trying to ‘push’ this change in the GitHub repository, but it seems I need to ‘fork’ an entire project ? It seems quite useless…
August 23, 2016 at 6:47 am #3365Ok, as usual I’ve done some mess on GitHub (if I don’t something strange is not a normal day…).
In any way – following an user comment about the possibile need to save .txt .json etc file directly from TED2 I changed my update (… and I messed up things on GitHub :/)
I’ve added a sort of pre-checking. If the path name doesn’t have any ‘valid’ TED2 extensions, it will be added .monkey2
Monkey12345678910Function CheckValidExtension:Bool(t:String)Local ve:="monkey2,h,hpp,hxx,c,cpp,cxx,m,mm,s,asm,html,js,css,php,md,json,xml,ini,sh,bat,glsl,txt"Local fe:=ExtractExt(t)if fe="" Return falseFor Local e:=Eachin ve.Split(",")If fe.ToLower()="."+e Return TrueNextReturn falseEnd FunctionAnd in the module OnSave, OnSaveAs, OnSaveAll I’ve added (after If Not Path Return)
Monkey1If CheckValidExtension(path)=False path=path+".monkey2"Some considerations:
- I considered these as ‘valid’ extension simply because I found them in TED2 source (somewhere, when loading)
- I would prefer to have these parameters stored ted2.state.json – but at the moment it’s just to resolve the main problem
August 23, 2016 at 9:30 am #3366the concept is ok, implementation needs some work.
What really needs to be done is to check the type of document first, then decide what extension it should have then add if needed
I’ll look into it
August 23, 2016 at 7:09 pm #3373I’m in the process of adding something like this – new version should be up today some time.
August 26, 2016 at 2:17 am #3455Hi, Adam. Greate work!
You modified base mojox classes to bring functionality. Is it good idea? Why don’t extend them?
For example, use own
Monkey1class CodeTextDocument extends TextDocumentand put CodeTreeView inside it.
Base TextDocument need to be extended for common text operation only, not for code processing.
August 26, 2016 at 5:37 am #3458simple answer
private
anything that is private can’t be directly accessed by extending
The other thing is to do with actually learning how a system works. taking code and extending is fine if you know the code you are extending. Otherwise it is much better to augment the original or create a brand new code base.
Also. the documents are just wrappers around lower classes. and all these things are interlinked.
I wouldn’t recommend anyone going into mojox now it is a module!
September 21, 2016 at 12:53 pm #4045small bug fixes throughout – not many just code catching
Added class extends to the code view. So any extended classes also show which classes they are extending.
The new find/replace system is almost finished and also the initial new dialog. I have also completely commented the 3 base monkey2 files, so anyone who knows nothing will get lots of help about what is going on.
Attachments:
-
AuthorPosts
You must be logged in to reply to this topic.
