From c8e08d651d505491bf207cd9efedc773c9ab7ccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Mon, 19 Nov 2012 00:38:24 +0000 Subject: [PATCH] [DEVELOPMENT ENVIRONMENT] * BUG: Fix the documentation pages of libraries and current project. * NEW: Generate a documentation page for components and libraries. git-svn-id: svn://localhost/gambas/trunk@5338 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- app/src/gambas3/.lang/.pot | 242 +++++------ .../gambas3/.src/Component/CClassInfo.class | 225 +++++++++- .../gambas3/.src/Component/CComponent.class | 61 ++- .../gambas3/.src/Component/CSymbolInfo.class | 53 ++- app/src/gambas3/.src/Help/FHelpBrowser.class | 18 +- app/src/gambas3/.src/Help/FHelpBrowser.form | 1 + app/src/gambas3/.src/Help/MHelp.module | 410 +++++++++--------- app/src/gambas3/.src/Project.module | 2 +- .../gambas3/.src/Project/CLibraryInfo.class | 26 ++ app/src/gambas3/help/class-help.html | 2 +- app/src/gambas3/help/component-help.html | 27 ++ 11 files changed, 697 insertions(+), 370 deletions(-) create mode 100644 app/src/gambas3/help/component-help.html diff --git a/app/src/gambas3/.lang/.pot b/app/src/gambas3/.lang/.pot index 98446ad01..e24668730 100644 --- a/app/src/gambas3/.lang/.pot +++ b/app/src/gambas3/.lang/.pot @@ -34,323 +34,365 @@ msgstr "" msgid "Next bookmark" msgstr "" -#: CComponent.class:78 -msgid "Internal native classes" +#: CClassInfo.class:534 FMain.form:1374 FProperty.form:23 +msgid "Properties" +msgstr "" + +#: CClassInfo.class:535 +msgid "Variables" +msgstr "" + +#: CClassInfo.class:536 +msgid "Methods" +msgstr "" + +#: CClassInfo.class:537 +msgid "Events" +msgstr "" + +#: CClassInfo.class:565 +msgid "" +"This class can be used like an object by creating an hidden instance on " +"demand.
" +msgstr "" + +#: CClassInfo.class:566 +msgid "This class is creatable.
" +msgstr "" + +#: CClassInfo.class:590 +msgid "This class inherits &1." +msgstr "" + +#: CClassInfo.class:605 MTheme.module:6 +msgid "Symbols" +msgstr "" + +#: CClassInfo.class:606 +msgid "Constants" msgstr "" #: CComponent.class:79 -msgid "Program arguments parser" +msgid "Internal native classes" msgstr "" #: CComponent.class:80 -msgid "Cairo graphic library" +msgid "Program arguments parser" msgstr "" #: CComponent.class:81 -msgid "Chart drawing" +msgid "Cairo graphic library" msgstr "" #: CComponent.class:82 -msgid "Complex numbers management" +msgid "Chart drawing" msgstr "" #: CComponent.class:83 -msgid "Compression & decompression" +msgid "Complex numbers management" msgstr "" #: CComponent.class:84 -msgid "MD5/DES crypting" +msgid "Compression & decompression" msgstr "" #: CComponent.class:85 +msgid "MD5/DES crypting" +msgstr "" + +#: CComponent.class:86 msgid "More data containers" msgstr "" -#: CComponent.class:86 FCreateProject.form:293 +#: CComponent.class:87 FCreateProject.form:293 msgid "Database access" msgstr "" -#: CComponent.class:87 +#: CComponent.class:88 msgid "Firebird database driver" msgstr "" -#: CComponent.class:88 +#: CComponent.class:89 msgid "Data bound controls" msgstr "" -#: CComponent.class:89 +#: CComponent.class:90 msgid "MySQL database driver" msgstr "" -#: CComponent.class:90 +#: CComponent.class:91 msgid "ODBC database driver" msgstr "" -#: CComponent.class:91 +#: CComponent.class:92 msgid "PostgreSQL database driver" msgstr "" -#: CComponent.class:92 +#: CComponent.class:93 msgid "SQLite 2 database driver" msgstr "" -#: CComponent.class:93 +#: CComponent.class:94 msgid "SQLite 3 database driver" msgstr "" -#: CComponent.class:94 +#: CComponent.class:95 msgid "Application debugger helper" msgstr "" -#: CComponent.class:95 +#: CComponent.class:96 msgid "Desktop-neutral routines from Portland project" msgstr "" -#: CComponent.class:96 +#: CComponent.class:97 msgid "D-Bus interface" msgstr "" -#: CComponent.class:97 +#: CComponent.class:98 msgid "Expression evaluator" msgstr "" -#: CComponent.class:98 +#: CComponent.class:99 msgid "Syntax highlighter routines" msgstr "" -#: CComponent.class:99 +#: CComponent.class:100 msgid "More controls for graphical components" msgstr "" -#: CComponent.class:100 +#: CComponent.class:101 msgid "Enhanced standard dialogs" msgstr "" -#: CComponent.class:101 +#: CComponent.class:102 msgid "Multi Document Interface" msgstr "" -#: CComponent.class:102 +#: CComponent.class:103 msgid "Default icon theme" msgstr "" -#: CComponent.class:103 +#: CComponent.class:104 msgid "GNU Scientific Library" msgstr "" -#: CComponent.class:104 +#: CComponent.class:105 msgid "GTK+ toolkit" msgstr "" -#: CComponent.class:105 +#: CComponent.class:106 msgid "GTK+ toolkit extension" msgstr "" -#: CComponent.class:106 +#: CComponent.class:107 msgid "OpenGL with GTK+ toolkit" msgstr "" -#: CComponent.class:107 +#: CComponent.class:108 msgid "GTK+ SVG renderer" msgstr "" -#: CComponent.class:108 +#: CComponent.class:109 msgid "QT/GTK+ switcher component" msgstr "" -#: CComponent.class:109 +#: CComponent.class:110 msgid "OpenGL with QT/GTK+ switcher component" msgstr "" -#: CComponent.class:110 +#: CComponent.class:111 msgid "Image management" msgstr "" -#: CComponent.class:111 +#: CComponent.class:112 msgid "Image filtering component" msgstr "" -#: CComponent.class:112 +#: CComponent.class:113 msgid "Image routines from the Imlib2 library" msgstr "" -#: CComponent.class:113 FPropertyComponent.form:138 +#: CComponent.class:114 FPropertyComponent.form:138 msgid "Image loading and saving" msgstr "" -#: CComponent.class:114 +#: CComponent.class:115 msgid "OpenLDAP client" msgstr "" -#: CComponent.class:115 +#: CComponent.class:116 msgid "GStreamer multimedia component" msgstr "" -#: CComponent.class:116 +#: CComponent.class:117 msgid "MIME format management based on GMime library" msgstr "" -#: CComponent.class:117 +#: CComponent.class:118 msgid "MySQL specific routines" msgstr "" -#: CComponent.class:118 +#: CComponent.class:119 msgid "NCurses library" msgstr "" -#: CComponent.class:119 FCreateProject.form:299 +#: CComponent.class:120 FCreateProject.form:299 msgid "Network programming" msgstr "" -#: CComponent.class:120 +#: CComponent.class:121 msgid "Network high-level protocols management" msgstr "" -#: CComponent.class:121 +#: CComponent.class:122 msgid "POP3 client" msgstr "" -#: CComponent.class:122 +#: CComponent.class:123 msgid "SMTP client" msgstr "" -#: CComponent.class:123 +#: CComponent.class:124 msgid "3D programming with OpenGL" msgstr "" -#: CComponent.class:124 +#: CComponent.class:125 msgid "OpenGL utility component" msgstr "" -#: CComponent.class:125 +#: CComponent.class:126 msgid "OpenGL shaders management" msgstr "" -#: CComponent.class:126 +#: CComponent.class:127 msgid "GNU command option parser" msgstr "" -#: CComponent.class:127 +#: CComponent.class:128 msgid "Perl-compatible Regular Expression Matching" msgstr "" -#: CComponent.class:128 +#: CComponent.class:129 msgid "PDF renderer based on Poppler library" msgstr "" -#: CComponent.class:129 +#: CComponent.class:130 msgid "QT4 toolkit" msgstr "" -#: CComponent.class:130 +#: CComponent.class:131 msgid "QT4 toolkit extension" msgstr "" -#: CComponent.class:131 +#: CComponent.class:132 msgid "QT4 WebKit component" msgstr "" -#: CComponent.class:132 +#: CComponent.class:133 msgid "OpenGL with QT4 toolkit" msgstr "" -#: CComponent.class:133 +#: CComponent.class:134 msgid "Report designer" msgstr "" -#: CComponent.class:134 +#: CComponent.class:135 msgid "SDL library" msgstr "" -#: CComponent.class:135 +#: CComponent.class:136 msgid "SDL sound & CD-ROM management" msgstr "" -#: CComponent.class:136 +#: CComponent.class:137 msgid "Application settings management" msgstr "" -#: CComponent.class:137 +#: CComponent.class:138 msgid "Signals management" msgstr "" -#: CComponent.class:138 +#: CComponent.class:139 msgid "Video capture" msgstr "" -#: CComponent.class:139 +#: CComponent.class:140 msgid "Visual Basic compatibility" msgstr "" -#: CComponent.class:140 +#: CComponent.class:141 msgid "XML tools based on libxml" msgstr "" -#: CComponent.class:141 +#: CComponent.class:142 msgid "XML tools" msgstr "" -#: CComponent.class:142 +#: CComponent.class:143 msgid "HTML generator" msgstr "" -#: CComponent.class:143 +#: CComponent.class:144 msgid "XML-RPC protocol" msgstr "" -#: CComponent.class:144 +#: CComponent.class:145 msgid "XSLT tools based on libxslt and libxml" msgstr "" -#: CComponent.class:145 +#: CComponent.class:146 msgid "Web applications tools" msgstr "" -#: CComponent.class:151 FPropertyComponent.form:126 +#: CComponent.class:152 FPropertyComponent.form:126 msgid "Graphical form management" msgstr "" -#: CComponent.class:152 FPropertyComponent.form:132 +#: CComponent.class:153 FPropertyComponent.form:132 msgid "Event loop management" msgstr "" -#: CComponent.class:154 FPropertyComponent.form:144 +#: CComponent.class:155 FPropertyComponent.form:144 msgid "OpenGL display" msgstr "" -#: CComponent.class:155 +#: CComponent.class:156 msgid "Complex numbers" msgstr "" -#: CComponent.class:156 +#: CComponent.class:157 msgid "XML management" msgstr "" -#: CComponent.class:444 +#: CComponent.class:445 msgid "Loading information on component &1..." msgstr "" +#: CComponent.class:1482 FInfo.class:67 +msgid "Classes" +msgstr "" + #: CInsertColor.class:106 FEditor.form:419 FTextEditor.form:350 msgid "Insert color" msgstr "" -#: CLibraryInfo.class:108 +#: CLibraryInfo.class:134 msgid "&1: &2" msgstr "" -#: CLibraryInfo.class:116 LibraryItem.class:54 +#: CLibraryInfo.class:142 LibraryItem.class:54 msgid "Location" msgstr "" -#: CLibraryInfo.class:118 LibraryItem.class:56 +#: CLibraryInfo.class:144 LibraryItem.class:56 msgid "WARNING! Library not found." msgstr "" -#: CLibraryInfo.class:120 ComponentItem.class:172 LibraryItem.class:58 +#: CLibraryInfo.class:146 ComponentItem.class:172 LibraryItem.class:58 msgid "Provides" msgstr "" -#: CLibraryInfo.class:121 ComponentItem.class:151 FPropertyComponent.form:106 +#: CLibraryInfo.class:147 ComponentItem.class:151 FPropertyComponent.form:106 #: LibraryItem.class:60 msgid "Requires" msgstr "" @@ -2100,10 +2142,6 @@ msgstr "" msgid "Modules" msgstr "" -#: FInfo.class:67 -msgid "Classes" -msgstr "" - #: FInfo.class:69 msgid "Lines of code: &1" msgstr "" @@ -2633,10 +2671,6 @@ msgstr "" msgid "Reset filter" msgstr "" -#: FMain.form:1374 FProperty.form:23 MHelp.module:578 -msgid "Properties" -msgstr "" - #: FMain.class:208 msgid "Do you really want to delete this link ?" msgstr "" @@ -5658,40 +5692,6 @@ msgstr "" msgid "No help found." msgstr "" -#: MHelp.module:579 -msgid "Variables" -msgstr "" - -#: MHelp.module:580 -msgid "Methods" -msgstr "" - -#: MHelp.module:581 -msgid "Events" -msgstr "" - -#: MHelp.module:609 -msgid "" -"This class can be used like an object by creating an hidden instance on " -"demand.
" -msgstr "" - -#: MHelp.module:610 -msgid "This class is creatable.
" -msgstr "" - -#: MHelp.module:633 -msgid "This class inherits &1." -msgstr "" - -#: MHelp.module:648 MTheme.module:6 -msgid "Symbols" -msgstr "" - -#: MHelp.module:649 -msgid "Constants" -msgstr "" - #: MMime.module:17 msgid "Plain text" msgstr "" diff --git a/app/src/gambas3/.src/Component/CClassInfo.class b/app/src/gambas3/.src/Component/CClassInfo.class index e010d9585..ecf168af9 100644 --- a/app/src/gambas3/.src/Component/CClassInfo.class +++ b/app/src/gambas3/.src/Component/CClassInfo.class @@ -355,18 +355,29 @@ Public Sub GetHelpURL() As String Dim sPath As String Dim sComp As String + Dim hComp As CComponent - If Component And If Component <> CComponent.PROJECT_NAME Then + If Component And If Component <> CComponent.PROJECT_NAME Then hComp = CComponent.All[Component] + + If hComp Then - sPath = MHelp.GetURL("comp") - sComp = Component - 'If sComp = "gb.qt4" Or If sComp = "gb.gtk" Or If sComp = "gb.gui" Then sComp = "gb.qt" - 'If sComp = "gb.qt4.ext" Then sComp = "gb.qt.ext" - sPath &/= LCase(sComp) - 'sPath &/= LCase(Left(Name) & Replace(Mid(Name, 2), "_", ".")) - sPath &/= LCase(Name) + If hComp.Library Then + + Return "gambas://library" &/ hComp.Key &/ Name + + Else + + sPath = MHelp.GetURL("comp") + sComp = Component + 'If sComp = "gb.qt4" Or If sComp = "gb.gtk" Or If sComp = "gb.gui" Then sComp = "gb.qt" + 'If sComp = "gb.qt4.ext" Then sComp = "gb.qt.ext" + sPath &/= LCase(sComp) + 'sPath &/= LCase(Left(Name) & Replace(Mid(Name, 2), "_", ".")) + sPath &/= LCase(Name) + + Return sPath & "?help&v3&" & MHelp.GetLanguage() - Return sPath & "?help&v3&" & MHelp.GetLanguage() + Endif Else @@ -403,3 +414,199 @@ Public Sub GetSimilars() As String[] Return aSimilar End + +Public Sub GetHelpMarkup() As String + + Dim hForm As FEditor + Dim hEdit As Editor + Dim I As Integer + Dim sLine As String + Dim sMarkup As String + + If Help Then Return Help + + hForm = Project.LoadFile(Project.FindPath(Name)) + Try hEdit = hForm.Editor + + If Not hEdit Then Return + + For I = 0 To hEdit.Lines.Count - 1 + sLine = Trim(hEdit.Lines[I].Text) + If sLine Begins "''' " Then + sMarkup &= Trim(Mid$(sLine, 4)) & "\n" + Else + If sMarkup Then Break + If sLine Not Begins "'" Then Break + Endif + Next + +End + +Private Sub SubstPart(sHtml As String, sPart As String, bShow As Boolean) As String + + If bShow Then + sHtml = Replace(sHtml, sPart & "[", "") + sHtml = Replace(sHtml, sPart & "]", "") + Else + sHtml = Replace(sHtml, sPart & "[", "") + Endif + + Return sHtml + +End + +Public Sub GetHelpHTML() As String + + Dim sClass As String = Name + Dim sHelp, sHtml, sWhere, sSymbols, sParSymbols, sInfo As String + Dim hSymbol As CSymbolInfo + Dim cClassSymbols As Collection + Dim hClassInfo, hParentClass As CClassInfo + Dim aProperty, aEvent, aMethod, aConst, aVar As New String[] + Dim aParentProperty, aParentEvent, aParentMethod, aParentConst, aParentVar As New String[] + Dim sComp, sSymbolName As String + Dim hArray As String[] + Dim sParent As String + Dim sTitle As String + + sHelp = Markup.Convert(GetHelpMarkup()) + + hClassInfo = CComponent.GetClassDescription(sClass) + cClassSymbols = CComponent.GetClassSymbols(sClass) + + 'If hClassInfo.Name = sClass Then hClassInfo.Name = hClassInfo.Parent ????? Do not modify the class info! + + If cClassSymbols.Count > 0 Then + + For Each hSymbol In cClassSymbols + + sSymbolName = hSymbol.Name + If Left(sSymbolName) = ":" Then sSymbolName = Mid$(sSymbolName, 2) + + sComp = Subst("&2", Html(hSymbol.GetHelpURL()), sSymbolName) + + If hSymbol.NotPublic Or If hSymbol.IsHidden() Then Continue + + If IsLetter(hSymbol.Kind) And If hSymbol.Kind = UCase(hSymbol.Kind) Then sComp = "" & sComp & "" + + If hSymbol.Class = sClass Then + + Select Case LCase(hSymbol.Kind) + Case ":" + aEvent.Add(sComp) + Case "m" + aMethod.Add(sComp) + Case "p", "r" + aProperty.Add(sComp) + Case "c" + aConst.Add(sComp) + Case "v" + aVar.Add(sComp) + End Select + + Else + + Select Case LCase(hSymbol.Kind) + Case ":" + aParentEvent.Add(sComp) + Case "m" + aParentMethod.Add(sComp) + Case "p", "r" + aParentProperty.Add(sComp) + Case "c" + aParentConst.Add(sComp) + Case "v" + aParentVar.Add(sComp) + End Select + + Endif + + Next + + For Each hArray In [aConst, aEvent, aMethod, aProperty, aVar, aParentConst, aParentEvent, aParentMethod, aParentProperty, aParentVar] + hArray.Sort + Next + + sParSymbols = "" + If aParentProperty.Count + aParentMethod.Count + aParentEvent.Count + aParentVar.Count Then + sParSymbols &= "" + If aParentProperty.Count Then sParSymbols &= "" & ("Properties") & " " + If aParentVar.Count Then sParSymbols &= "" & ("Variables") & " " + If aParentMethod.Count Then sParSymbols &= "" & ("Methods") & " " + If aParentEvent.Count Then sParSymbols &= "" & ("Events") & " " + sParSymbols &= "" + sParSymbols &= "" + If aParentProperty.Count Then sParSymbols &= "" & aParentProperty.Join(" ") & " " + If aParentVar.Count Then sParSymbols &= "" & aParentVar.Join(" ") & " " + If aParentMethod.Count Then sParSymbols &= "" & aParentMethod.Join(" ") & " " + If aParentEvent.Count Then sParSymbols &= "" & aParentEvent.Join(" ") & " " + sParSymbols &= "" + Endif + + sSymbols = "" + If aProperty.Count + aMethod.Count + aEvent.Count + aVar.Count Then + sSymbols &= "" + If aProperty.Count Then sSymbols &= "" & ("Properties") & " " + If aVar.Count Then sSymbols &= "" & ("Variables") & " " + If aMethod.Count Then sSymbols &= "" & ("Methods") & " " + If aEvent.Count Then sSymbols &= "" & ("Events") & " " + sSymbols &= "" + sSymbols &= "" + If aProperty.Count Then sSymbols &= "" & aProperty.Join(" ") & " " + If aVar.Count Then sSymbols &= "" & aVar.Join(" ") & " " + If aMethod.Count Then sSymbols &= "" & aMethod.Join(" ") & " " + If aEvent.Count Then sSymbols &= "" & aEvent.Join(" ") & " " + sSymbols &= "" + Endif + + Endif + + If hClassInfo.AutoCreatable Then sInfo = ("This class can be used like an object by creating an hidden instance on demand.
") + If hClassInfo.Creatable Then sInfo &= ("This class is creatable.
") + + If Not Component Or If Component = CComponent.PROJECT_NAME Then sWhere = "gambas://project/" & sClass & "?showfile" + sTitle = sClass + If sWhere Then sTitle = "" & sTitle & "" + + sHtml = File.Load("help/class-help.html") + sHtml = Replace(sHtml, "$(help)", sHelp) + + If sInfo Then + sHtml = Replace(sHtml, "", sInfo & "
") + Endif + + If hClassInfo.Parent Then + + sParent = hClassInfo.Parent + + hParentClass = CComponent.Classes[hClassInfo.ParentComponent &/ sParent] + If Not hParentClass Then hParentClass = CComponent.GetClassDescription(sParent) + + sHtml = SubstPart(sHtml, "ShowInherits", True) + sHtml = SubstPart(sHtml, "ShowParConst", aParentConst.Count > 0) + sHtml = Replace(sHtml, "$(ParConst)", aParentConst.Join(" ")) + + sHtml = Replace(sHtml, "$(Inherits)", Subst(("This class inherits &1."), Subst("&2", Html(hParentClass.GetHelpURL()), sParent))) + sHtml = Replace(sHtml, "$(ParSymbols)", sParSymbols) + + Else + + sHtml = SubstPart(sHtml, "ShowInherits", False) + + Endif + + sHtml = SubstPart(sHtml, "ShowConst", aConst.Count > 0) + sHtml = Replace(sHtml, "$(Const)", aConst.Join(" ")) + + sHtml = Replace(sHtml, "$(title)", sTitle) + sHtml = Replace(sHtml, "$(Symbols)", sSymbols) + + sHtml = Replace(sHtml, "''Symbols''", ("Symbols")) + sHtml = Replace(sHtml, "''Constants''", ("Constants")) + + sHtml = Replace(sHtml, "$(hide-title)", "") + + Return sHtml + +End diff --git a/app/src/gambas3/.src/Component/CComponent.class b/app/src/gambas3/.src/Component/CComponent.class index a45ba36cb..0c44ccbbf 100644 --- a/app/src/gambas3/.src/Component/CComponent.class +++ b/app/src/gambas3/.src/Component/CComponent.class @@ -36,6 +36,7 @@ Public Hidden As Boolean Public {Library} As Boolean Public Path As String +Public Help As String Static Public Features As New Collection @@ -464,6 +465,8 @@ Public Sub Load() All[sLig].Load Endif Next + + Help = hLibraryInfo.GetHelp() Else @@ -1417,13 +1420,17 @@ Public Sub GetHelpURL() As String If Key And If Key <> CComponent.PROJECT_NAME Then - sPath = MHelp.GetURL("comp") - sComp = Key - 'If sComp = "gb.qt4" Or If sComp = "gb.gtk" Or If sComp = "gb.gui" Then sComp = "gb.qt" - 'If sComp = "gb.qt4.ext" Then sComp = "gb.qt.ext" - sPath &/= LCase(sComp) - - Return sPath & "?help&v3&" & MHelp.GetLanguage() + If {Library} Then + Return "gambas://library" &/ Key + Else + sPath = MHelp.GetURL("comp") + sComp = Key + 'If sComp = "gb.qt4" Or If sComp = "gb.gtk" Or If sComp = "gb.gui" Then sComp = "gb.qt" + 'If sComp = "gb.qt4.ext" Then sComp = "gb.qt.ext" + sPath &/= LCase(sComp) + + Return sPath & "?help&v3&" & MHelp.GetLanguage() + Endif Endif @@ -1439,3 +1446,43 @@ Public Sub ExistClassEvenArray(sClass As String) As Boolean Loop End + +Public Sub GetHelpHTML() As String + + Dim sClass As String = Name + Dim sHtml As String + Dim sDesc As String + Dim hClass As CClassInfo + Dim sHelp As String + + If Name = PROJECT_NAME Then + sHelp = Project.Description + Else If {Library} Then + sHelp = Help + Else + Return + Endif + + sHtml = File.Load("help/component-help.html") + + sHtml = Replace(sHtml, "$(help)", sHelp) + + sDesc = "" + + For Each sClass In ClassList + + hClass = Classes[sClass] + sDesc &= "" & sClass & "
" + + Next + + sHtml = Replace(sHtml, "$(classes)", sDesc) + sHtml = Replace(sHtml, "$(title)", Name) + + sHtml = Replace(sHtml, "''Classes''", ("Classes")) + + sHtml = Replace(sHtml, "$(hide-title)", "") + + Return sHtml + +End diff --git a/app/src/gambas3/.src/Component/CSymbolInfo.class b/app/src/gambas3/.src/Component/CSymbolInfo.class index 60991c846..1f8c70382 100644 --- a/app/src/gambas3/.src/Component/CSymbolInfo.class +++ b/app/src/gambas3/.src/Component/CSymbolInfo.class @@ -739,35 +739,46 @@ Static Public Function TransformSignature(sSign As String, bBalise As Boolean) A End -Public Function GetHelpURL() As String +Public Function GetHelpURL(Optional bShowFile As Boolean) As String Dim sPath As String Dim sName As String Dim sComp As String + Dim hComp As CComponent If Component = "gb" And If Class = "." Then Return MHelp.GetLangURL(Name) Endif - - If Component And If Component <> CComponent.PROJECT_NAME Then - sPath = MHelp.GetURL("comp") - sComp = Component - 'If sComp = "gb.qt4" Or If sComp = "gb.gtk" Or If sComp = "gb.gui" Then sComp = "gb.qt" - 'If sComp = "gb.qt4.ext" Then sComp = "gb.qt.ext" - sPath &/= LCase(sComp) - sPath &/= LCase(Left(Class) & Replace(Mid(Class, 2), "_", ".")) - - sName = LCase(Name) - sName = Left(sName) & Replace(Mid$(sName, 2), "_", ".") - sName = Replace(sName, ":", ".") - sPath &/= sName - - Return sPath & "?help&v3&" & MHelp.GetLanguage() + If Component And If Component <> CComponent.PROJECT_NAME Then hComp = CComponent.All[Component] + + If hComp Then + + If hComp.Library Then + + Return Subst("gambas://library/&1/&2/&3", Component, Class, Name) + + Else + + sPath = MHelp.GetURL("comp") + sComp = Component + 'If sComp = "gb.qt4" Or If sComp = "gb.gtk" Or If sComp = "gb.gui" Then sComp = "gb.qt" + 'If sComp = "gb.qt4.ext" Then sComp = "gb.qt.ext" + sPath &/= LCase(sComp) + sPath &/= LCase(Left(Class) & Replace(Mid(Class, 2), "_", ".")) + + sName = LCase(Name) + sName = Left(sName) & Replace(Mid$(sName, 2), "_", ".") + sName = Replace(sName, ":", ".") + sPath &/= sName + + Return sPath & "?help&v3&" & MHelp.GetLanguage() + + Endif Else - Return Subst("gambas://project/&1/&2#&3?showfile", Class, Name, LineNumber) + Return Subst("gambas://project/&1/&2#&3&4", Class, Name, LineNumber, If(bShowFile, "?showfile", "")) Endif @@ -948,10 +959,10 @@ Public Sub GetHelpMarkup() As String For i = iLine - 1 To 0 Step -1 sLine = Trim(hEdit.Lines[i].Text) - If sLine Begins "'' " Then + If sLine Begins "'' " Or If sLine = "''" Then sHelp = RTrim(Mid(sLine, 4)) & "\n" & sHelp Else - If Trim(sLine) = "" Then Continue + If sLine = "" Then Continue Break Endif Next @@ -1018,9 +1029,9 @@ Public Function GetHelpHTML() As String sHTML = Replace(sHTML, "$(syntax)", sSyntax) sHTML = Replace(sHTML, "$(help)", sHelp) - If Component = CComponent.PROJECT_NAME Then sTitle = "" + If Not Component Or If Component = CComponent.PROJECT_NAME Then sTitle = "" sTitle &= {Class} & "." & Name - If Component = CComponent.PROJECT_NAME Then sTitle &= "" + If Not Component Or If Component = CComponent.PROJECT_NAME Then sTitle &= "" sHTML = Replace(sHTML, "$(title)", sTitle) diff --git a/app/src/gambas3/.src/Help/FHelpBrowser.class b/app/src/gambas3/.src/Help/FHelpBrowser.class index ab9e6e006..0e8059c55 100644 --- a/app/src/gambas3/.src/Help/FHelpBrowser.class +++ b/app/src/gambas3/.src/Help/FHelpBrowser.class @@ -221,7 +221,7 @@ Private Sub FillTree() tvwClasses.Clear - tvwClasses.Add("$", "Project", Picture["img/16/gambas.png"]) + tvwClasses.Add("$", Project.Name, Project.GetIcon(Project.Dir, 16)) For Each sClass In Project.GetClasses() tvwClasses.Add("$" &/ sClass, sClass,, "$") @@ -251,19 +251,19 @@ Private Sub FillTree() End -Public Sub tvwClasses_MouseUp() +Public Sub tvwClasses_Select() - Dim ars As String[] + Dim aKey As String[] Dim sKey As String sKey = tvwClasses.Current.Key - If sKey = "$" Then Return + If Not sKey Or If sKey = "$" Then Return - ars = Split(sKey, "/") - If ars.count = 2 Then - MHelp.InitWebViewWith(webHelp, MHelp.TYPE_CLASS, ars[1]) - Else If ars.Count = 1 Then - MHelp.InitWebViewWith(webHelp, MHelp.TYPE_COMPONENT, ars[0]) + aKey = Split(sKey, "/") + If aKey.Count = 2 Then + MHelp.InitWebViewWith(webHelp, MHelp.TYPE_CLASS, aKey[0] &/ aKey[1]) + Else If aKey.Count = 1 Then + MHelp.InitWebViewWith(webHelp, MHelp.TYPE_COMPONENT, aKey[0]) Endif End diff --git a/app/src/gambas3/.src/Help/FHelpBrowser.form b/app/src/gambas3/.src/Help/FHelpBrowser.form index 080a11ad7..5c20658f7 100644 --- a/app/src/gambas3/.src/Help/FHelpBrowser.form +++ b/app/src/gambas3/.src/Help/FHelpBrowser.form @@ -100,6 +100,7 @@ MoveScaled(8,1,31,27) Visible = False Expand = True + Sorted = True Border = False } { !webHelp WebView diff --git a/app/src/gambas3/.src/Help/MHelp.module b/app/src/gambas3/.src/Help/MHelp.module index 92b0a01ce..7fe387a0b 100644 --- a/app/src/gambas3/.src/Help/MHelp.module +++ b/app/src/gambas3/.src/Help/MHelp.module @@ -382,11 +382,12 @@ Public Sub InitWebViewWith(hWebView As WebView, iType As Integer, sSymbol As Str If hClass.Component And If hClass.Component <> CComponent.PROJECT_NAME And If Not CComponent.All[hClass.Component].Library Then sUrl = hClass.GetHelpURL() Else If hClass.Help Then - sHtml = GetProjectClassHelpHTML(sSymbol, hClass.Help) + sHtml = hClass.GetHelpHTML() sUrl = hClass.Component & "-" & sSymbol Endif Else If Project.GetClasses().Exist(sSymbol) Then - sHtml = GetProjectClassHelpHTML(sSymbol) + CComponent.GetClassSymbols(sSymbol) + sHtml = CComponent.GetLastClass().GetHelpHTML() sUrl = "-" & sSymbol Endif @@ -397,7 +398,12 @@ Public Sub InitWebViewWith(hWebView As WebView, iType As Integer, sSymbol As Str Else If iType = TYPE_COMPONENT Try hComp = CComponent.All[sSymbol] - If hComp Then sUrl = hComp.GetHelpURL() + If hComp.Library Then + sUrl = sSymbol + sHtml = hComp.GetHelpHTML() + Else + sUrl = hComp.GetHelpURL() + Endif Endif @@ -407,7 +413,7 @@ Public Sub InitWebViewWith(hWebView As WebView, iType As Integer, sSymbol As Str sTemp = File.Dir(Temp$()) &/ "help" Try Mkdir sTemp - sTemp &/= sUrl & ".html" + sTemp &/= Replace(sUrl, "/", "|") & ".html" File.Save(sTemp, sHtml) hWebView.Url = "file://" & sTemp @@ -459,200 +465,187 @@ Public Sub ShowHelpBrowserWith(hWebView As WebView, iType As Integer, sSymbol As End -Private Sub SubstPart(sHtml As String, sPart As String, bShow As Boolean) As String - - If bShow Then - sHtml = Replace(sHtml, sPart & "[", "") - sHtml = Replace(sHtml, sPart & "]", "") - Else - sHtml = Replace(sHtml, sPart & "[", "") - Endif - - Return sHtml - -End '' +Description -'' Return the formated help of the local class if it exist +'' Return the formated help of the local class if it exists '' +Arguments '' - #sClass# is the class to analyze -'' - #hWebView# is the WebView control to use. +'' - #sMarkup# is the markup to convert to HTML -Private Function GetProjectClassHelpHTML(sClass As String, Optional sMarkup As String) As String - - Dim sHelp, sHtml, sLine, sWhere, sSymbols, sParSymbols, sInfo As String - Dim hForm As FEditor - Dim hEdit As Editor - Dim i As Integer - Dim hSymbol As CSymbolInfo - Dim cClassSymbols As Collection - Dim hClassInfo, hParentClass As CClassInfo - Dim aProperty, aEvent, aMethod, aConst, aVar As New String[] - Dim aParentProperty, aParentEvent, aParentMethod, aParentConst, aParentVar As New String[] - Dim sComp, sSymbolName As String - Dim hArray As String[] - Dim sParent As String - - If Not sMarkup Then - - hForm = Project.LoadFile(Project.FindPath(sClass)) - Try hEdit = hForm.Editor - - If Not hEdit Then Return - - For i = 0 To hEdit.Lines.Count - 1 - sLine = Trim(hEdit.Lines[i].Text) - If sLine Begins "''' " Then - sMarkup &= Trim(Mid$(sLine, 4)) & "\n" - Else - If sMarkup Then Break - If sLine Not Begins "'" Then Break - Endif - Next - - Endif - - sHelp = Markup.Convert(sMarkup) - - hClassInfo = CComponent.GetClassDescription(sClass) - cClassSymbols = CComponent.GetClassSymbols(sClass) - - 'If hClassInfo.Name = sClass Then hClassInfo.Name = hClassInfo.Parent ????? Do not modify the class info! - - If cClassSymbols.Count > 0 Then - - For Each hSymbol In cClassSymbols - - sSymbolName = hSymbol.Name - If Left(sSymbolName) = ":" Then sSymbolName = Mid$(sSymbolName, 2) - - sComp = Subst("&2", Html(hSymbol.GetHelpURL()), sSymbolName) - - If hSymbol.NotPublic Or If hSymbol.IsHidden() Then Continue - - If IsLetter(hSymbol.Kind) And If hSymbol.Kind = UCase(hSymbol.Kind) Then sComp = "" & sComp & "" - - If hSymbol.Class = sClass Then - - Select Case LCase(hSymbol.Kind) - Case ":" - aEvent.Add(sComp) - Case "m" - aMethod.Add(sComp) - Case "p", "r" - aProperty.Add(sComp) - Case "c" - aConst.Add(sComp) - Case "v" - aVar.Add(sComp) - End Select - - Else - - Select Case LCase(hSymbol.Kind) - Case ":" - aParentEvent.Add(sComp) - Case "m" - aParentMethod.Add(sComp) - Case "p", "r" - aParentProperty.Add(sComp) - Case "c" - aParentConst.Add(sComp) - Case "v" - aParentVar.Add(sComp) - End Select - - Endif - - Next - - For Each hArray In [aConst, aEvent, aMethod, aProperty, aVar, aParentConst, aParentEvent, aParentMethod, aParentProperty, aParentVar] - hArray.Sort - Next - - sParSymbols = "" - If aParentProperty.Count + aParentMethod.Count + aParentEvent.Count + aParentVar.Count Then - sParSymbols &= "" - If aParentProperty.Count Then sParSymbols &= "" & ("Properties") & " " - If aParentVar.Count Then sParSymbols &= "" & ("Variables") & " " - If aParentMethod.Count Then sParSymbols &= "" & ("Methods") & " " - If aParentEvent.Count Then sParSymbols &= "" & ("Events") & " " - sParSymbols &= "" - sParSymbols &= "" - If aParentProperty.Count Then sParSymbols &= "" & aParentProperty.Join(" ") & " " - If aParentVar.Count Then sParSymbols &= "" & aParentVar.Join(" ") & " " - If aParentMethod.Count Then sParSymbols &= "" & aParentMethod.Join(" ") & " " - If aParentEvent.Count Then sParSymbols &= "" & aParentEvent.Join(" ") & " " - sParSymbols &= "" - Endif - - sSymbols = "" - If aProperty.Count + aMethod.Count + aEvent.Count + aVar.Count Then - sSymbols &= "" - If aProperty.Count Then sSymbols &= "" & ("Properties") & " " - If aVar.Count Then sSymbols &= "" & ("Variables") & " " - If aMethod.Count Then sSymbols &= "" & ("Methods") & " " - If aEvent.Count Then sSymbols &= "" & ("Events") & " " - sSymbols &= "" - sSymbols &= "" - If aProperty.Count Then sSymbols &= "" & aProperty.Join(" ") & " " - If aVar.Count Then sSymbols &= "" & aVar.Join(" ") & " " - If aMethod.Count Then sSymbols &= "" & aMethod.Join(" ") & " " - If aEvent.Count Then sSymbols &= "" & aEvent.Join(" ") & " " - sSymbols &= "" - Endif - - Endif - - If hClassInfo.AutoCreatable Then sInfo = ("This class can be used like an object by creating an hidden instance on demand.
") - If hClassInfo.Creatable Then sInfo &= ("This class is creatable.
") - - sWhere = "gambas://project/" & sClass & "?showfile" - - sHtml = File.Load("help/class-help.html") - sHtml = Replace(sHtml, "$(class)", sClass) - sHtml = Replace(sHtml, "$(help)", sHelp) - - If sInfo Then - sHtml = Replace(sHtml, "", sInfo & "
") - Endif - - If hClassInfo.Parent Then - - sParent = hClassInfo.Parent - - hParentClass = CComponent.Classes[hClassInfo.ParentComponent &/ sParent] - If Not hParentClass Then hParentClass = CComponent.GetClassDescription(sParent) - - sHtml = SubstPart(sHtml, "ShowInherits", True) - sHtml = SubstPart(sHtml, "ShowParConst", aParentConst.Count > 0) - sHtml = Replace(sHtml, "$(ParConst)", aParentConst.Join(" ")) - - sHtml = Replace(sHtml, "$(Inherits)", Subst(("This class inherits &1."), Subst("&2", Html(hParentClass.GetHelpURL()), sParent))) - sHtml = Replace(sHtml, "$(ParSymbols)", sParSymbols) - - Else - - sHtml = SubstPart(sHtml, "ShowInherits", False) - - Endif - - sHtml = SubstPart(sHtml, "ShowConst", aConst.Count > 0) - sHtml = Replace(sHtml, "$(Const)", aConst.Join(" ")) - - sHtml = Replace(sHtml, "$(where)", sWhere) - sHtml = Replace(sHtml, "$(Symbols)", sSymbols) - - sHtml = Replace(sHtml, "''Symbols''", ("Symbols")) - sHtml = Replace(sHtml, "''Constants''", ("Constants")) - - sHtml = Replace(sHtml, "$(hide-title)", "") - - Return sHtml - -End +' Private Function GetProjectClassHelpHTML(sClass As String, Optional sMarkup As String) As String +' +' Dim sHelp, sHtml, sLine, sWhere, sSymbols, sParSymbols, sInfo As String +' Dim hForm As FEditor +' Dim hEdit As Editor +' Dim i As Integer +' Dim hSymbol As CSymbolInfo +' Dim cClassSymbols As Collection +' Dim hClassInfo, hParentClass As CClassInfo +' Dim aProperty, aEvent, aMethod, aConst, aVar As New String[] +' Dim aParentProperty, aParentEvent, aParentMethod, aParentConst, aParentVar As New String[] +' Dim sComp, sSymbolName As String +' Dim hArray As String[] +' Dim sParent As String +' +' If Not sMarkup Then +' +' hForm = Project.LoadFile(Project.FindPath(sClass)) +' Try hEdit = hForm.Editor +' +' If Not hEdit Then Return +' +' For i = 0 To hEdit.Lines.Count - 1 +' sLine = Trim(hEdit.Lines[i].Text) +' If sLine Begins "''' " Then +' sMarkup &= Trim(Mid$(sLine, 4)) & "\n" +' Else +' If sMarkup Then Break +' If sLine Not Begins "'" Then Break +' Endif +' Next +' +' Endif +' +' sHelp = Markup.Convert(sMarkup) +' +' hClassInfo = CComponent.GetClassDescription(sClass) +' cClassSymbols = CComponent.GetClassSymbols(sClass) +' +' 'If hClassInfo.Name = sClass Then hClassInfo.Name = hClassInfo.Parent ????? Do not modify the class info! +' +' If cClassSymbols.Count > 0 Then +' +' For Each hSymbol In cClassSymbols +' +' sSymbolName = hSymbol.Name +' If Left(sSymbolName) = ":" Then sSymbolName = Mid$(sSymbolName, 2) +' +' sComp = Subst("&2", Html(hSymbol.GetHelpURL()), sSymbolName) +' +' If hSymbol.NotPublic Or If hSymbol.IsHidden() Then Continue +' +' If IsLetter(hSymbol.Kind) And If hSymbol.Kind = UCase(hSymbol.Kind) Then sComp = "" & sComp & "" +' +' If hSymbol.Class = sClass Then +' +' Select Case LCase(hSymbol.Kind) +' Case ":" +' aEvent.Add(sComp) +' Case "m" +' aMethod.Add(sComp) +' Case "p", "r" +' aProperty.Add(sComp) +' Case "c" +' aConst.Add(sComp) +' Case "v" +' aVar.Add(sComp) +' End Select +' +' Else +' +' Select Case LCase(hSymbol.Kind) +' Case ":" +' aParentEvent.Add(sComp) +' Case "m" +' aParentMethod.Add(sComp) +' Case "p", "r" +' aParentProperty.Add(sComp) +' Case "c" +' aParentConst.Add(sComp) +' Case "v" +' aParentVar.Add(sComp) +' End Select +' +' Endif +' +' Next +' +' For Each hArray In [aConst, aEvent, aMethod, aProperty, aVar, aParentConst, aParentEvent, aParentMethod, aParentProperty, aParentVar] +' hArray.Sort +' Next +' +' sParSymbols = "" +' If aParentProperty.Count + aParentMethod.Count + aParentEvent.Count + aParentVar.Count Then +' sParSymbols &= "" +' If aParentProperty.Count Then sParSymbols &= "" & ("Properties") & " " +' If aParentVar.Count Then sParSymbols &= "" & ("Variables") & " " +' If aParentMethod.Count Then sParSymbols &= "" & ("Methods") & " " +' If aParentEvent.Count Then sParSymbols &= "" & ("Events") & " " +' sParSymbols &= "" +' sParSymbols &= "" +' If aParentProperty.Count Then sParSymbols &= "" & aParentProperty.Join(" ") & " " +' If aParentVar.Count Then sParSymbols &= "" & aParentVar.Join(" ") & " " +' If aParentMethod.Count Then sParSymbols &= "" & aParentMethod.Join(" ") & " " +' If aParentEvent.Count Then sParSymbols &= "" & aParentEvent.Join(" ") & " " +' sParSymbols &= "" +' Endif +' +' sSymbols = "" +' If aProperty.Count + aMethod.Count + aEvent.Count + aVar.Count Then +' sSymbols &= "" +' If aProperty.Count Then sSymbols &= "" & ("Properties") & " " +' If aVar.Count Then sSymbols &= "" & ("Variables") & " " +' If aMethod.Count Then sSymbols &= "" & ("Methods") & " " +' If aEvent.Count Then sSymbols &= "" & ("Events") & " " +' sSymbols &= "" +' sSymbols &= "" +' If aProperty.Count Then sSymbols &= "" & aProperty.Join(" ") & " " +' If aVar.Count Then sSymbols &= "" & aVar.Join(" ") & " " +' If aMethod.Count Then sSymbols &= "" & aMethod.Join(" ") & " " +' If aEvent.Count Then sSymbols &= "" & aEvent.Join(" ") & " " +' sSymbols &= "" +' Endif +' +' Endif +' +' If hClassInfo.AutoCreatable Then sInfo = ("This class can be used like an object by creating an hidden instance on demand.
") +' If hClassInfo.Creatable Then sInfo &= ("This class is creatable.
") +' +' sWhere = "gambas://project/" & sClass & "?showfile" +' +' sHtml = File.Load("help/class-help.html") +' sHtml = Replace(sHtml, "$(class)", sClass) +' sHtml = Replace(sHtml, "$(help)", sHelp) +' +' If sInfo Then +' sHtml = Replace(sHtml, "", sInfo & "
") +' Endif +' +' If hClassInfo.Parent Then +' +' sParent = hClassInfo.Parent +' +' hParentClass = CComponent.Classes[hClassInfo.ParentComponent &/ sParent] +' If Not hParentClass Then hParentClass = CComponent.GetClassDescription(sParent) +' +' sHtml = SubstPart(sHtml, "ShowInherits", True) +' sHtml = SubstPart(sHtml, "ShowParConst", aParentConst.Count > 0) +' sHtml = Replace(sHtml, "$(ParConst)", aParentConst.Join(" ")) +' +' sHtml = Replace(sHtml, "$(Inherits)", Subst(("This class inherits &1."), Subst("&2", Html(hParentClass.GetHelpURL()), sParent))) +' sHtml = Replace(sHtml, "$(ParSymbols)", sParSymbols) +' +' Else +' +' sHtml = SubstPart(sHtml, "ShowInherits", False) +' +' Endif +' +' sHtml = SubstPart(sHtml, "ShowConst", aConst.Count > 0) +' sHtml = Replace(sHtml, "$(Const)", aConst.Join(" ")) +' +' sHtml = Replace(sHtml, "$(where)", sWhere) +' sHtml = Replace(sHtml, "$(Symbols)", sSymbols) +' +' sHtml = Replace(sHtml, "''Symbols''", ("Symbols")) +' sHtml = Replace(sHtml, "''Constants''", ("Constants")) +' +' sHtml = Replace(sHtml, "$(hide-title)", "") +' +' Return sHtml +' +' End '' Manage 'the gambas://' links @@ -674,7 +667,7 @@ Public Sub ManageSpecialLink(hWebView As WebView, sUrl As String) aValues = Split(sUrl, "/") sClass = aValues[3] - If sUrl Begins "gambas://project/" Then + If sUrl Begins "gambas://" Then sLast = aValues[aValues.Max] iPos = InStr(sLast, "#") @@ -683,16 +676,31 @@ Public Sub ManageSpecialLink(hWebView As WebView, sUrl As String) aValues[aValues.Max] = Left$(sLast, iPos - 1) sClass = aValues[3] Endif - If bShowFile Then - Project.OpenFile(Project.FindPath(sClass), iLine) - FMain.Show - Else - If aValues.Count = 4 Then - InitWebViewWith(hWebView, TYPE_CLASS, aValues[3]) + + If aValues[2] = "project" Then + + If bShowFile Then + Project.OpenFile(Project.FindPath(sClass), iLine) + FMain.Show Else - InitWebViewWith(hWebView, TYPE_SYMBOL, aValues[4]) + If aValues.Count = 4 Then + InitWebViewWith(hWebView, TYPE_CLASS, aValues[3]) + Else + InitWebViewWith(hWebView, TYPE_SYMBOL, aValues[4], aValues[3]) + Endif + Endif + + Else If aValues[2] = "library" Then + + If aValues.Count = 4 Then + InitWebViewWith(hWebView, TYPE_COMPONENT, aValues[3]) + Else If aValues.Count = 5 Then + InitWebViewWith(hWebView, TYPE_CLASS, aValues[3] &/ aValues[4]) + Else If aValues.Count = 6 + InitWebViewWith(hWebView, TYPE_SYMBOL, aValues[5], aValues[3] &/ aValues[4]) Endif - Endif + + Endif Else diff --git a/app/src/gambas3/.src/Project.module b/app/src/gambas3/.src/Project.module index c20ff5e5a..5d85bcdf3 100644 --- a/app/src/gambas3/.src/Project.module +++ b/app/src/gambas3/.src/Project.module @@ -221,7 +221,7 @@ Public Sub InitWebView() 'WebSettings.Fonts.StandardFont = Application.Font.Name WebSettings.Fonts.SansSerifFont = Application.Font.Name - WebSettings.Fonts.DefaultFontSize = Application.Font.Height + WebSettings.Fonts.DefaultFontSize = Application.Font.Height * 1.2 hFont = Font[Settings["/ConsoleFont", DEFAULT_FONT]] WebSettings.Fonts.FixedFont = hFont.Name diff --git a/app/src/gambas3/.src/Project/CLibraryInfo.class b/app/src/gambas3/.src/Project/CLibraryInfo.class index 5da1d0b8d..b8512f436 100644 --- a/app/src/gambas3/.src/Project/CLibraryInfo.class +++ b/app/src/gambas3/.src/Project/CLibraryInfo.class @@ -9,6 +9,8 @@ Public Libraries As String[] Public Info As String Public Require As String[] +Private $sDesc As String + Static Private $cAll As New Collection Static Private $sInfo As String @@ -83,6 +85,30 @@ Public Sub GetInfo() End +Public Sub GetHelp() As String + + Dim sData As String + Dim aData As String[] + Dim iPos As Integer + + If Not $sDesc Then + + Exec [System.Path &/ "bin/gba" & System.Version, "-x", Path, ".project"] To sData + + aData = Split(sData, "\n") + iPos = aData.Find("Description=*", gb.Like) + If iPos >= 0 Then + $sDesc = UnQuote(Scan(aData[iPos], "Description=*")[0]) + Else + $sDesc = " " + Endif + + Endif + + Return Trim($sDesc) + +End + Public Sub GetDependencyName() As String Dim sProject As String diff --git a/app/src/gambas3/help/class-help.html b/app/src/gambas3/help/class-help.html index 74aab8139..6d13ea08a 100644 --- a/app/src/gambas3/help/class-help.html +++ b/app/src/gambas3/help/class-help.html @@ -11,7 +11,7 @@
- +
$(title)

$(help)

''Symbols''
diff --git a/app/src/gambas3/help/component-help.html b/app/src/gambas3/help/component-help.html new file mode 100644 index 000000000..7ea115411 --- /dev/null +++ b/app/src/gambas3/help/component-help.html @@ -0,0 +1,27 @@ + + + + + + + + + +
+
$(title)
+

+ $(help) +

''Classes''
+
+ + $(classes) +
+
+
+ + +