[Gambas-user] Positioning the editor to a specific line and making it visible

Bruce bbruen at ...2308...
Wed Jan 15 01:44:53 CET 2014


I can't work out how to do this.

I have an Editor control with a form definition (xyz.form) in it, I am
trying to search for the definition of, say, a toolbar called
"tbrProjectEdit" which starts at line 220.  This is initiated by a
double click on a gridview on the "Toolbars" tab in the screenshot.

Public Sub gvwToolbars_Activate()

  Dim sKey As String = gvwToolbars[gvwToolbars.Row,
gvwToolbars.Column].Text
  Dim iLine As Integer
  
  ...

  If gvwToolbars.Column = 1 Then 
    iLine = edtFormDef.FindNextWord(skey, 0)      <-- 1
    edtFormDef.Select(iLine, 0, iLine, 999)       <-- 2
    edtFormDef.CurrentLine = iLine                <-- 3
    ' edtFormDef.Lines[iline].Expanded = True
    ' edtFormDef.Scroll(edtFormDef.ToPosX(0, iLine), 0)
    edtFormDef.SetFocus
    TabStrip1.Index = 0
  Endif
  
End

1) Finds the line fine.
2) Sets the selection fine.
3) and the next two lines are my attempts at making that line visible in
the editor. To no avail.  It just remains at the top of the text.
But, if I just adjust the size of the form a touch, the editor is
redisplayed exactly where I want it, as in the 2nd screenshot.

What am I missing?

tia
Bruce
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GB3 Form Definition : Def.png
Type: image/png
Size: 45981 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20140115/4be66db6/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GB3 Form Definition : -Def2.png
Type: image/png
Size: 56083 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20140115/4be66db6/attachment-0001.png>


More information about the User mailing list