Skip to content
Snippets Groups Projects
Commit 369f2301 authored by gambas's avatar gambas
Browse files

Help browser: Compute the title of a symbol the same way as the wiki.

[DEVELOPMENT ENVIRONMENT]
* NEW: Help browser: Use a SidePanel for the left panel.
* BUG: Help browser: Compute the title of a symbol the same way as the wiki.
parent c21f3477
Branches
Tags
No related merge requests found
Pipeline #490654846 passed
......@@ -57,12 +57,15 @@ Public Sub ReadConfig()
$bOffLine = Settings["/UseOfflineHelp"]
Project.SetSmallFont(panToolbar)
tabClass.TextFont = Project.GetSmallFont()
panToolbar.Font = tabClass.TextFont
panToolbar.H = tabClass.TabBarSize
If $bOffLine Then
tabClass.ShowTabBar = True
tabClass[1].Visible = True
Else
tabClass.ShowTabBar = False
tabClass.Index = 0
tabClass[1].Visible = False
Endif
End
......@@ -73,7 +76,7 @@ Public Sub Form_Open()
Dim sLang As String
Settings.Read(Me)
Settings.Read(splHelp)
Settings.Read(sdpHelp)
btnShowPanel.Value = Settings["/FHelpBrowser/ShowPanel", False]
btnShowPanel_Click
......@@ -103,7 +106,7 @@ End
Public Sub Form_Close()
Settings.Write(Me)
Settings.Write(splHelp)
Settings.Write(sdpHelp)
Settings["/FHelpBrowser/ShowPanel"] = btnShowPanel.Value
End
......@@ -213,9 +216,9 @@ End
Public Sub btnShowPanel_Click()
tabClass.Visible = btnShowPanel.Value
If btnShowPanel.Value Then FillTree
'If splHelp.Layout[0] = 0 Then splHelp.Layout = [1, 2]
FillTree
sdpHelp.Hidden = False
btnShowPanel.Hide
End
......@@ -438,3 +441,21 @@ Public Sub tabClass_Arrange()
spnSearch.Move(lstResult.X + (lstResult.W - spnSearch.W) \ 2, lstResult.Y + (lstResult.H - spnSearch.H) \ 2)
End
Public Sub tabClass_CloseAll()
sdpHelp.Hidden = True
End
Public Sub sdpHelp_Hide()
btnShowPanel.Show
End
Public Sub sdpHelp_Show()
btnShowPanel.Hide
End
# Gambas Form File 3.0
{ Form Form
MoveScaled(0,0,99,56)
MoveScaled(0,0,93,64)
Action = "help"
Text = ("Help browser")
Icon = Picture["icon:/small/help"]
Persistent = True
Utility = True
Arrangement = Arrange.Horizontal
{ sdpHelp SidePanel
MoveScaled(2,3,28,53)
Arrangement = Arrange.Fill
Orientation = Align.Left
Transparent = True
{ tabClass TabPanel
MoveScaled(0,0,27,41)
Arrangement = Arrange.Vertical
Count = 2
CloseButton = True
Index = 0
Text = ("Classes")
{ tvwClasses TreeView
MoveScaled(4,5,16,17)
Expand = True
Border = False
}
Index = 1
Text = ("Search")
{ Panel2 HBox
MoveScaled(0,1,34,4)
Background = Color.TextBackground
{ txtSearch ButtonBox
MoveScaled(0,0,24,4)
Expand = True
Border = False
Button = False
ClearButton = True
}
{ btnSearch ToolButton
MoveScaled(24,0,4,4)
Picture = Picture["icon:/small/find"]
}
}
{ Separator5 Separator
MoveScaled(7,7,14,0)
}
{ lstResult ListView
MoveScaled(3,11,25,10)
Expand = True
Border = False
}
{ spnSearch Spinner
MoveScaled(19,9,7,7)
Visible = False
Ignore = True
Type = Spinner.Circle
}
Index = 0
}
}
{ Panel1 VBox
MoveScaled(31,2,58,55)
Expand = True
{ panToolbar HBox
MoveScaled(0,0,97,4)
MoveScaled(0,0,81,4)
{ btnShowPanel ToolButton
MoveScaled(1,0,4,4)
Tracking = True
ToolTip = ("Show help tree")
Picture = Picture["icon:/small/view-split-h"]
Toggle = True
Picture = Picture["icon:/small/view-tree"]
}
{ btnHome MenuButton
MoveScaled(5,0,11,4)
......@@ -28,48 +81,48 @@
MoveScaled(17,0,1,4)
}
{ btnBack ToolButton
MoveScaled(21,0,4,4)
MoveScaled(18,0,4,4)
ToolTip = ("Go back")
Picture = Picture["icon:/small/left"]
}
{ btnForward ToolButton
MoveScaled(25,0,4,4)
MoveScaled(22,0,4,4)
ToolTip = ("Go forward")
Picture = Picture["icon:/small/right"]
}
{ btnStop ToolButton
MoveScaled(29,0,4,4)
MoveScaled(26,0,4,4)
ToolTip = ("Cancel")
Picture = Picture["icon:/small/delete"]
}
{ btnReload ToolButton
MoveScaled(33,0,4,4)
MoveScaled(30,0,4,4)
ToolTip = ("Reload")
Picture = Picture["icon:/small/refresh"]
}
{ Separator1 Separator
MoveScaled(37,0,1,4)
MoveScaled(34,0,1,4)
}
{ btnZoomIn ToolButton
MoveScaled(38,0,4,4)
MoveScaled(35,0,4,4)
ToolTip = ("Zoom in")
Picture = Picture["icon:/small/zoom-in"]
}
{ btnZoomOut ToolButton
MoveScaled(42,0,4,4)
MoveScaled(39,0,4,4)
ToolTip = ("Zoom out")
Picture = Picture["icon:/small/zoom-out"]
}
{ btnZoomNormal ToolButton
MoveScaled(46,0,4,4)
MoveScaled(43,0,4,4)
ToolTip = ("No zoom")
Picture = Picture["icon:/small/zoom-normal"]
}
{ Separator2 Separator
MoveScaled(51,0,1,4)
MoveScaled(48,0,1,4)
}
{ btnWebSite ToolButton
MoveScaled(52,0,31,4)
MoveScaled(50,0,21,4)
#Translate = False
ToolTip = "Gambas web site"
AutoResize = True
......@@ -77,7 +130,7 @@
Picture = Picture["icon:/small/gambas"]
}
{ btnPrint ToolButton
MoveScaled(84,0,8,4)
MoveScaled(72,0,8,4)
Visible = False
AutoResize = True
Text = ("Print")
......@@ -85,66 +138,15 @@
}
}
{ Separator4 Separator
MoveScaled(26,8,28,0)
}
{ Panel1 Panel
MoveScaled(4,16,84,33)
Expand = True
Arrangement = Arrange.Fill
{ splHelp HSplit
MoveScaled(2,2,80,29)
{ tabClass TabPanel
MoveScaled(1,1,37,26)
Arrangement = Arrange.Vertical
Border = False
Count = 2
Index = 0
Text = ("Classes")
{ tvwClasses TreeView
MoveScaled(2,3,16,17)
Expand = True
Border = False
}
Index = 1
Text = ("Search")
{ Panel2 HBox
MoveScaled(0,1,34,4)
Background = Color.TextBackground
{ txtSearch ButtonBox
MoveScaled(0,0,24,4)
Expand = True
Border = False
Button = False
ClearButton = True
}
{ btnSearch ToolButton
MoveScaled(24,0,4,4)
Picture = Picture["icon:/small/find"]
}
}
{ Separator5 Separator
MoveScaled(7,7,14,0)
}
{ lstResult ListView
MoveScaled(3,11,25,10)
Expand = True
Border = False
}
{ spnSearch Spinner
MoveScaled(19,9,7,7)
Visible = False
Ignore = True
Type = Spinner.Circle
}
Index = 0
MoveScaled(2,6,28,0)
}
{ webHelp HelpView
MoveScaled(52,5,24,18)
}
MoveScaled(4,29,24,18)
Expand = True
}
}
{ Printer1 #Printer
#MoveScaled(90,13)
#MoveScaled(80,47)
}
}
......
......@@ -343,7 +343,7 @@ Public Sub SolvePath(sPath As String) As String
End
Public Sub GetPageTitle(sPath As String) As String
Public Sub GetPageTitle(sPath As String, Optional bForceReadFile As Boolean) As String
Dim sFile As String
Dim iPos As Integer
......@@ -353,7 +353,7 @@ Public Sub GetPageTitle(sPath As String) As String
sPath = SolvePath(sPath)
bComp = sPath Begins "/comp/"
If bComp Then
If bComp And If Not bForceReadFile Then
If sPath Like "/comp/*/*/?*" Then Return GetSymbolTitle(sPath)
If sPath Like "/comp/*/?*" Then Return GetClassTitle(sPath)
Endif
......@@ -596,7 +596,16 @@ Public Sub GetSymbolTitle(Optional sPath As String) As String
If Not hSym Then Return sClass & "." & sSymbol & " (" & sComponent & ")?"
sName = CSymbolInfo.GetType(hSym.Class)
sName = hSym.Class
If sName Begins "." Then
sTitle = Trim(GetPageTitle("/comp" &/ sComponent &/ sClass, True)) ', True))
If sTitle Then
If Right(sTitle) = ")" Then sTitle = Trim(Left$(sTitle, RInStr(sTitle, "(") - 1))
sName = sTitle
Endif
Else
sName = CSymbolInfo.GetType(sName)
Endif
Select Case Wiki.Symbol
Case "_new"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment