📄 cls3dlabeldemo.cls
字号:
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "DDDLabelToolbar"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
' Copyright 1995-2004 ESRI
' All rights reserved under the copyright laws of the United States.
' You may freely redistribute and use this sample code, with or without modification.
' Disclaimer: THE SAMPLE CODE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
' WARRANTIES, INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
' FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ESRI OR
' CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
' OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
' SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
' INTERRUPTION) SUSTAINED BY YOU OR A THIRD PARTY, HOWEVER CAUSED AND ON ANY
' THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ARISING IN ANY
' WAY OUT OF THE USE OF THIS SAMPLE CODE, EVEN IF ADVISED OF THE POSSIBILITY OF
' SUCH DAMAGE.
' For additional information contact: Environmental Systems Research Institute, Inc.
' Attn: Contracts Dept.
' 380 New York Street
' Redlands, California, U.S.A. 92373
' Email: contracts@esri.com
Option Explicit
Implements IToolBarDef
Implements ILabel3DToolbarEnv
Private Sub Class_Initialize()
On Error Resume Next
Dim app As New AppRef
DoInit app
End Sub
Private Sub Class_Terminate()
On Error Resume Next
Exit Sub
Set g_pLabelEngine = Nothing
Set m_pLblEvents = Nothing
Set g_pDoc = Nothing
Set g_pCurrentGroup = Nothing
Set g_pCurrentLBL = Nothing
Set frmSlider.m_pCurrentGroup = Nothing
Set frmSlider.m_pCurrentLabel = Nothing
End Sub
Private Function ILabel3DToolbarEnv_LabelEngine() As DDDAnalystTextSample.Label3DEngine
On Error Resume Next
Set ILabel3DToolbarEnv_LabelEngine = g_pLabelEngine
End Function
Private Sub ILabel3DToolbarEnv_LoadLabelsFromLabelFile(sFile As String)
On Error Resume Next
Dim pGroup As LabelGroup
Set pGroup = g_pLabelEngine.LoadLabelsFromDoc(sFile, 1)
pGroup.Name = "*" & pGroup.Name & "*"
AddToFormLayerList pGroup
RefreshViewers
End Sub
Private Sub ILabel3DToolbarEnv_RefreshToolbar()
On Error GoTo EH
If g_pLabelEngine Is Nothing Then
Set g_pLabelEngine = New Label3DEngine
End If
Dim i As Integer
Dim pGroup As LabelGroup
' add the default graphics layer label group to the interface:
frmProps.cmbLayers.Clear
frmProps.cmbLabelField.Clear
AddToFormLayerList g_pLabelEngine.LabelGroup(0)
For i = 1 To g_pLabelEngine.LabelGroups.Count
Set pGroup = g_pLabelEngine.LabelGroup(i)
AddToFormLayerList pGroup
Next
Exit Sub
EH:
Debug.Assert 0
Debug.Print Err.Description
End Sub
Private Property Get IToolBarDef_Caption() As String
IToolBarDef_Caption = "3D Labels"
End Property
Private Sub IToolBarDef_GetItemInfo(ByVal pos As Long, ByVal itemDef As esriSystemUI.IItemDef)
Select Case pos
Case 0
itemDef.ID = "Label3DToolbar.Label3DMNU"
itemDef.Group = False
Case 1
itemDef.ID = "Label3DToolbar.LayerList"
itemDef.Group = False
Case 2
itemDef.ID = "Label3DToolbar.SelectLabel"
itemDef.Group = False
Case 3
itemDef.ID = "Label3DToolbar.AddLabel"
itemDef.Group = False
End Select
End Sub
Private Property Get IToolBarDef_ItemCount() As Long
IToolBarDef_ItemCount = 4
End Property
Private Property Get IToolBarDef_Name() As String
IToolBarDef_Name = "3D Labeling Tool"
End Property
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -