📄 frmnodesetup.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
Begin VB.Form FrmNodeSetup
Caption = "图元属性"
ClientHeight = 1845
ClientLeft = 2790
ClientTop = 3975
ClientWidth = 2625
Icon = "FrmNodeSetup.frx":0000
LinkTopic = "Form1"
ScaleHeight = 1845
ScaleWidth = 2625
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton cmduse
Caption = "应用"
Default = -1 'True
Enabled = 0 'False
Height = 375
Left = 120
TabIndex = 7
Top = 1440
Width = 855
End
Begin VB.Frame Frame1
Caption = "节点属性编辑"
Height = 1095
Left = 120
TabIndex = 2
Top = 120
Width = 2415
Begin VB.TextBox Text1
Height = 270
Left = 1200
TabIndex = 4
Text = "0.001"
ToolTipText = "单位为实际坐标单位(米)"
Top = 360
Width = 1095
End
Begin VB.Label Label1
Caption = "节点颜色:"
Height = 255
Index = 1
Left = 120
TabIndex = 6
Top = 720
Width = 975
End
Begin VB.Label Label2
Appearance = 0 'Flat
BackColor = &H000000FF&
BorderStyle = 1 'Fixed Single
ForeColor = &H80000008&
Height = 255
Left = 1200
TabIndex = 5
Top = 720
Width = 1095
End
Begin VB.Label Label1
Caption = "节点半径:"
Height = 255
Index = 0
Left = 120
TabIndex = 3
Top = 360
Width = 975
End
End
Begin VB.CommandButton cmdcancel
Caption = "取消"
Height = 375
Left = 1800
TabIndex = 1
Top = 1440
Width = 735
End
Begin MSComDlg.CommonDialog CommonDialog1
Left = 120
Top = 1440
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.CommandButton cmdok
Caption = "确定"
Enabled = 0 'False
Height = 375
Left = 1080
TabIndex = 0
Top = 1440
Width = 735
End
End
Attribute VB_Name = "FrmNodeSetup"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'*********************************************************************
'*
'* 本源码完全免费,共交通同仁学习参考 *
'* www.tranbbs.com *
'* Developed by Yang Ming *
'* Nanjing Institute of City Transportation Planning *
'* 请保留本版权信息,谢谢合作 *
'* 中国交通技术论坛 *
'* *
'* *
'*********************************************************************
Private Sub Cmdcancel_Click()
Unload Me
End Sub
Private Sub cmdok_Click()
If cmduse.Enabled = False Then
Unload Me
ElseIf cmduse.Enabled = True Then
cmduse_Click
Unload Me
End If
End Sub
Private Sub cmduse_Click()
cmduse.Enabled = False
cmdok.SetFocus
Dim FtrNode As Feature
Dim FtrNodes As Features
Dim LyrNode As Layer
Set LyrNode = Main.Mapshow.Layers("Node")
Load FrmProgress
FrmProgress.Show
If LyrNode.AllFeatures.Count <> 0 Then
step = 100 / LyrNode.AllFeatures.Count
End If
Dim Proval
Proval = step
NodeRadius = Val(Text1.Text)
NodeColor = Label2.BackColor
For Each FtrNode In LyrNode.AllFeatures
'读出原有属性,删掉原有节点
Dim Xtemp, Ytemp
Dim KeyVal
Xtemp = FtrNode.CenterX
Ytemp = FtrNode.CenterY
KeyVal = FtrNode.KeyValue
LyrNode.DeleteFeature FtrNode
'重新建立节点
Dim NodeI As New Point
Dim ObjNewFeature As New Feature
Dim ObjFeature As Feature
NodeI.Set Xtemp, Ytemp
Set ObjNewFeature = Main.Mapshow.FeatureFactory.CreateCircularRegion(1, NodeI, NodeRadius, 7, 32)
Set ObjFeature = LyrNode.AddFeature(ObjNewFeature)
ObjFeature.Style.RegionColor = Label2.BackColor
LyrNode.Refresh
LyrNode.KeyField = "NodeId"
ObjFeature.KeyValue = KeyVal
ObjFeature.Update
Progress Proval, "正在修改节点属性,请稍候..."
Proval = Proval + step
Next
Open ProjectPath & "setup.ini" For Output As #1
Write #1, NodeRadius, NodeColor, LinkWidth, LinkColor
Close #1
Unload FrmProgress
End Sub
Private Sub Form_Load()
On Error GoTo Myerr
Open ProjectPath & "setup.ini" For Input As #1
Do While Not EOF(1)
Input #1, NodeRadius, NodeColor, LinkWidth, LinkColor
Loop
Close #1
Text1.Text = NodeRadius
Label2.BackColor = NodeColor
cmduse.Enabled = False
cmdok.Enabled = False
Exit Sub
Myerr:
MsgBox "设置文件丢失,请确保项目文件的完整性!"
Close #1
Exit Sub
End Sub
Private Sub Label2_Click()
cmduse.Enabled = True
'将 Cancel 设置成 True。
CommonDialog1.CancelError = True
On Error GoTo ErrHandler
'设置 Flags 属性。
CommonDialog1.Flags = cdlCCRGBInit
'显示“颜色”对话框。
CommonDialog1.ShowColor
'将窗体的背景颜色设置成选定的
'颜色。
Label2.BackColor = CommonDialog1.Color
cmduse.Enabled = True
cmdok.Enabled = True
Exit Sub
ErrHandler:
'用户按了“取消”按钮。
Exit Sub
End Sub
Private Sub Text1_Change()
cmduse.Enabled = True
cmdok.Enabled = True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -