-
Notifications
You must be signed in to change notification settings - Fork 3
/
ZtCaption.cls
67 lines (50 loc) · 2.8 KB
/
ZtCaption.cls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "ZtCaption"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
' Class ZtCaption.
' It preserves informations about a caption, i.e number (e.g. '1.2.2'), text, and position in the document.
'
' Zotero Tools.
' This software is under Revised ('New') BSD license.
' Copyright © 2019, Olaf Ahrens. All rights reserved.
' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
' Private variables.
Private pvtConfig As ZtConfig
Private pvtNr As String
Private pvtText As String
Private pvtStart As Long
' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
' Friend procedures and properties.
Friend Sub Initialize(ByVal valConfig As ZtConfig, ByVal valNr As String, ByVal valText As String, ByVal valStart As Long)
Set pvtConfig = valConfig
pvtNr = valNr
pvtText = valText
Do While Right$(pvtText, 1) = vbCr Or Right$(pvtText, 1) = vbLf
pvtText = Left$(pvtText, Len(pvtText) - 1)
Loop
pvtText = Trim$(pvtText)
pvtStart = valStart
End Sub
Friend Property Get Start() As Long
Start = pvtStart
End Property
Friend Function ScreenTipText(ByVal valPageNr As Integer) As String
ScreenTipText = Replace(Replace(Replace(pvtConfig.User.BackwardLinkingStyle.ScreenTipPattern, _
pvtConfig.Basic.Macro.BackwardLinkingCaptionNrMarker, _
pvtNr), _
pvtConfig.Basic.Macro.BackwardLinkingCaptionTextMarker, _
pvtText), _
pvtConfig.Basic.Macro.BackwardLinkingPageNrMarker, _
CStr(valPageNr))
End Function
' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *