📄 frmoptions.frm
字号:
VERSION 5.00
Object = "{82D70786-7968-46EA-836D-203AEBCA4481}#1.0#0"; "SynCtrl.dll"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmOptions
BorderStyle = 3 'Fixed Dialog
Caption = "Options"
ClientHeight = 4020
ClientLeft = 45
ClientTop = 330
ClientWidth = 4635
KeyPreview = -1 'True
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4020
ScaleWidth = 4635
ShowInTaskbar = 0 'False
StartUpPosition = 1 'CenterOwner
Tag = "1006"
Begin SYNCTRLLibCtl.SynDeviceCtrl SynDeviceCtrl1
Left = 720
OleObjectBlob = "frmOptions.frx":0000
Top = 2520
End
Begin SYNCTRLLibCtl.SynAPICtrl SynAPICtrl1
Left = 600
OleObjectBlob = "frmOptions.frx":0024
Top = 1800
End
Begin VB.CommandButton cmdDone
Cancel = -1 'True
Caption = "Done"
Height = 375
Left = 3360
TabIndex = 1
Tag = "1013"
Top = 3600
Width = 1095
End
Begin VB.PictureBox picOptions
BorderStyle = 0 'None
Height = 2940
Index = 0
Left = -20000
ScaleHeight = 2987.419
ScaleMode = 0 'User
ScaleWidth = 4290.28
TabIndex = 2
TabStop = 0 'False
Top = 480
Width = 4245
Begin VB.OptionButton obExtent
Caption = "Border"
Height = 495
Index = 4
Left = 480
TabIndex = 9
Top = 2040
Width = 1215
End
Begin VB.OptionButton obExtent
Caption = "Rim"
Height = 495
Index = 3
Left = 480
TabIndex = 8
Top = 1560
Width = 1215
End
Begin VB.OptionButton obExtent
Caption = "Sensor"
Height = 495
Index = 2
Left = 480
TabIndex = 7
Top = 1080
Width = 1215
End
Begin VB.OptionButton obExtent
Caption = "Precision"
Height = 495
Index = 1
Left = 480
TabIndex = 6
Top = 600
Width = 1215
End
Begin VB.Frame Within
Caption = "Draw Within"
Height = 2505
Left = 208
TabIndex = 3
Tag = "1007"
Top = 207
Width = 1680
End
End
Begin VB.PictureBox picOptions
BorderStyle = 0 'None
Height = 2940
Index = 1
Left = 210
ScaleHeight = 2987.419
ScaleMode = 0 'User
ScaleWidth = 4290.28
TabIndex = 4
TabStop = 0 'False
Top = 480
Width = 4245
Begin VB.ComboBox Combo1
Height = 315
Left = 360
Style = 2 'Dropdown List
TabIndex = 10
Top = 600
Width = 3495
End
Begin VB.Frame fraSample2
Caption = "Configuration Key"
Height = 855
Left = 180
TabIndex = 5
Tag = "1008"
Top = 305
Width = 3840
End
End
Begin MSComctlLib.TabStrip tbsOptions
Height = 3405
Left = 105
TabIndex = 0
Top = 120
Width = 4455
_ExtentX = 7858
_ExtentY = 6006
_Version = 393216
BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628}
NumTabs = 2
BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "Extents"
ImageVarType = 2
EndProperty
BeginProperty Tab2 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "Device"
ImageVarType = 2
EndProperty
EndProperty
End
End
Attribute VB_Name = "frmOptions"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdDone_Click()
Unload Me
End Sub
Private Sub Combo1_Click()
fMainForm.Form_KeyPress (vbKeyEscape)
fMainForm.SynDeviceCtrl1.Select (Combo1.ItemData(Combo1.ListIndex))
End Sub
Private Sub Form_Load()
obExtent(fMainForm.ExtentType) = True
picOptions(0).Left = 210
picOptions(0).Enabled = True
picOptions(1).Left = -20000
picOptions(1).Enabled = False
SynAPICtrl1.Initialize
SynAPICtrl1.Activate
SynDeviceCtrl1.Select (0)
SynDeviceCtrl1.Activate
Dim DeviceHandle As Long
Dim ShortName As String
DeviceHandle = -1
Combo1.Clear
Do While True
DeviceHandle = SynAPICtrl1.FindDevice(SE_ConnectionAny, SE_DeviceTouchPad, DeviceHandle)
If DeviceHandle > -1 Then
SynDeviceCtrl1.Select (DeviceHandle)
ShortName = SynDeviceCtrl1.GetStringProperty(SP_ShortName)
Combo1.AddItem (ShortName)
Combo1.ItemData(Combo1.NewIndex) = DeviceHandle
Else
Exit Do
End If
Loop
Dim i As Integer
For i = 0 To Combo1.ListCount
If Combo1.ItemData(i) = fMainForm.SynDeviceCtrl1.GetLongProperty(SP_Handle) Then
Combo1.ListIndex = i
Exit For
End If
Next
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Dim i As Integer
i = tbsOptions.SelectedItem.Index
'handle ctrl+tab to move to the next tab
If (Shift And 3) = 2 And KeyCode = vbKeyTab Then
If i = tbsOptions.Tabs.Count Then
'last tab so we need to wrap to tab 1
Set tbsOptions.SelectedItem = tbsOptions.Tabs(1)
Else
'increment the tab
Set tbsOptions.SelectedItem = tbsOptions.Tabs(i + 1)
End If
ElseIf (Shift And 3) = 3 And KeyCode = vbKeyTab Then
If i = 1 Then
'last tab so we need to wrap to tab 1
Set tbsOptions.SelectedItem = tbsOptions.Tabs(tbsOptions.Tabs.Count)
Else
'increment the tab
Set tbsOptions.SelectedItem = tbsOptions.Tabs(i - 1)
End If
End If
End Sub
Private Sub obExtent_Click(Index As Integer)
Select Case Index
Case 1
fMainForm.XMin = 0
fMainForm.XMax = 8192
fMainForm.YMin = 0
fMainForm.YMax = 8192
Case 2
fMainForm.XMin = frmMain.SynDeviceCtrl1.GetLongProperty(SP_XLoSensor)
fMainForm.XMax = frmMain.SynDeviceCtrl1.GetLongProperty(SP_XHiSensor)
fMainForm.YMin = frmMain.SynDeviceCtrl1.GetLongProperty(SP_YLoSensor)
fMainForm.YMax = frmMain.SynDeviceCtrl1.GetLongProperty(SP_YHiSensor)
Case 3
fMainForm.XMin = frmMain.SynDeviceCtrl1.GetLongProperty(SP_XLoRim)
fMainForm.XMax = frmMain.SynDeviceCtrl1.GetLongProperty(SP_XHiRim)
fMainForm.YMin = frmMain.SynDeviceCtrl1.GetLongProperty(SP_YLoRim)
fMainForm.YMax = frmMain.SynDeviceCtrl1.GetLongProperty(SP_YHiRim)
Case 4
fMainForm.XMin = frmMain.SynDeviceCtrl1.GetLongProperty(SP_XLoBorder)
fMainForm.XMax = frmMain.SynDeviceCtrl1.GetLongProperty(SP_XHiBorder)
fMainForm.YMin = frmMain.SynDeviceCtrl1.GetLongProperty(SP_YLoBorder)
fMainForm.YMax = frmMain.SynDeviceCtrl1.GetLongProperty(SP_YHiBorder)
End Select
fMainForm.ExtentType = Index
End Sub
Private Sub tbsOptions_Click()
Dim i As Integer
'show and enable the selected tab's controls
'and hide and disable all others
For i = 0 To tbsOptions.Tabs.Count - 1
If i = tbsOptions.SelectedItem.Index - 1 Then
picOptions(i).Left = 210
picOptions(i).Enabled = True
Else
picOptions(i).Left = -20000
picOptions(i).Enabled = False
End If
Next
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -