Pelles C forum

Pelles C => Add-ins => Topic started by: Luke on May 06, 2005, 03:34:30 AM

Title: Macros adding
Post by: Luke on May 06, 2005, 03:34:30 AM
Hi there, I am currently working on a simple text macros addin for PellesC.  This should allow you to use hotkeys to insert text and save some time.  My problems are:

What is the best way to insert a submenu of commands ?
 I could subclass the windows, but this seems a bit invasive and prone to future bugs?

Also, is there any way to integrate AddIn commands with the Keyboard customization dialog?

Cheers
- Luke
Title: Macros adding
Post by: Pelle on May 06, 2005, 01:25:55 PM
Hello,

I once decided it was better to let the IDE do some of the housekeeping for new commands, like assigning identifiers and update the menus. This is why I don't hand out, for example, menu handles directly. You can use AddIn_AddCommand to add new commands to some predefined menus and locations. Is this enough, or are you missing something here?

No integration with the keyboard customation dialog at the moment. The whole add-in thing is "work in progress". Will probably never be really finished...

Pelle
Title: Menus
Post by: Luke on May 11, 2005, 04:20:23 AM
I was using the Addcommand thingy, the only problem I came across, is that if I allow the user to define a whole lot of macros, then one ends up with a long list in the menu, which is a little unattractve.  It's not a vital point.  I guess I was only hoping I had missed something like:


int Addin_AddCommandSubMenu(...)
 returning menu id.

int Addin_AddCommandToSubmenu(int menuID, ...)

anyway, wishful thinking :)

I can add macros to the menus and it will still work okay.  As for the keyboard interface, that can be dealt with by subclassing windows, as given in one of the addin samples.

Thanks,
 - Luke [/code]
Title: Re: Menus
Post by: Pelle on May 11, 2005, 09:13:29 PM
Quote from: "Luke"
I guess I was only hoping I had missed something like:

int Addin_AddCommandSubMenu(...)
 returning menu id.

int Addin_AddCommandToSubmenu(int menuID, ...)

I never expected a long list... ;-)
Maybe I can add something in the future...

Quote from: "Luke"

As for the keyboard interface, that can be dealt with by subclassing windows, as given in one of the addin samples.

Yes, I should have mention this. It probably the easiest way...

Pelle