Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-01

Command constants (Lazarus internals)

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Juha Manninen

Hi,

About Lazarus internal code:
I was planning to combine command constants from
lazarus/components/synedit/SynEditKeyCmds.pp
into
lazarus/ideintf/IDECommands.pas

Now I realize SynEdit is a component which can be used in other projects (not just Lazarus), so the constants can't be moved. (?)

Otherwise this refactoring would be logical because many of those editor commands can be used elsewhere in Lazarus, like undo and copy/paste in form designer.

I also would have changed those constants to enum to get rid of the const array name mappings.

Juha Manninen

Reply by email

Mattias Gärtner
to Juha Manninen

Zitat von Juha Manninen :

Show quoted text 10 lines
Hi, About Lazarus internal code: I was planning to combine command constants from lazarus/components/synedit/SynEditKeyCmds.pp into lazarus/ideintf/IDECommands.pas Now I realize SynEdit is a component which can be used in other projects (not just Lazarus), so the constants can't be moved. (?)

Correct.

Show quoted text 6 lines
Otherwise this refactoring would be logical because many of those editor commands can be used elsewhere in Lazarus, like undo and copy/paste in form designer. I also would have changed those constants to enum to get rid of the const array name mappings.

I removed them in 23531.

Mattias

Reply by email

Juha Manninen
to Mattias Gärtner
> I also would have changed those constants to enum to get rid of the const > array name mappings. I removed them in 23531.

Yes I see. Is it so easy? I still don't seem to understand the command and shortcut code fully. Where does the textual name for the command come from in your new code (like IDECommandToIdent)?
I only see a name in TKeyCommandRelationList.CreateDefaultMapping in unit KeyMapping, but it is a longer name, not the same as in the (now gone) const array had.

What do you say about my patch? The SynEdit commands can be used for Designer when mapped correctly and the code works.
Maybe there is a bigger plan for forwarding the commands. Now I just forwarded some of them.

Regards,
Juha Manninen

Reply by email