[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
This commit is contained in:
parent
f7992f248d
commit
c8e08d651d
11 changed files with 697 additions and 370 deletions
|
@ -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.<br>"
|
||||
msgstr ""
|
||||
|
||||
#: CClassInfo.class:566
|
||||
msgid "This class is creatable.<br>"
|
||||
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 "<b>&1:</b> &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.<br>"
|
||||
msgstr ""
|
||||
|
||||
#: MHelp.module:610
|
||||
msgid "This class is creatable.<br>"
|
||||
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 ""
|
||||
|
|
|
@ -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 & "[", "<!--")
|
||||
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("<a class=\"none\" href=\"&1\">&2</a>", 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 = "<b>" & sComp & "</b>"
|
||||
|
||||
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 &= "<tr>"
|
||||
If aParentProperty.Count Then sParSymbols &= "<td><b>" & ("Properties") & "</b></td><td width=\"32\"> </td>"
|
||||
If aParentVar.Count Then sParSymbols &= "<td><b>" & ("Variables") & "</b></td><td width=\"32\"> </td>"
|
||||
If aParentMethod.Count Then sParSymbols &= "<td><b>" & ("Methods") & "</b></td><td width=\"32\"> </td>"
|
||||
If aParentEvent.Count Then sParSymbols &= "<td><b>" & ("Events") & "</b></td><td width=\"32\"> </td>"
|
||||
sParSymbols &= "</tr>"
|
||||
sParSymbols &= "<tr valign=\"top\">"
|
||||
If aParentProperty.Count Then sParSymbols &= "<td>" & aParentProperty.Join(" ") & "</td><td width=\"32\"> </td>"
|
||||
If aParentVar.Count Then sParSymbols &= "<td>" & aParentVar.Join(" ") & "</td><td width=\"32\"> </td>"
|
||||
If aParentMethod.Count Then sParSymbols &= "<td>" & aParentMethod.Join(" ") & "</td><td width=\"32\"> </td>"
|
||||
If aParentEvent.Count Then sParSymbols &= "<td>" & aParentEvent.Join(" ") & "</td><td width=\"32\"> </td>"
|
||||
sParSymbols &= "</tr>"
|
||||
Endif
|
||||
|
||||
sSymbols = ""
|
||||
If aProperty.Count + aMethod.Count + aEvent.Count + aVar.Count Then
|
||||
sSymbols &= "<tr>"
|
||||
If aProperty.Count Then sSymbols &= "<td><b>" & ("Properties") & "</b></td><td width=\"32\"> </td>"
|
||||
If aVar.Count Then sSymbols &= "<td><b>" & ("Variables") & "</b></td><td width=\"32\"> </td>"
|
||||
If aMethod.Count Then sSymbols &= "<td><b>" & ("Methods") & "</b></td><td width=\"32\"> </td>"
|
||||
If aEvent.Count Then sSymbols &= "<td><b>" & ("Events") & "</b></td><td width=\"32\"> </td>"
|
||||
sSymbols &= "</tr>"
|
||||
sSymbols &= "<tr valign=\"top\">"
|
||||
If aProperty.Count Then sSymbols &= "<td>" & aProperty.Join(" ") & "</td><td width=\"32\"> </td>"
|
||||
If aVar.Count Then sSymbols &= "<td>" & aVar.Join(" ") & "</td><td width=\"32\"> </td>"
|
||||
If aMethod.Count Then sSymbols &= "<td>" & aMethod.Join(" ") & "</td><td width=\"32\"> </td>"
|
||||
If aEvent.Count Then sSymbols &= "<td>" & aEvent.Join(" ") & "</td><td width=\"32\"> </td>"
|
||||
sSymbols &= "</tr>"
|
||||
Endif
|
||||
|
||||
Endif
|
||||
|
||||
If hClassInfo.AutoCreatable Then sInfo = ("This class can be used like an object by creating an hidden instance on demand.<br>")
|
||||
If hClassInfo.Creatable Then sInfo &= ("This class is creatable.<br>")
|
||||
|
||||
If Not Component Or If Component = CComponent.PROJECT_NAME Then sWhere = "gambas://project/" & sClass & "?showfile"
|
||||
sTitle = sClass
|
||||
If sWhere Then sTitle = "<a href=\"" & sWhere & "\">" & sTitle & "</a>"
|
||||
|
||||
sHtml = File.Load("help/class-help.html")
|
||||
sHtml = Replace(sHtml, "$(help)", sHelp)
|
||||
|
||||
If sInfo Then
|
||||
sHtml = Replace(sHtml, "<!--$(Info)-->", sInfo & "<hr class=\"border\">")
|
||||
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("<a href=\"&1\">&2</a>", 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
|
||||
|
|
|
@ -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 &= "<a href=\"" & hClass.GetHelpURL() & "\">" & sClass & "</a><br>"
|
||||
|
||||
Next
|
||||
|
||||
sHtml = Replace(sHtml, "$(classes)", sDesc)
|
||||
sHtml = Replace(sHtml, "$(title)", Name)
|
||||
|
||||
sHtml = Replace(sHtml, "''Classes''", ("Classes"))
|
||||
|
||||
sHtml = Replace(sHtml, "$(hide-title)", "")
|
||||
|
||||
Return sHtml
|
||||
|
||||
End
|
||||
|
|
|
@ -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 = "<a href=\"" & "gambas://project/" & {Class} & "#" & Me.LineNumber & "?showfile" & "\">"
|
||||
If Not Component Or If Component = CComponent.PROJECT_NAME Then sTitle = "<a href=\"" & "gambas://project/" & {Class} & "#" & Me.LineNumber & "?showfile" & "\">"
|
||||
sTitle &= {Class} & "." & Name
|
||||
If Component = CComponent.PROJECT_NAME Then sTitle &= "</a>"
|
||||
If Not Component Or If Component = CComponent.PROJECT_NAME Then sTitle &= "</a>"
|
||||
|
||||
sHTML = Replace(sHTML, "$(title)", sTitle)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -100,6 +100,7 @@
|
|||
MoveScaled(8,1,31,27)
|
||||
Visible = False
|
||||
Expand = True
|
||||
Sorted = True
|
||||
Border = False
|
||||
}
|
||||
{ !webHelp WebView
|
||||
|
|
|
@ -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 & "[", "<!--")
|
||||
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("<a class=\"none\" href=\"&1\">&2</a>", 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 = "<b>" & sComp & "</b>"
|
||||
|
||||
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 &= "<tr>"
|
||||
If aParentProperty.Count Then sParSymbols &= "<td><b>" & ("Properties") & "</b></td><td width=\"32\"> </td>"
|
||||
If aParentVar.Count Then sParSymbols &= "<td><b>" & ("Variables") & "</b></td><td width=\"32\"> </td>"
|
||||
If aParentMethod.Count Then sParSymbols &= "<td><b>" & ("Methods") & "</b></td><td width=\"32\"> </td>"
|
||||
If aParentEvent.Count Then sParSymbols &= "<td><b>" & ("Events") & "</b></td><td width=\"32\"> </td>"
|
||||
sParSymbols &= "</tr>"
|
||||
sParSymbols &= "<tr valign=\"top\">"
|
||||
If aParentProperty.Count Then sParSymbols &= "<td>" & aParentProperty.Join(" ") & "</td><td width=\"32\"> </td>"
|
||||
If aParentVar.Count Then sParSymbols &= "<td>" & aParentVar.Join(" ") & "</td><td width=\"32\"> </td>"
|
||||
If aParentMethod.Count Then sParSymbols &= "<td>" & aParentMethod.Join(" ") & "</td><td width=\"32\"> </td>"
|
||||
If aParentEvent.Count Then sParSymbols &= "<td>" & aParentEvent.Join(" ") & "</td><td width=\"32\"> </td>"
|
||||
sParSymbols &= "</tr>"
|
||||
Endif
|
||||
|
||||
sSymbols = ""
|
||||
If aProperty.Count + aMethod.Count + aEvent.Count + aVar.Count Then
|
||||
sSymbols &= "<tr>"
|
||||
If aProperty.Count Then sSymbols &= "<td><b>" & ("Properties") & "</b></td><td width=\"32\"> </td>"
|
||||
If aVar.Count Then sSymbols &= "<td><b>" & ("Variables") & "</b></td><td width=\"32\"> </td>"
|
||||
If aMethod.Count Then sSymbols &= "<td><b>" & ("Methods") & "</b></td><td width=\"32\"> </td>"
|
||||
If aEvent.Count Then sSymbols &= "<td><b>" & ("Events") & "</b></td><td width=\"32\"> </td>"
|
||||
sSymbols &= "</tr>"
|
||||
sSymbols &= "<tr valign=\"top\">"
|
||||
If aProperty.Count Then sSymbols &= "<td>" & aProperty.Join(" ") & "</td><td width=\"32\"> </td>"
|
||||
If aVar.Count Then sSymbols &= "<td>" & aVar.Join(" ") & "</td><td width=\"32\"> </td>"
|
||||
If aMethod.Count Then sSymbols &= "<td>" & aMethod.Join(" ") & "</td><td width=\"32\"> </td>"
|
||||
If aEvent.Count Then sSymbols &= "<td>" & aEvent.Join(" ") & "</td><td width=\"32\"> </td>"
|
||||
sSymbols &= "</tr>"
|
||||
Endif
|
||||
|
||||
Endif
|
||||
|
||||
If hClassInfo.AutoCreatable Then sInfo = ("This class can be used like an object by creating an hidden instance on demand.<br>")
|
||||
If hClassInfo.Creatable Then sInfo &= ("This class is creatable.<br>")
|
||||
|
||||
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, "<!--$(Info)-->", sInfo & "<hr class=\"border\">")
|
||||
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("<a href=\"&1\">&2</a>", 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("<a class=\"none\" href=\"&1\">&2</a>", 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 = "<b>" & sComp & "</b>"
|
||||
'
|
||||
' 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 &= "<tr>"
|
||||
' If aParentProperty.Count Then sParSymbols &= "<td><b>" & ("Properties") & "</b></td><td width=\"32\"> </td>"
|
||||
' If aParentVar.Count Then sParSymbols &= "<td><b>" & ("Variables") & "</b></td><td width=\"32\"> </td>"
|
||||
' If aParentMethod.Count Then sParSymbols &= "<td><b>" & ("Methods") & "</b></td><td width=\"32\"> </td>"
|
||||
' If aParentEvent.Count Then sParSymbols &= "<td><b>" & ("Events") & "</b></td><td width=\"32\"> </td>"
|
||||
' sParSymbols &= "</tr>"
|
||||
' sParSymbols &= "<tr valign=\"top\">"
|
||||
' If aParentProperty.Count Then sParSymbols &= "<td>" & aParentProperty.Join(" ") & "</td><td width=\"32\"> </td>"
|
||||
' If aParentVar.Count Then sParSymbols &= "<td>" & aParentVar.Join(" ") & "</td><td width=\"32\"> </td>"
|
||||
' If aParentMethod.Count Then sParSymbols &= "<td>" & aParentMethod.Join(" ") & "</td><td width=\"32\"> </td>"
|
||||
' If aParentEvent.Count Then sParSymbols &= "<td>" & aParentEvent.Join(" ") & "</td><td width=\"32\"> </td>"
|
||||
' sParSymbols &= "</tr>"
|
||||
' Endif
|
||||
'
|
||||
' sSymbols = ""
|
||||
' If aProperty.Count + aMethod.Count + aEvent.Count + aVar.Count Then
|
||||
' sSymbols &= "<tr>"
|
||||
' If aProperty.Count Then sSymbols &= "<td><b>" & ("Properties") & "</b></td><td width=\"32\"> </td>"
|
||||
' If aVar.Count Then sSymbols &= "<td><b>" & ("Variables") & "</b></td><td width=\"32\"> </td>"
|
||||
' If aMethod.Count Then sSymbols &= "<td><b>" & ("Methods") & "</b></td><td width=\"32\"> </td>"
|
||||
' If aEvent.Count Then sSymbols &= "<td><b>" & ("Events") & "</b></td><td width=\"32\"> </td>"
|
||||
' sSymbols &= "</tr>"
|
||||
' sSymbols &= "<tr valign=\"top\">"
|
||||
' If aProperty.Count Then sSymbols &= "<td>" & aProperty.Join(" ") & "</td><td width=\"32\"> </td>"
|
||||
' If aVar.Count Then sSymbols &= "<td>" & aVar.Join(" ") & "</td><td width=\"32\"> </td>"
|
||||
' If aMethod.Count Then sSymbols &= "<td>" & aMethod.Join(" ") & "</td><td width=\"32\"> </td>"
|
||||
' If aEvent.Count Then sSymbols &= "<td>" & aEvent.Join(" ") & "</td><td width=\"32\"> </td>"
|
||||
' sSymbols &= "</tr>"
|
||||
' Endif
|
||||
'
|
||||
' Endif
|
||||
'
|
||||
' If hClassInfo.AutoCreatable Then sInfo = ("This class can be used like an object by creating an hidden instance on demand.<br>")
|
||||
' If hClassInfo.Creatable Then sInfo &= ("This class is creatable.<br>")
|
||||
'
|
||||
' 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, "<!--$(Info)-->", sInfo & "<hr class=\"border\">")
|
||||
' 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("<a href=\"&1\">&2</a>", 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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
</head>
|
||||
<body class="none">
|
||||
<div class="frame">
|
||||
<div class="title" $(hide-title)><a href="$(where)">$(class)</a></div>
|
||||
<div class="title" $(hide-title)>$(title)</div>
|
||||
<p>
|
||||
$(help)
|
||||
<div class="black"><font size="-2"><b>''Symbols''</b></font></div>
|
||||
|
|
27
app/src/gambas3/help/component-help.html
Normal file
27
app/src/gambas3/help/component-help.html
Normal file
|
@ -0,0 +1,27 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link rel="stylesheet" href="http://gambasdoc.org/style.css">
|
||||
<style>
|
||||
<!--
|
||||
.title { font-size: large; letter-spacing: 1px; }
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body class="none">
|
||||
|
||||
<div class="frame">
|
||||
<div class="title" $(hide-title)>$(title)</div>
|
||||
<p>
|
||||
$(help)
|
||||
<div class="black"><font size="-2"><b>''Classes''</b></font></div>
|
||||
<div class="border">
|
||||
<table class="none" cellspacing="0" cellpadding="2">
|
||||
$(classes)
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in a new issue