szubkin
11/20/2018 - 1:07 PM

VBScript

InitForm

sub InitForm
    template_top_header_visible = false                                         'убираем стандартные панели шаблонов
    If SCV_IN_VCP Then                                                          'компенсируем отсутствие панелей - уменьшаем высоту шаблону
        'VcpCommand("template:set_position " & _
        '        [_template].parent.parent.left & " " & _
        '        [_template].parent.parent.top & " " & _
        '        [_template].parent.parent.width & " " & _
        '        [_template].parent.parent.height - 95)

        [_template].parent.parent.width  = PanelTop.Width + 16
        [_template].parent.parent.height = Clear_Btn.Top + Clear_Btn.Height + 38 + 10

        [_template].parent.Autoscroll = false

    End If

    If SCV_IN_VCP Then
        ButtonSave.Visible = true
        ButtonClose.Visible = true
    Else
        ButtonSave.Visible = false
        ButtonClose.Visible = false
    End If

    [_template].color = RGB (222,222,222)       'красим вес шаблон в наш цвет

end sub


'------------------------------------------------------------------------------------------------------------
sub InitForm
    template_top_header_visible = false                                         'Убираем стандартные панели
    [_template].color = RGB(222,222,222)                                        'Красим вес шаблон в цвет

    If SCV_IN_VCP Then                                                          'Определяем размер шаблона
        [_template].parent.parent.width  = PageControl.Width + 16               'по ширине
        [_template].parent.parent.height = PageControl.Height + 38              'по высоте
        [_template].parent.Autoscroll = false                                   'убираем скролл
    End If
end sub


Sub ButtonSaveClick(Sender)
    'SCV_SHOW_SAVE_DIALOG = true                      'кнопка сохранить 

    if fill1.UTF8Text = "" then
        msgBox("Нет данных для отправки")
    else
        SCV_SHOW_SAVE_DIALOG = true                   'кнопка сохранить
    end if

End sub

Sub ButtonCloseClick(Sender)
    If SCV_IN_VCP Then
        [_template].parent.parent.close()
    End If
End sub

---------------------------------------

VcpCommand("template:set_position "&[_template].parent.parent.left&" "&[_template].parent.parent.top&" "&(PanelTOP.width + 25) &" "&IMG_R.width + IMG_R.Top + 50)        
function GenerateEverestCode
        'отменяем все стандартные реакции этого шаблона,
        'на стандартные горячие клавиши VizrtContentPilot
        GenerateEverestCode="<VCP_SEND_AS_IS/>" 
end function


'Описываем собственные реакции на нажатие горячих клавиш
Function OnActionEvent(EventID)
    Select Case EventID
        Case 0 take()           'EventID = 0 Load
        Case 1 take()           'EventID = 1 Start
        'Case 2 continue()       'EventID = 2 Continue
        Case 3 takeout()        'EventID = 3 Back
        Case 21 takeout()       'EventID = 21 TakeOut
    End Select
    
    OnActionEvent=1             'отрубаем стандартную реакцию
End function