Lisp HUG Maillist Archive

simple (embedded) code editor

I want to bounce this idea off of anyone - just in case I'm re-inventing the 
wheel or digging myself into a big hole...


Summary:

I need to add a "simple" code editor to my Windows (LWW-based) product, with 
a "familiar" Windows user interface (like Notepad).  I need to control the 
editor programmatically (i.e. load/save via toolbar buttons, etc).  In the 
future, I'm going to want to add stuff like syntax colouring (for a 
proprietary, app-specific language).

I'm currently doing this by using a capi:editor-pane with no echo pane 
(customers are confused by the existence of the echo pane) and 
reading/writing the buffer manually (as demo'ed in the capi user manual)[*].  

To deal with the lack of echo pane (you get an error if a command tries to use 
a non-existent echo pane), I am going to have to trap all commands that try 
to use the echo pane and either disable them or write replacements that use 
dialog boxes (e.g. Notepad-like "Find", "Replace", etc).  Probably by making 
my own local hacked copies of msw-key-binds.lisp and 
selection-key-binds.lisp.


Questions:

a) Has this been done before and is the code available?

b) Is this the most reasonable approach, or am I missing some other capi 
doo-dads that are closer to my requirements?

c) Is there some emminently COM-programmable 3rd party (free or cheap, low 
learning curve) Windowsy editor already out there for me to harvest via ffi / 
COM?  (It needs to be integrated into my gui.)


thanks for any advice
pt


[*] I'm using only a single buffer, because I can't seem to be able to 
reliably control the multi-buffer system of the lw editor - esp. which window 
a buffer appears in.  And, I don't really need multi-buffering in the 
product.


Re: simple (embedded) code editor

Paul Tarvydas wrote:

> To deal with the lack of echo pane (you get an error if a command tries to use
> a non-existent echo pane), I am going to have to trap all commands that try
> to use the echo pane and either disable them or write replacements that use
> dialog boxes (e.g. Notepad-like "Find", "Replace", etc).  Probably by making
> my own local hacked copies of msw-key-binds.lisp and
> selection-key-binds.lisp.
>
>
> Questions:
>
> a) Has this been done before and is the code available?

The thread in http://thread.gmane.org/gmane.lisp.lispworks.general/3789/focus=3798
discusses getting rid of key bindings to commands that use the echo pane.

I don't know the answer to your other questions.

Arthur


Re: simple (embedded) code editor

On 15/11/2006 20:21, Paul Tarvydas wrote:
> I want to bounce this idea off of anyone - just in case I'm re-inventing the 
> wheel or digging myself into a big hole...
>
>
> Summary:
>
> I need to add a "simple" code editor to my Windows (LWW-based) product, with 
> a "familiar" Windows user interface (like Notepad).  I need to control the 
> editor programmatically (i.e. load/save via toolbar buttons, etc).  In the 
> future, I'm going to want to add stuff like syntax colouring (for a 
> proprietary, app-specific language).
>
> I'm currently doing this by using a capi:editor-pane with no echo pane 
> (customers are confused by the existence of the echo pane) and 
> reading/writing the buffer manually (as demo'ed in the capi user manual)[*].  
>
> To deal with the lack of echo pane (you get an error if a command tries to use 
> a non-existent echo pane), I am going to have to trap all commands that try 
> to use the echo pane and either disable them or write replacements that use 
> dialog boxes (e.g. Notepad-like "Find", "Replace", etc).  Probably by making 
> my own local hacked copies of msw-key-binds.lisp and 
> selection-key-binds.lisp.
>   

Just a general word of caution. There seems to be a move towards 
embedded echo-area-like dialogs, eg see "Find In This Page" in Mozilla 
Firefox. You may be heading away from the new UI fashion.

__Jason


Updated at: 2020-12-10 08:47 UTC