VERSION 5.00
Object = "{20D850CB-47D3-4851-B31D-9AB92D97607C}#4.3#0"; "InputControls.ocx"
Begin VB.Form frmDeleteObjectPropPage1 
   BorderStyle     =   0  'None
   Caption         =   "1440"
   ClientHeight    =   990
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   5025
   ControlBox      =   0   'False
   BeginProperty Font 
      Name            =   "MS Shell Dlg"
      Size            =   8.25
      Charset         =   204
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   990
   ScaleWidth      =   5025
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   Begin VB.PictureBox Picture1 
      BorderStyle     =   0  'None
      Height          =   495
      Left            =   60
      Picture         =   "DeleteObjectPropPage1.frx":0000
      ScaleHeight     =   495
      ScaleWidth      =   555
      TabIndex        =   2
      Top             =   60
      Width           =   555
   End
   Begin DVInputControls.InputValue ivVariable 
      Height          =   315
      Left            =   2520
      TabIndex        =   1
      Top             =   600
      Width           =   2355
      _ExtentX        =   4154
      _ExtentY        =   556
      ShowInput       =   0   'False
      ShowMode        =   3
   End
   Begin VB.Label lblDeleteObject 
      Caption         =   "Удаление объекта"
      Height          =   405
      Left            =   720
      TabIndex        =   3
      Tag             =   "1800"
      Top             =   120
      Width           =   4155
   End
   Begin VB.Label lblVariable 
      Caption         =   "&Переменная:"
      Height          =   240
      Left            =   840
      TabIndex        =   0
      Tag             =   "1701"
      Top             =   660
      Width           =   1695
   End
End
Attribute VB_Name = "frmDeleteObjectPropPage1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'******************************************************************************
'* Form: frmDeleteObjectPropPage1
'*   Страница свойств функции
'******************************************************************************
Option Explicit

Private m_Object As WorkflowObjectsUI.IObjectUI
Private m_Settings As cSettings
Private m_ProcessInfo As DVDesigner.ProcessInfo

Private m_bInitialized As Boolean

'******************************************************************************
' Событие об изменении свойств
'******************************************************************************
Public Event OnChange()


'******************************************************************************
' Инициализация страницы
'******************************************************************************
Public Sub Initialize(Func As WorkflowObjectsUI.IObjectUI, Data As DVPropPages.DataObjects)
On Error GoTo ErrHandler
   Set m_Object = Func
   Set m_ProcessInfo = Data(3)
   
   g_LocaleID = Val(m_ProcessInfo.Session.Properties("LocaleID").Value)
   Set g_oCardHost = m_ProcessInfo.Host
   
   ' Локализуем страницу
   LoadResStrings Controls
   
   ' Подключаем контролы
   Set ivVariable.ProcessInfo = m_ProcessInfo
   
   ' Загружаем настройки
   Set m_Settings = New cSettings
   m_Settings.xml = m_Object.Data
   
   RefreshData
   
   m_bInitialized = True
Exit Sub

ErrHandler:
   ReportError hWnd, RES_ERRINITIALIZE, RES_DELETEOBJECT_CAPTION
End Sub

'******************************************************************************
' Сохранение изменений
'******************************************************************************
Public Function Save() As Boolean
On Error GoTo ErrHandler
   Save = False
   If Not ValidateFields Then Exit Function
   
   ' Сохраняем настройки
   With m_Settings
      .Item("VariableID").Value = ivVariable.Value
      
      m_Object.Data = .xml
   End With
   
   Save = True
Exit Function

ErrHandler:
   ReportError hWnd, RES_ERRSAVECHANGES, RES_DELETEOBJECT_CAPTION
End Function


' загрузить данные
Private Sub RefreshData()
   With m_Settings
      ivVariable.Value = .Item("VariableID").Value
   End With
End Sub

' проверить введенные данные
Private Function ValidateFields() As Boolean
   Dim sMsg As String
   If ivVariable.Value = vbNullString Then
      sMsg = sMsg & RES_DELETEOBJECT_VARIABLE_NOT_SPECIFIED & vbCrLf
   End If
   
   If sMsg <> vbNullString Then
      ReportMessage hWnd, sMsg, RES_DELETEOBJECT_CAPTION, MSG_TYPE_WARNING
      ValidateFields = False
   Else
      ValidateFields = True
   End If
End Function


'******************************************************************************
' Event handlers
'******************************************************************************
Private Sub Form_Initialize()
   m_bInitialized = False
End Sub

Private Sub Form_Load()
   LoadResStrings Me.Controls

End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
   If UnloadMode = 0 Then Cancel = True
End Sub

Private Sub Form_Terminate()
   Set m_Settings = Nothing
   Set m_Object = Nothing
   Set m_ProcessInfo = Nothing
   Set g_oCardHost = Nothing
End Sub

Private Sub ivVariable_Change()
   If m_bInitialized Then RaiseEvent OnChange
End Sub
