Pelles C forum

Pelles C => Add-ins => Topic started by: kankamuso on April 10, 2007, 01:45:35 AM

Title: AStyle Add-In
Post by: kankamuso on April 10, 2007, 01:45:35 AM
A simple add-in to integrate AStyle into the IDE.

Install the add-in DLL, copy astyle.exe and astyle.cfg (both included) into Pelles C bin folder, tweak astyle.cfg (optional) and you'll have "AStyle" option in the editor context menu (in "Source" menu too).

I hope this is useful for someone besides myself. Maybe someone with more C/Windows API experience could clean the code and improve things here and there. If anyone does it, please post the improved add-in here.

BTW: Is there any way to assign a keyboard shortcut to an add-in?
Title: Re: AStyle Add-In
Post by: Pelle on April 10, 2007, 04:08:34 PM
BTW: Is there any way to assign a keyboard shortcut to an add-in?
No - add-ins are too 'dynamic' by nature, so it would be hard to implement. I have never tried it, but perhaps the add-in could assign it's own key through 'subclassing' (perhaps using the UCase add-in sample as a start...?)
Title: Re: AStyle Add-In
Post by: kankamuso on April 10, 2007, 11:39:00 PM
Thanks a lot, Pelle. You confirm what I thought about managing hotkeys for add-ins: it would be hard. But your suggestion was correct: I've been able to add a hard-coded hotkey through subclassing.

Greetings.
Title: Re: AStyle Add-In
Post by: jmuhammad on March 24, 2014, 06:59:17 AM
I wrote a small program (BeautifyPellesC.exe) to call AStyles and passing it Pelles C's current filename.
I assigned the program to a Pelles C user tool and assigned the tool a hotkey (I chose 'F12').

Screenshot of 'Edit Tool' menu and program are attached.
Simply edit the 'Command' text box with the location of BeautifyPellesC.exe.