[Gambas-user] I added "External Tools" to my gambas :)

Bruce Steers bsteers4 at gmail.com
Tue Jan 25 18:50:28 CET 2022

On Sat, 22 Jan 2022 at 21:11, Benoît Minisini <g4mba5 at gmail.com> wrote:

> Le 22/01/2022 à 21:43, Bruce Steers a écrit :
> > Any interest Ben?
> > Here''s my branch (cleaned up)
> > https://gitlab.com/bsteers4/gambas/-/tree/External-Tools
> > <https://gitlab.com/bsteers4/gambas/-/tree/External-Tools>
> >
> > modifications to your code are minimal, just adding the menus and hiding
> > tools when not on a text editing window.
> > CExternalTools.class and FExternalTools.class/form do the rest.
> >
> > Here it is in action launching my code sorter...
> > https://bws.org.uk/gambas-screens/screenrecord-2022-01-22_19.49.51.mp4
> > <https://bws.org.uk/gambas-screens/screenrecord-2022-01-22_19.49.51.mp4>
> >
> > I'm sure how i've implemented it is terrible in the "how it should be
> > done" and quite possible in "the way i have done it" ways  🙄
> > I had an issue setting up the shortcut Ctrl+Alt+E ,  it works on QT but
> > not gtk3 so I must be doing something wrong.
> >
> > could this be merge worthy or is it just too much of a hack?  (i can
> > take the truth :) )
> >
> > Wishing Well
> > BruceS
> >
> >
> > ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
> >
> I will look at it and I tell you.
> --
> Benoît Minisini

You may want to hold off a while. I'm currently re-writing it with a
TreeView not a GridView and supporting sub-menus as i realized I may make
quite a few tools and end up with too large a menu.

plus I'm hoping a re-write will ultimately be nicer code for you.  the
change I previously made was a copy/paste of a function from one of my
other programs edited to fit into gambas so wasn't exactly made to measure.

It also has an annoying bug in the menu refreshing i need to deal with. i
made it auto-hide the tools (not the manager) when not on a text editing
page.  Will probably do away with the auto hiding of the menus and just
make the commands pop an error if run when not on a text page (better for
IDE speed to just leave the menus alone i think).

But do you like the idea at least?
With these options...
*Before running script it can format/pretty text and/or save the file*

*It can pass to the script the selected text, the whole text, the clipboard
contents, the file path/name/dir*

*After running script it can either insert result at cursor, replace whole
doc with result, reload doc or copy result to clipboard*

With just those options I am able to create all manner of funky little
tools to perform many tasks.

I know of at least one other person who thinks this feature will be a very
handy thing.

Wishing well
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20220125/de230ffe/attachment.htm>

More information about the User mailing list