[Gambas-user] Editor Window
Christopher Brian Jack
brian at ...1334...
Fri Mar 24 23:31:15 CET 2006
On Fri, 24 Mar 2006, ron wrote:
> Wel the highlight is made special for HTML syntax code.
My application needs go a bit beyond markup higlighting so I am trying to
find out more about more of the Editor control functionality.
> For me the interesting one is the dual editor.
My observation of the FEdit example indicates that the editing stack
(multiple views) was implemented by using a vertical split control, a
second editor control and assigning the View property of the second editor
with the first.
> I can not find how the 2 editors are connected to the same text data.
> Only Editor1 gets a 'download.html' file but visible in both :ask:
> Seen in function for VSplit using editor.view but no help local for it.
In abscence of a VSplit control you can use:
Editor2.View=Editor1
in form_Open().
The two editors can be of different style but the highlighting uses the
highlight mode of the first Editor control.
All you do is set the View property of additional editors to the first and
that effectively links them together. I just tried this in my own form
and it works (I'm using 1.9.25) exactly as it should. The VSplit control
is optional but using it allows independant resizing of the views. I
imagine even three or more editors may be linked the same way.
Furthermore you might even get away with linking across forms if you make
them visible outside the form either by enabling "Form Controls are
Public" for the project or creating them in the forms using something
like:
Public Editor1 AS New Editor 'in Form1
Public Editor2 AS New Editor 'in Form2
and in form_Open() of Form2:
Editor2.View=Form1.Editor1
> Special interest how the interaction is bind between 2 editors.
> It dos not matter in wich I type, in both the result.
Yes that is a useful feature. Again the View property is the key.
> I once put 2 editors in the IDE editor for above purpose but had to use the
> editor.change to keep them synchroon.
It is possible that GambasEditor does not support the View property like
the Editor control does.
> So question arise, can I place 2 editors the same way in the IDE with VSplit?
> The second one as viewer for lookup, copy-2 and past-1 operations.
> No direct edit needed but handy.
You could use a workaround -- two Editors with the highlight mode set to
the constant Highlight.Gambas then have any "slave" editors just patch
into the first using the View property of the slaves.
> I wil try next week but do not want distroy the current working of FEditor
> for the other parts as i.e. Editor.Analize .Symbols etc.
>
> Ron
.=================================================.
| Christopher BRIAN Jack aka "Gau of the Veldt" |
+================================================='
| brian _AT_ brians-anime _DOT_ com
`=================================================-
Hi Spambots, my email address is sputnik at ...1334...
More information about the User
mailing list