[Gambas-user] Positioning the editor to a specific line and making it visible
Bruce
bbruen at ...2308...
Wed Jan 15 08:31:25 CET 2014
On Wed, 2014-01-15 at 03:44 +0100, Benoît Minisini wrote:
> Le 15/01/2014 01:44, Bruce a écrit :
> > I can't work out how to do this.
blah, blah, blah
> > tia
> > Bruce
> >
>
> The CurrentLine is for highlighting the current line of code during a
> debugging session.
>
> Use the Editor.Goto() method instead.
>
> Regards,
>
Well, that makes sense. But I tried it and it still didn't show the
indicated line.
I tried a work-around as follows:
If gvwToolbars.Column = 1 Then
iLine = edtFormDef.FindNextWord(skey, 0)
edtFormDef.Goto(iline, 0, True)
Desktop.SendKeys("[Begin]{[Shift_L][End]}") <== this works
TabStrip1.Index = IDX_DEFFILE
Endif
Then suddenly, while I was writing this, I had a brainwave!
This works:
If gvwToolbars.Column = 1 Then
iLine = edtFormDef.FindNextWord(skey, 0)
TabStrip1.Index = IDX_DEFFILE <== This is the trick
edtFormDef.Goto(iline, 0, True)
Endif
by making the editor control active (its the only control on the
TabStrip1[IDX_DEFFILE] tab) BEFORE doing the Goto all of a sudden it all
becomes magic again.
Phew! I was getting (more) worry lines reading the IDE code and seeing
the FGotoLine work but I couldn't.
Cest la vie!
Bruce
p.s. Probably suggests a help file comment, but I'm two days behind
schedule now. I'll see to it when I catch up.
More information about the User
mailing list