VERSION 5.00
Object = "{F4B4BFE0-25E1-11D0-B26A-006008104BEC}#1.0#0"; "VW4Key.ocx"
Object = "{F0EB2110-3CC3-11D0-8E54-006008104BEC}#1.0#0"; "VW4Index.ocx"
Object = "{2A559721-5321-11D0-95E6-006008104BEC}#1.0#0"; "VW4Language.ocx"
Object = "{C6652563-BD5B-11D0-B26C-006008104BEC}#1.0#0"; "VW4Trend.ocx"
Object = "{498C4702-2E69-11D5-89F4-0050BAB20053}#1.1#0"; "VW4TrendHelper.ocx"
Object = "{73B49944-40AB-11D5-8A0C-0050BAB20053}#2.0#0"; "VWSDateTime.ocx"
Begin VB.Form FTrendZoom 
   BorderStyle     =   0  'Kein
   Caption         =   "VW4Trend"
   ClientHeight    =   9000
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   12000
   Icon            =   "FTrendZoom.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   9000
   ScaleWidth      =   12000
   StartUpPosition =   2  'Bildschirmmitte
   Begin VWSDateTime.VWSDateTimeInput VWSDateTimeInput1 
      Height          =   495
      Left            =   4320
      TabIndex        =   14
      Top             =   6480
      Width           =   3075
      _ExtentX        =   5424
      _ExtentY        =   873
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ShowReturn      =   -1  'True
   End
   Begin VW4KeyLib.VWKey keyF4 
      Height          =   840
      Left            =   3600
      TabIndex        =   13
      Top             =   8160
      Width           =   1200
      _Version        =   65536
      _ExtentX        =   2117
      _ExtentY        =   1482
      _StockProps     =   72
      ForeColor       =   0
      FontClass       =   "Arial8Bold"
      Alignment       =   0
      Key             =   115
      FocusRect       =   0   'False
      IndexGroup      =   "FTrendMarker"
      FocusOnClick    =   0   'False
   End
   Begin VW4Trend.XFooter XFooter1 
      Height          =   855
      Left            =   0
      TabIndex        =   12
      Top             =   8160
      Width           =   12000
      _ExtentX        =   21167
      _ExtentY        =   1508
   End
   Begin VW4TrendHelper.VWTrendLegend VWTrendLegend1 
      Height          =   3135
      Left            =   9180
      TabIndex        =   11
      Top             =   960
      Width           =   2775
      _ExtentX        =   4895
      _ExtentY        =   5530
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      FontClass       =   "Arial8"
      Orientation     =   1
      Pitch           =   80
      TrendControl    =   "VWTrend1"
   End
   Begin VW4TrendHelper.VWTrendTime VWTrendTime1 
      Height          =   495
      Left            =   4320
      TabIndex        =   10
      Top             =   5940
      Width           =   3075
      _ExtentX        =   5424
      _ExtentY        =   873
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      TrendControl    =   "VWTrend1"
   End
   Begin VB.Frame Frame2 
      Caption         =   "Einstellungen"
      Height          =   1575
      Left            =   7620
      TabIndex        =   5
      Top             =   5460
      Width           =   4095
      Begin VB.TextBox txtScroll 
         Height          =   315
         Index           =   1
         Left            =   1740
         TabIndex        =   9
         Text            =   "5"
         Top             =   1140
         Width           =   375
      End
      Begin VB.ComboBox cmbScroll 
         Height          =   315
         Index           =   1
         Left            =   2220
         Style           =   2  'Dropdown-Liste
         TabIndex        =   8
         Top             =   1140
         Width           =   1815
      End
      Begin VB.TextBox txtScroll 
         Height          =   315
         Index           =   0
         Left            =   1740
         TabIndex        =   7
         Text            =   "5"
         Top             =   480
         Width           =   375
      End
      Begin VB.ComboBox cmbScroll 
         Height          =   315
         Index           =   0
         Left            =   2220
         Style           =   2  'Dropdown-Liste
         TabIndex        =   6
         Top             =   480
         Width           =   1815
      End
      Begin VW4IndexLib.VWIndex vwiText 
         Height          =   315
         Index           =   2
         Left            =   60
         Top             =   480
         Width           =   1635
         _Version        =   65536
         _ExtentX        =   2884
         _ExtentY        =   556
         _StockProps     =   96
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         TextOff         =   "Trendeinstellungen4"
         IndexGroup      =   "FTrendZoom"
         BackColorOff    =   -2147483633
         ShadowStyle     =   0
         Alignment       =   1
      End
      Begin VW4IndexLib.VWIndex vwiText 
         Height          =   315
         Index           =   3
         Left            =   60
         Top             =   1080
         Width           =   1635
         _Version        =   65536
         _ExtentX        =   2884
         _ExtentY        =   556
         _StockProps     =   96
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         TextOff         =   "Trendeinstellungen5"
         IndexGroup      =   "FTrendZoom"
         BackColorOff    =   -2147483633
         ShadowStyle     =   0
         Alignment       =   1
      End
   End
   Begin VW4LanguageLib.VWLanguage VWLanguage1 
      Left            =   60
      Top             =   7680
      _Version        =   65536
      _ExtentX        =   794
      _ExtentY        =   794
      _StockProps     =   0
   End
   Begin VW4TrendLib.VWTrend VWTrend1 
      Height          =   4575
      Left            =   120
      Top             =   660
      Width           =   9015
      _Version        =   65536
      _ExtentX        =   15901
      _ExtentY        =   8070
      _StockProps     =   37
      Trend1          =   "Trd23"
      Archive1        =   "Gl�ttung"
      MinValue1       =   -300
      MaxValue1       =   300
      Trend2          =   "Trd22"
      Archive2        =   "Gl�ttung"
      MinValue2       =   -300
      MaxValue2       =   300
      Trend3          =   "Trd25"
      Archive3        =   "Gl�ttung"
      MinValue3       =   -300
      MaxValue3       =   300
      Archive4        =   "Gl�ttung"
      MinValue4       =   -300
      MaxValue4       =   300
      Archive5        =   "Gl�ttung"
      MinValue5       =   -300
      MaxValue5       =   300
      MinValue6       =   -300
      MaxValue6       =   300
      MinValue7       =   -300
      MaxValue7       =   300
      MinValue8       =   -300
      MaxValue8       =   300
      ColorTrend1     =   0
      ColorTrend2     =   255
   End
   Begin VB.Frame Frame1 
      Caption         =   "Einstellungen"
      Height          =   1575
      Left            =   60
      TabIndex        =   0
      Top             =   5400
      Width           =   4095
      Begin VB.ComboBox cmbZeitraum 
         Height          =   315
         Left            =   2280
         Style           =   2  'Dropdown-Liste
         TabIndex        =   4
         Top             =   1020
         Width           =   1755
      End
      Begin VB.TextBox txtEingabe 
         Height          =   315
         Left            =   1860
         TabIndex        =   3
         Text            =   "5"
         Top             =   1020
         Width           =   375
      End
      Begin VB.TextBox txtMaxMinEingabe 
         Height          =   285
         Index           =   0
         Left            =   2280
         TabIndex        =   2
         Text            =   "Text1"
         Top             =   240
         Width           =   1755
      End
      Begin VB.TextBox txtMaxMinEingabe 
         Height          =   285
         Index           =   1
         Left            =   2280
         TabIndex        =   1
         Text            =   "Text1"
         Top             =   600
         Width           =   1755
      End
      Begin VW4IndexLib.VWIndex vwiText 
         Height          =   315
         Index           =   8
         Left            =   240
         Top             =   240
         Width           =   1635
         _Version        =   65536
         _ExtentX        =   2884
         _ExtentY        =   556
         _StockProps     =   96
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         TextOff         =   "Trendeinstellungen1"
         IndexGroup      =   "FTrendZoom"
         BackColorOff    =   -2147483633
         ShadowStyle     =   0
         Alignment       =   1
      End
      Begin VW4IndexLib.VWIndex vwiText 
         Height          =   315
         Index           =   0
         Left            =   240
         Top             =   540
         Width           =   1635
         _Version        =   65536
         _ExtentX        =   2884
         _ExtentY        =   556
         _StockProps     =   96
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         TextOff         =   "Trendeinstellungen2"
         IndexGroup      =   "FTrendZoom"
         BackColorOff    =   -2147483633
         ShadowStyle     =   0
         Alignment       =   1
      End
      Begin VW4IndexLib.VWIndex vwiText 
         Height          =   315
         Index           =   1
         Left            =   240
         Top             =   1020
         Width           =   1635
         _Version        =   65536
         _ExtentX        =   2884
         _ExtentY        =   556
         _StockProps     =   96
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         TextOff         =   "Trendeinstellungen3"
         IndexGroup      =   "FTrendZoom"
         BackColorOff    =   -2147483633
         ShadowStyle     =   0
         Alignment       =   1
      End
   End
   Begin VW4IndexLib.VWIndex idxCaption 
      Height          =   495
      Index           =   1
      Left            =   6000
      Top             =   0
      Width           =   6000
      _Version        =   65536
      _ExtentX        =   10583
      _ExtentY        =   873
      _StockProps     =   96
      BorderStyle     =   1
      FontClass       =   "Arial12Bold"
      TextOff         =   "idxCaption"
      IndexGroup      =   "FTrendZoom"
      UseTextProps    =   -1  'True
      BackColorOff    =   12632256
      ShadowStyle     =   1
      ShadowDepth     =   3
      ShadowColor2    =   14737632
      Range           =   32767
   End
   Begin VW4IndexLib.VWIndex idxCaption 
      Height          =   495
      Index           =   0
      Left            =   0
      Top             =   0
      Width           =   6000
      _Version        =   65536
      _ExtentX        =   10583
      _ExtentY        =   873
      _StockProps     =   96
      BorderStyle     =   1
      FontClass       =   "Arial12Bold"
      TextOff         =   "ProgramName"
      IndexGroup      =   "Global"
      UseTextProps    =   -1  'True
      BackColorOff    =   16711680
      ForeColorOff    =   16777215
      ShadowStyle     =   1
      ShadowDepth     =   3
      ShadowColor2    =   14737632
      Range           =   32767
   End
End
Attribute VB_Name = "FTrendZoom"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private msSettingsFileName As String 'Pfad+Dateiname zum Speichern der Trendeinstellungen

Private Sub cmbScroll_Click(Index As Integer)
    If Index = 0 Then
        VWTrendTime1.MaxInterval = cmbScroll(0).ListIndex
    Else
        VWTrendTime1.MinInterval = cmbScroll(1).ListIndex
    End If
End Sub

Private Sub Form_Activate()
    ' Vorbesetzen der Steuerelemente
    cmbScroll(1).ListIndex = VWTrendTime1.MinInterval
    cmbScroll(0).ListIndex = VWTrendTime1.MaxInterval
    txtScroll(0).Text = VWTrendTime1.MaxChange
    txtScroll(1).Text = VWTrendTime1.MinChange
    txtMaxMinEingabe(0).Text = VWTrend1.MaxValue1
    txtMaxMinEingabe(1).Text = VWTrend1.MinValue1
    cmbZeitraum.ListIndex = 1 ' Minute
    txtEingabe.Text = VWTrend1.SectionsMajorX
    VWTrendTime1.ApplyChanges
End Sub

Private Sub Form_Load()
    msSettingsFileName = App.Path & "\" & App.Title & ".ini"
    'vorige Trendeinstellungen laden
    VW4Trendhelper.ReadTrendSettings VWTrend1, msSettingsFileName
End Sub

Private Sub keyF4_Click()
    VW4Trendhelper.TrendSelect VWTrend1, , msSettingsFileName
    VWTrendLegend1.ApplyChanges 'Legende auffrischen
End Sub

Private Sub txtEingabe_KeyPress(KeyAscii As Integer)
    Select Case KeyAscii
    Case vbKey0 To vbKey9, vbKeyBack
        ' Tasten zulassen
    Case vbKeyReturn
        If IsNumeric(txtEingabe.Text) Then
            XAchsenEinteilung
            VWTrend1.ApplyChanges
        End If
    Case Else
        ' Alle anderen Tasten sperren
        KeyAscii = 0
    End Select
End Sub

Private Sub cmbZeitraum_Click()
    XAchsenEinteilung
End Sub

Private Sub XAchsenEinteilung()
    Select Case cmbZeitraum.ListIndex
    Case 0 ' Sekunde
        VWTrend1.SecondsPerMajor = (txtEingabe.Text * 1) / VWTrend1.SectionsMajorX
    Case 1 ' Minute
        VWTrend1.SecondsPerMajor = (txtEingabe.Text * 60) / VWTrend1.SectionsMajorX
    Case 2 ' Stunde
        VWTrend1.SecondsPerMajor = (txtEingabe.Text * 60 * 60) / VWTrend1.SectionsMajorX
    Case 3 ' Tag
        VWTrend1.SecondsPerMajor = (txtEingabe.Text * 60 * 60 * 24) / VWTrend1.SectionsMajorX
    Case 4 ' Monat
        VWTrend1.SecondsPerMajor = (txtEingabe.Text * 60 * 60 * 24 * 30) / VWTrend1.SectionsMajorX
    Case 5 ' Jahr
        VWTrend1.SecondsPerMajor = (txtEingabe.Text * 60 * 60 * 24 * 365) / VWTrend1.SectionsMajorX
    End Select
    VWTrend1.ApplyChanges
End Sub

Private Sub txtMaxMinEingabe_GotFocus(Index As Integer)
    'Inhalt des Textsteuerelementes markieren
    txtMaxMinEingabe(Index).SelStart = 0
    txtMaxMinEingabe(Index).SelLength = Len(txtMaxMinEingabe(Index))
End Sub

Private Sub txtMaxMinEingabe_KeyPress(Index As Integer, KeyAscii As Integer)
    Select Case KeyAscii
    Case vbKey0 To vbKey9, vbKeySubtract, 45, vbKeyBack
        ' Tasten zulassen
    Case vbKeyReturn
        If IsNumeric(txtMaxMinEingabe(Index).Text) Then
            Select Case Index
            Case 0
                VWTrend1.MaxValue1 = txtMaxMinEingabe(Index).Text
                VWTrend1.MaxValue2 = txtMaxMinEingabe(Index).Text
                VWTrend1.MaxValue3 = txtMaxMinEingabe(Index).Text
                VWTrend1.MaxValue4 = txtMaxMinEingabe(Index).Text
                VWTrend1.MaxValue5 = txtMaxMinEingabe(Index).Text
                VWTrend1.MaxValue6 = txtMaxMinEingabe(Index).Text
                VWTrend1.MaxValue7 = txtMaxMinEingabe(Index).Text
                VWTrend1.MaxValue8 = txtMaxMinEingabe(Index).Text
            Case 1
                VWTrend1.MinValue1 = txtMaxMinEingabe(Index).Text
                VWTrend1.MinValue2 = txtMaxMinEingabe(Index).Text
                VWTrend1.MinValue3 = txtMaxMinEingabe(Index).Text
                VWTrend1.MinValue4 = txtMaxMinEingabe(Index).Text
                VWTrend1.MinValue5 = txtMaxMinEingabe(Index).Text
                VWTrend1.MinValue6 = txtMaxMinEingabe(Index).Text
                VWTrend1.MinValue7 = txtMaxMinEingabe(Index).Text
                VWTrend1.MinValue8 = txtMaxMinEingabe(Index).Text
            End Select
        End If
        VWTrend1.ApplyChanges
    Case Else
        KeyAscii = 0
    End Select
End Sub

Private Sub txtScroll_KeyPress(Index As Integer, KeyAscii As Integer)
    Select Case KeyAscii
    Case vbKey0 To vbKey9, vbKeyBack
        ' Tasten zulassen
    Case vbKeyReturn
        If IsNumeric(txtScroll(Index).Text) Then
            If Index = 0 Then
                VWTrendTime1.MaxChange = txtScroll(Index).Text
            Else
                VWTrendTime1.MinChange = txtScroll(Index).Text
            End If
        End If
    Case Else
        KeyAscii = 0
    End Select
End Sub

Private Sub VWLanguage1_LanguageChange(ByVal Language As Long)
    Dim intIndex As Integer
    
    'Texte in nicht VisWin Steuerelemente laden
    Frame1.Caption = VWLanguage1.GetText("FTrendZoom.Trendeinstellungen0")
    Frame2.Caption = VWLanguage1.GetText("FTrendZoom.Trendeinstellungen6")
    
    For intIndex = 0 To 5
        cmbZeitraum.AddItem VWLanguage1.GetText("FTrendZoom.Zeiteinteilung" & intIndex)
        cmbScroll(0).AddItem VWLanguage1.GetText("FTrendZoom.Zeiteinteilung" & intIndex)
        cmbScroll(1).AddItem VWLanguage1.GetText("FTrendZoom.Zeiteinteilung" & intIndex)
    Next
End Sub

Private Sub VWSDateTimeInput1_AfterWriteValue(ByVal PreviousValue As Date, ByVal NewValue As Date)
    VWTrend1.Online = False
    VWTrend1.ScrollTime = NewValue
    VWTrendTime1.ApplyChanges
End Sub