Mattias Gärtner wrote:
> Zitat von Alexander Klenin <kle...@gmail.com>:
>   
>> I should note that I was horrified by the amount of "glue" code needed
>> to route an event through main form, source notebook, source editor and
>> SynEdit.
>>     
> The IDE is structured in a hierarchy.
>
> mainide: the top level of the IDE and the central nerve system. Because of its
> size it's splitted into several units. This is the 'integrated' in IDE. It
> connects the various modules like debugger, package system, codetools,
> designer, etc.
> source notebook: the whole source editor
> source editor: one single editor (at the moment in the same unit with source
> notebook, but should eventually split up)
> synedit: visual control
>   
Reading this, I just had an idea. (Nothing that would be done anytime 
soon, as it would be a major project)

In The current structure
SynEdit is the Visual control, and therefore also the control that takes 
all events such as mouse/key down/up/move. Often it is SynEdits work to 
react to this, but often it also needs to call back to SourceEditor.

It is at least worth reviewing if this order could/should be changed (I 
am not sure about it):
- SourceEditor could be a visual component with all the Key/Mouse event 
handlers.
- It would *not* inherit from SynEdit, but same as now it would have a 
SynEdit instance that it can make calls to. This SynEdit would not paint 
on it's own canvas, but rather paint on the SourceEditors canvas
- Instead of SynEdit making all the callbacks to SourceEditor, now all 
events go to SourceEditor first, and SourceEditor can decide what to 
forward.

On the other hand, it is probably not worth the amount of work. Well the 
future will show, if there is a use case for it...

Best Regards
Martin



_______________________________________________
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to