[DEVELOPMENT ENVIRONMENT]
* NEW: Help browser: Language support in the offline help. git-svn-id: svn://localhost/gambas/trunk@6375 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
fa907cb38a
commit
cf4f1b9a72
4 changed files with 18 additions and 24 deletions
|
@ -104,14 +104,20 @@ Public Sub GotoURL(sUrl As String)
|
|||
|
||||
End
|
||||
|
||||
|
||||
Public Sub btnHome_Click()
|
||||
Public Sub GotoHome()
|
||||
|
||||
GotoURL(GetHomeURL())
|
||||
webHelp.TextZoom = 0.8
|
||||
|
||||
End
|
||||
|
||||
|
||||
Public Sub btnHome_Click()
|
||||
|
||||
GotoHome()
|
||||
|
||||
End
|
||||
|
||||
Public Sub btnBack_Click()
|
||||
|
||||
'GotoURL($hHistory.Backward())
|
||||
|
@ -206,7 +212,6 @@ Public Sub webHelp_Error()
|
|||
Endif
|
||||
|
||||
$bError = True
|
||||
btnModify.Enabled = False
|
||||
|
||||
End
|
||||
|
||||
|
@ -216,7 +221,6 @@ Public Sub webHelp_Load()
|
|||
|
||||
ShowWaiting(False)
|
||||
$bError = False
|
||||
btnModify.Enabled = webHelp.Url Begins Project.WIKI_URL
|
||||
|
||||
' If $bIgnoreNextHistory Then
|
||||
' $bIgnoreNextHistory = False
|
||||
|
@ -332,19 +336,19 @@ Public Sub Form_KeyPress()
|
|||
|
||||
End
|
||||
|
||||
Private Sub SetLang(sLang As String)
|
||||
Private Sub SetLang(Optional sLang As String)
|
||||
|
||||
Dim sUrl As String
|
||||
Dim sOldLang As String = MHelp.GetLanguage()
|
||||
|
||||
MHelp.SetLanguage(sLang)
|
||||
sLang = MHelp.GetLanguage()
|
||||
|
||||
sUrl = webHelp.Url
|
||||
If sUrl Begins Project.WIKI_URL Then
|
||||
sUrl = Replace(sUrl, "&l=" & sOldLang, "")
|
||||
'Debug sUrl & "&" & sLang
|
||||
GotoURL(sUrl & "&l=" & sLang)
|
||||
sUrl = URL.SetQuery(sUrl, "l", sLang)
|
||||
GotoURL(sUrl)
|
||||
Else If sUrl Begins "file:///" &/ MHelp.GetOfflineDir() Then
|
||||
GotoURL(Project.WIKI_ROOT &/ Wiki.Path & "?l=" & sLang)
|
||||
Endif
|
||||
|
||||
End
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Gambas Form File 3.0
|
||||
|
||||
{ Form Form
|
||||
MoveScaled(0,0,59,20)
|
||||
MoveScaled(0,0,55,20)
|
||||
Visible = False
|
||||
Action = "help"
|
||||
Text = ("Help browser")
|
||||
|
@ -80,13 +80,6 @@
|
|||
Text = ("Print")
|
||||
Picture = Picture["icon:/small/print"]
|
||||
}
|
||||
{ btnModify ToolButton
|
||||
MoveScaled(81,0,25,4)
|
||||
Visible = False
|
||||
AutoResize = True
|
||||
Text = ("Modify documentation") & "..."
|
||||
Picture = Picture["icon:/small/edit"]
|
||||
}
|
||||
}
|
||||
{ Printer1 #Printer
|
||||
#MoveScaled(4,2)
|
||||
|
|
|
@ -56,7 +56,7 @@ Public Sub GetLanguage(Optional bReturnVoidIfDefault As Boolean) As String
|
|||
If Not IsLower(Mid$(sLang, iPos, 1)) Then Break
|
||||
Next
|
||||
|
||||
Return "l=" & Left$(sLang, iPos - 1)
|
||||
Return Left$(sLang, iPos - 1)
|
||||
|
||||
End
|
||||
|
||||
|
@ -808,10 +808,6 @@ Public Sub ReadConfig()
|
|||
|
||||
End
|
||||
|
||||
Public Sub LoadOfflineHelpFile(sPath As String) As String
|
||||
|
||||
End
|
||||
|
||||
Public Sub GetOfflineDir() As String
|
||||
|
||||
Return Desktop.DataDir &/ "gambas3" &/ "wiki"
|
||||
|
@ -885,7 +881,7 @@ Public Sub MakeOffline(hWebView As WebView, sUrl As String)
|
|||
sUrl = Left(sUrl, iPos - 1)
|
||||
Endif
|
||||
|
||||
Wiki.Lang = Wiki.DEFAULT_LANG
|
||||
Wiki.Lang = GetLanguage()
|
||||
Wiki.Path = "/" &/ Mid$(sUrl, 8)
|
||||
Wiki.AnalyzePath()
|
||||
|
||||
|
|
|
@ -475,6 +475,7 @@ Public Sub btnOfflineHelp_Click()
|
|||
MHelp.ReadConfig
|
||||
panDownloadHelp.Visible = btnOfflineHelp.Value
|
||||
UpdateDocumentationState
|
||||
FHelpBrowser.GotoHome
|
||||
|
||||
End
|
||||
|
||||
|
@ -1291,4 +1292,4 @@ Private Sub UpdateDocumentationState()
|
|||
|
||||
End Select
|
||||
|
||||
End
|
||||
End
|
||||
|
|
Loading…
Reference in a new issue