Function DlgProc1(ControlName$,Action%,SuppValue
 im v1 As New point
v1.id = "vv"
v1.setvalue=1
If Action% = 2 Then
'Недоступны три кнопки.
If DlgControlId(ControlName$) = 7 Then
For i = 0 To 2
 lgEnable i,DlgValue("CheckBox1"
Next i
 lgProc1 = 1 'Не закрывать диалоговое окно.
End If
ElseIf Action% = 1 Then
'Установка значений при открытии
For i = 0 To 2
 lgEnable i,DlgValue("CheckBox1"
Next i
End If
'Кнопка Закрыть
If Action% = 2 And ControlName$ = "zz" Then
 im w As New Point
 im PointBaseName As CimObjectVariable
Set PointBaseName = cimOwnerObj.GetVariable("PointBaseName"
w.id=PointBaseName & ".ztt"
w.setvalue=1
w.setvalue=0
dlgproc1 = 1
End If
'Кнопка Открыть
If Action% = 2 And ControlName$ = "Открыть" Then
 im q As New Point
Set PointBaseName = cimOwnerObj.GetVariable("PointBaseName"
q.id=PointBaseName & ".оtt"
q.setvalue=1
q.setvalue=0
End If
'Выбор Режима управления
' Автоматический
If Action% = 2 And ControlName$ = "CheckBox1" Then
 im c As New point
Set PointBaseName = cimOwnerObj.GetVariable("PointBaseName"
c.id=PointBaseName & ".AM"
c.get
If c.value =0 Then
c.setvalue=1
Else
c.setvalue=0
End If
End If
'Запрет сигнализации
If Action% = 2 And ControlName$ = "CheckBox2" Then
 im o As New point
Set PointBaseName = cimOwnerObj.GetVariable("PointBaseName"
o.id=PointBaseName & ".al"
o.get
If o.value =0 Then
o.setvalue=1
Else
o.setvalue=0
End If
End If
If Action% = 2 And ControlName$ = "PushButton1" Then
v1.setvalue=0
dlgproc1 = 0
End If
End Function
Begin Dialog UserDialog1 ,,180,200,"Кран",.DlgProc1
PushButton 8,80,44,14,"Открыть",.Открыть
PushButton 108,80,44,14,"Закрыть",.zz
PushButton 60,80,44,14,"Стоп",.Стоп
GroupBox 4,8,164,24,"Состояние",.GroupBox1
GroupBox 4,116,168,27,"Управление",.Управление1
GroupBox 3,154,165,27,"Сигнализация",.Сигнализация
GroupBox 4,60,164,48,"Управление",.GroupBox2
CheckBox 12,128,60,8,"Ручной режим",.CheckBox1
CheckBox 11,167,100,8,"Сигнализация запрещена",.CheckBox2
TextBox 16,16,140,12,.TextBox1
PushButton 148,40,12,8,"refresh",.PushButton1
TextBox 16,40,36,12,.TextBox2
TextBox 68,40,36,12,.TextBox3
End Dialog
Ответить
|