[DEVELOPMENT ENVIRONMENT]

* NEW: Local symbol help now accept multiline


git-svn-id: svn://localhost/gambas/trunk@2163 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Fabien Bodard 2009-07-24 21:19:19 +00:00
parent 087547a6c4
commit 2568642c5b
2 changed files with 28 additions and 6 deletions

View file

@ -674,7 +674,8 @@ Static Private Sub ScanClass(hModule As Object, cSymbol As Collection, bModule A
Dim sLine As String
Dim iPos As Integer
Dim sSign As String
Dim iLastHelpLine As Integer
Dim bIsSameHelpBlock As Boolean
'Debug "ScanClass "; hModule.Name
'DEBUG "> "; hModule.Name
@ -703,6 +704,15 @@ Static Private Sub ScanClass(hModule As Object, cSymbol As Collection, bModule A
aSym = Highlight.Analyze(hEditor.Lines[iLine].Text)
If aSym.Count = 0 Then Continue
'Gestion de l'aide
If Left(aSym[0], 2) = "''" And iLastHelpLine < iLine Then
If Not bIsSameHelpBlock Then iLastHelpLine = iLine
bIsSameHelpBlock = True
Else
bIsSameHelpBlock = False
Endif
If aSym.Count = 2 Then
If bCanInherit Then
If aSym[0] = "INHERITS" Then
@ -785,7 +795,7 @@ Static Private Sub ScanClass(hModule As Object, cSymbol As Collection, bModule A
.Kind = sKind
.NotPublic = Not bPublic
.LineNumber = iLine + 1
.HelpLineNumber = GetHelpLine(iLine, hEditor)
.HelpLineNumber = iLastHelpLine
If sKind = "m" Then
For iStart = iInd + 1 To aSym.Count - 1

View file

@ -142,14 +142,26 @@ End
Private Function GetLocalHelp(hSymbol As CSymbolInfo) As String
Dim hForm As Object
Dim hEdit As Editor
Dim sClass As String
Dim sClass, sResult, s As String
Dim iLine As Integer
sClass = Project.FindPath(hSymbol.Class)
hForm = Project.LoadFile(sClass)
Try hEdit = hForm.Editor
If Not hEdit Then Return
'hEdit.Goto(hSymbol.HelpLineNumber, 0)
If hSymbol.HelpLineNumber Then Return Mid(LTrim(hEdit.Lines[hSymbol.HelpLineNumber].Text), 2)
If hSymbol.HelpLineNumber Then
iLine = hSymbol.HelpLineNumber
sResult = "<b><u>Syntax</u></b><br>"
sResult &= hSymbol.Name & hSymbol.GetSignature(0) & "<br><br>"
Do
s = LTrim(hEdit.Lines[iLine].Text)
If Left(s, 2) <> "''" Then Break
sResult &= Mid(s, 3) & "<br>"
Inc iLine
If iLine >= hEdit.Lines.Count Then Break
Loop
Return sResult
Endif
End