Code tab in GP

Extending or modifying the GP system itself (advanced!)

Moderator: MSandro

Post Reply
MSandro
Posts: 162
Joined: Jul 26th, '17, 21:12

Code tab in GP

Post by MSandro » May 29th, '18, 06:42

What do you think about this additional tab which I've added to GP.
code.png
It shows the code of the current class. I would like to create a better text-based script editor, because in my opinion the current implementation is not well implemented.
I am still working on the possibility to save back the code in its class at my new tab.

What I've already done:
> added "Code" tab to the TabsBar (based on the NoteView)
> the text updates now automaticaly on switching to an other class

What I have to add:
> save feature (maybe a button or a context menu option)
> DoIt feature (run a marked code for the currently selected instance)

What I probably can't add:
> maybe Syntax Highlighting
> code validation

The last two features are not posible (nut sure but I think) because it is not posible to give a string-part in a textBox a different color. A textBox has a defined font, color and size.

User avatar
Calloway
Posts: 98
Joined: Apr 30th, '18, 00:28
Location: Eastern United States

Re: Code tab in GP

Post by Calloway » May 29th, '18, 21:34

Wait so this would make it possible to write with both blocks and code?
If you save the code does it show the block form of that code...

This is an interesting idea and I love it

MSandro
Posts: 162
Joined: Jul 26th, '17, 21:12

Re: Code tab in GP

Post by MSandro » May 30th, '18, 06:18

Yes it should make it posible to work with both, blocks and code. It should be able to switch seamlessly between modes. I added this tab because I'm not exactly satisfied with GP's current text mode.

I want to add a save button to the page. If you switch from "Code" to "Scripts" the code should be automaticaly saved to the class to show the changes in the scripting area. It should automaticaly save and reload the code on switching to a other class. Maybe you know the "do it" feature in the context menu of the workspace. I want to implement this feature in the code area, so you should be able to mark your code, click "do it" and it should be run on you selected instance, like in the scripter where you can cklick a script to run it for the current instance.

If posible I want to implement a syntax highlighting feature to it :D But currently I am not sure if a single TextBox is able to render different formated text.


It all seems very complicated, I'm not sure if I'm successful with my plans.
But I think this is all a lot of work.

User avatar
Calloway
Posts: 98
Joined: Apr 30th, '18, 00:28
Location: Eastern United States

Re: Code tab in GP

Post by Calloway » May 30th, '18, 06:22

If you manage to do this it would be another good 'selling point' for GP because it would allow for even more connections between the blocks and the code (assuming the situation is for education)
You've done a lot of work for GP I don't get why you're not a developer by now hehe

User avatar
Picochilla
Posts: 28
Joined: Sep 23rd, '17, 17:44

Re: Code tab in GP

Post by Picochilla » Jun 3rd, '18, 10:05

Wow realy nice idea. Good luck for realising your plans. I am sure that syntax highlighting is not posible whit the current Text-Morphs because they only support one preset for all text in it. You need to create your own text renderer.

Post Reply