Quantcast

Code View GUI

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Code View GUI

wondersluyter
Hey folks,

I feel like I've seen something about this on the list before but just now I've been having a hard time finding anything by searching.... anyway, I have built / am forever working on a system for writing and firing cues to run theater shows, and I've made a little code editor GUI element using TextView, which is fine for small chunks of code but breaks down pretty badly with more significant amounts of code, to the point where it affects language timing. (https://github.com/esluyter/CodeView/blob/master/CodeView.sc)

Long story short, I am pretty motivated to dive into the Qt world and try to implement a CodeView. I've never used Qt at all and never worked with the sclang backend, so I thought I'd ask for tips before going off into the wilderness. From what I can gather, I would need to reference the c++ class in a manner like *qtClass { ^'QcCodeEdit' } and then write the corresponding class in QtCollider / widgets.... are there any other structural elements I need to be aware of?

...And really any general tips or suggestions would be super appreciated :)

Thanks,
E
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Code View GUI

julian.rohrhuber
Good idea! There has been some discussion (I don’t remember where) about refactoring the IDE a little so that the Document view could be wrapped into any sclang-side QT views. I think this would be the best direction to go, because there is mutual benefit in it for both applications, and because it might actually be easier in the end.


> On 13.05.2017, at 00:31, [hidden email] wrote:
>
> Hey folks,
>
> I feel like I've seen something about this on the list before but just now
> I've been having a hard time finding anything by searching.... anyway, I
> have built / am forever working on a system for writing and firing cues to
> run theater shows, and I've made a little code editor GUI element using
> TextView, which is fine for small chunks of code but breaks down pretty
> badly with more significant amounts of code, to the point where it affects
> language timing.
> (https://github.com/esluyter/CodeView/blob/master/CodeView.sc)
>
> Long story short, I am pretty motivated to dive into the Qt world and try to
> implement a CodeView. I've never used Qt at all and never worked with the
> sclang backend, so I thought I'd ask for tips before going off into the
> wilderness. From what I can gather, I would need to reference the c++ class
> in a manner like *qtClass { ^'QcCodeEdit' } and then write the corresponding
> class in QtCollider / widgets.... are there any other structural elements I
> need to be aware of?
>
> ...And really any general tips or suggestions would be super appreciated :)
>
> Thanks,
> E
>
>
>
> --
> View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Code-View-GUI-tp7632302.html
> Sent from the SuperCollider Developers New (Use this!!!!) mailing list archive at Nabble.com.
>
> _______________________________________________
> sc-dev mailing list
>
> info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
> archive: http://www.listarc.bham.ac.uk/marchives/sc-dev/
> search: http://www.listarc.bham.ac.uk/lists/sc-dev/search/


_______________________________________________
sc-dev mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-dev/
search: http://www.listarc.bham.ac.uk/lists/sc-dev/search/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Code View GUI

wondersluyter
Oh wow, that sounds like a bigger project than I was expecting, but I can totally see the sense in it. I wonder how color scheme would work in sclang, since Document color scheme is set in the IDE, maybe in sclang the default would be the IDE font / color scheme with option to override it?

Anyway, I'm not sure my c++ chops are up to an IDE refactor (it's been years since I did anything remotely serious in c++), but I'll poke at the IDE tomorrow and see what happens, wish me luck :)

(Ps I did earlier today implement a very rudimentary plaintext view with line numbers and syntax highlighting, the other route that I was thinking about was simply stealing the syntax highlighting from the IDE for a basic view like this, which would at least solve the processing woes of using a TextView for long chunks of code. But making Document view work in sclang would be very much preferable I know so I will give it my best crack.)



On May 15, 2017 2:36 PM, <[hidden email]> wrote:
Good idea! There has been some discussion (I don’t remember where) about refactoring the IDE a little so that the Document view could be wrapped into any sclang-side QT views. I think this would be the best direction to go, because there is mutual benefit in it for both applications, and because it might actually be easier in the end.


> On 13.05.2017, at 00:31, [hidden email] wrote:
>
> Hey folks,
>
> I feel like I've seen something about this on the list before but just now
> I've been having a hard time finding anything by searching.... anyway, I
> have built / am forever working on a system for writing and firing cues to
> run theater shows, and I've made a little code editor GUI element using
> TextView, which is fine for small chunks of code but breaks down pretty
> badly with more significant amounts of code, to the point where it affects
> language timing.
> (https://github.com/esluyter/CodeView/blob/master/CodeView.sc)
>
> Long story short, I am pretty motivated to dive into the Qt world and try to
> implement a CodeView. I've never used Qt at all and never worked with the
> sclang backend, so I thought I'd ask for tips before going off into the
> wilderness. From what I can gather, I would need to reference the c++ class
> in a manner like *qtClass { ^'QcCodeEdit' } and then write the corresponding
> class in QtCollider / widgets.... are there any other structural elements I
> need to be aware of?
>
> ...And really any general tips or suggestions would be super appreciated :)
>
> Thanks,
> E
>
>
>
> --
> View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Code-View-GUI-tp7632302.html
> Sent from the SuperCollider Developers New (Use this!!!!) mailing list archive at Nabble.com.
>
> _______________________________________________
> sc-dev mailing list
>
> info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
> archive: http://www.listarc.bham.ac.uk/marchives/sc-dev/
> search: http://www.listarc.bham.ac.uk/lists/sc-dev/search/


_______________________________________________
sc-dev mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-dev/
search: http://www.listarc.bham.ac.uk/lists/sc-dev/search/

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Code View GUI

wondersluyter
OK, update: after messing about with the IDE editor code and trying to make a class that works both for the IDE editor and QtCollider, I can confirm that my skills are not up to the task of refactoring. I would be very happy though to work on this project with someone else who is more knowledgeable than I am.

But, I did succeed in making an editor widget from scratch, which works plenty well for my purposes.

So, if people want, I can work on streamlining my own widget and submit a PR; or if there is someone who can help me set up the infrastructure, I can work on refactoring the IDE view. Thoughts?

(here is a screenshot of my widget in action...)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Code View GUI

James Harkins
On May 21, 2017 10:47:13 [hidden email] wrote:

> So, if people want, I can work on streamlining my own widget and submit a
> PR; or if there is someone who can help me set up the infrastructure, I can
> work on refactoring the IDE view. Thoughts?

On my wishlist for this (and sorry to mention it late) would be a way to
customize the colorizing. I would use this for my live coding dialect,
where the syntax of statements beginning with "/" differs substantially
from normal SC syntax.

I might end up using this or TextView for live coding, because I also have
some code to cursor-navigate through live-coding expressions based on
syntax, but it won't work with the IDE because the IPC between language and
IDE makes it impossible for the language to suppress the default Qt key
actions (whereas, with TextView, the view is in the language process so
it's easy). Colorizing would be nice, but not useful for live coding if
it's restricted to SC syntax.

hjh

Sent with AquaMail for Android
http://www.aqua-mail.com




_______________________________________________
sc-dev mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-dev/
search: http://www.listarc.bham.ac.uk/lists/sc-dev/search/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Code View GUI

wondersluyter
Cool, I actually have already implemented custom coloring in my widget, for example to colorize all (non-comment) lines starting with "/" you could say:

t.setProperty(\userColor, ["/.*", Color.red])

and you can repeat this to specify an arbitrary number of custom rules. Does that sound like what you're after?

On Sun, May 21, 2017 at 1:32 PM, Eric Sluyter <[hidden email]> wrote:
Cool, I actually have already implemented custom coloring in my widget, for example to colorize all (non-comment) lines starting with "/" you could say:

t.setProperty(\userColor, ["/.*", Color.red])

and you can repeat this to specify an arbitrary number of custom rules. Does that sound like what you're after?


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Code View GUI

Ales Tsurko
In reply to this post by wondersluyter
Hi,

Also check out my SC wrapper for the Ace editor: https://github.com/AlesTsurko/Iannis/tree/master/multipurpose/ace
Ace already has a lot of features: you can add snippets, keybindings, there is a lot of themes and far more: https://ace.c9.io
My fork of the Ace itself, but with SC support is here:
https://github.com/AlesTsurko/ace
Loading...