From 45a968480ded142ee4d914e86899db8c8388b183 Mon Sep 17 00:00:00 2001 From: Fabien Bodard Date: Sun, 2 Aug 2009 10:55:34 +0000 Subject: [PATCH] [DEVELOPMENT ENVIRONMENT] * BUG: Now the local help link save the cursor position before open the targeted class. git-svn-id: svn://localhost/gambas/trunk@2204 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- app/src/gambas3/.src/Debug/FHelp.class | 62 +++++++++++--------------- 1 file changed, 26 insertions(+), 36 deletions(-) diff --git a/app/src/gambas3/.src/Debug/FHelp.class b/app/src/gambas3/.src/Debug/FHelp.class index b116d272f..a419c1731 100644 --- a/app/src/gambas3/.src/Debug/FHelp.class +++ b/app/src/gambas3/.src/Debug/FHelp.class @@ -4,6 +4,7 @@ Private Sub ShowHelp(hEditor As Editor) Dim iX, iY As Integer Dim hCont As Container + If Not FDebugInfo.IsHelpVisible() Then Me.Background = Color.LightBackground Me.Ignore = True @@ -15,8 +16,10 @@ Private Sub ShowHelp(hEditor As Editor) If (iY + Me.Height) > (hEditor.Y + hEditor.H) Then iY = hEditor.Y + hEditor.CursorY - 15 - Me.Height Endif + hcont = hEditor.Parent iX = hEditor.CursorX + Do If hCont Is Form Then Break @@ -26,9 +29,7 @@ Private Sub ShowHelp(hEditor As Editor) Loop iX = Max(0, Min(iX, hEditor.W - Me.Width)) - Me.Move(iX, iY) - Me.Visible = True Form_Show hEditor.Window.SetFocus @@ -40,12 +41,8 @@ End Public Sub ShowKeywordHelp(hEditor As Editor, sName As String, Optional sName2 As String) As Boolean Dim sPath As String - - txtHelp.RichText = "" & sName & "" - txtHelp.RichText &= "
Kind: Gambas Keyword: " - - 'txtHelp.RichText &= GetHelp(GetPath("help/lang/type" &/ LCase(sName)) & ".html") - + txtHelp.RichText = "" & sName & "" + txtHelp.RichText &= "
Kind: Gambas Keyword: " If sName2 Then If Not ShowKeywordHelp(sName2) Then Return @@ -56,11 +53,11 @@ Public Sub ShowKeywordHelp(hEditor As Editor, sName As String, Optional sName2 A sPath = GetPath("help/lang" &/ LCase(sName)) & ".html" If Not Exist(sPath) Then Return True txtHelp.RichText &= GetHelp(sPath) - 'Project.OpenWebPage(sPath) ShowHelp(hEditor) + Catch - Return True + End @@ -74,14 +71,16 @@ Public Sub ShowSymbolHelp(hEditor As Editor, hSymbol As CSymbolInfo) txtHelp.RichText = IIf(hSymbol.IsStatic(), "STATIC", "") & " " & IIf(hSymbol.NotPublic, "PRIVATE", "PUBLIC") & " " & Replace(hSymbol.GetDescription(), hSymbol.Name, "" & hSymbol.Name & "") txtHelp.RichText &= "
Kind: " - Select Case hSymbol.Kind + Select Case LCase(hSymbol.Kind) Case "v" txtHelp.RichText &= "Variable" Case "p" - txtHelp.RichText &= "Property" + txtHelp.RichText &= "Read/Write Property" + Case "r" + txtHelp.RichText &= "Read only Property" Case "m" txtHelp.RichText &= "Sub/Function" - Case "C" + Case "c" txtHelp.RichText &= "Constant" Case "t" txtHelp.RichText &= "Form control" @@ -105,22 +104,22 @@ Public Sub ShowSymbolHelp(hEditor As Editor, hSymbol As CSymbolInfo) If hSymbol.Kind = "t" Then txtHelp.Text &= Subst("
Def.: &1.&2", hSymbol.Class, hSymbol.name) 'Filiation - txtHelp.RichText &= Subst("
&1 > &2", hSymbol.Component, sClass) + txtHelp.RichText &= Subst("
&1 > &2", CComponent.Classes[sClass].Component, sClass) + sName = LCase(IIf(hSymbol.Kind = "t", sClass, hSymbol.Name)) - sName = LCase(hSymbol.Name) If Right(sName) = "$" Then sName = Left(sName, -1) If hSymbol.Component = "gb" And If hSymbol.Class = "." Then sLink = "help/lang" Else sLink = "help/comp" - sComp = hSymbol.Component + sComp = CComponent.Classes[sClass].Component If sComp = "gb.qt4" Or If sComp = "gb.gtk" Or If sComp = "gb.gui" Then sComp = "gb.qt" sLink &= "/" & sComp If hSymbol.Class <> "." Then sLink &= "/" & LCase(sClass) Endif - sLink &/= sName + sLink &/= sName If Exist(GetPath(FormatName(sLink)) & ".html") sLink = GetPath(FormatName(sLink)) & ".html" @@ -128,9 +127,10 @@ Public Sub ShowSymbolHelp(hEditor As Editor, hSymbol As CSymbolInfo) sLink = "http://gambasdoc.org" &/ sLink & "?v3&" & GetLanguage() Endif txtHelp.RichText &= GetHelp(sLink) - Endif + ShowHelp(hEditor) + End @@ -140,22 +140,19 @@ Public Sub ShowClassHelp(hEditor As Editor, sComponent As String, sName As Strin txtHelp.RichText = "" & sName & "" txtHelp.RichText &= "
Kind: Class" txtHelp.RichText = Subst("
&1", sComponent) - 'txtHelp.RichText = "Component: " & sComponent & - ' "   Class: " & sName + ShowHelp(hEditor) + End Private Function GetHelp(sFile As String) As String Dim aHelp As String[] - 'FDebugInfo.SetHelpVisible + If Exist(sFile) Then ahelp = Scan(File.Load(sFile), "*
**") - Return "
" & aHelp[1] - 'Else - ' Return "Help Not Found" Endif Catch @@ -167,20 +164,14 @@ Public Function ShowDatatypeHelp(hEditor As Editor, sName As String) As Boolean Dim sPath As String - sPath = GetPath("help/lang/type" &/ LCase(sName)) & ".html" If Not Exist(sPath) Then Return True txtHelp.RichText = "" & sName & "" txtHelp.RichText &= "
Kind: DataType" - 'txtHelp.RichText = sName - 'txtHelp.RichText = "Gambas DataType: " & sName - txtHelp.RichText &= GetHelp(GetPath("help/lang/type" &/ LCase(sName)) & ".html") + ShowHelp(hEditor) -'Catch - -' Return True End @@ -226,9 +217,8 @@ Private Function GetLocalHelp(hSymbol As CSymbolInfo) As String hForm = Project.LoadFile(sClass) Try hEdit = hForm.Editor If Not hEdit Then Return - 'hEdit.Goto(hSymbol.HelpLineNumber, 0) - - iLine = hSymbol.HelpLineNumber + + iLine = hSymbol.HelpLineNumber If hSymbol.HelpLineNumber Then sResult &= "
" @@ -281,12 +271,12 @@ Public Sub txtHelp_Link(Path As String) If Left(Path, 6) = "file:/" Then aRes = Scan(Path, "file://*.*") - + Project.SavePosition() Project.OpenFile(Project.FindPath(aRes[0]), CInt(aRes[1])) - Endif If Left(Path, 6) = "form:/" Then aRes = Scan(Path, "form://*.*") + Project.SavePosition() Project.OpenForm(aRes[0],, aRes[1]) Endif