VERSION 5.00
Object = "{E48EFDBF-5838-4A7D-95DD-BC0EC914BD4A}#1.5#0"; "StarCEComponents.ocx"
Begin VB.Form frmMain 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Multi-copy printing example"
   ClientHeight    =   3585
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   6705
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   MouseIcon       =   "frmMain.frx":0000
   ScaleHeight     =   3585
   ScaleWidth      =   6705
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton commandExit 
      Caption         =   "Exit"
      Height          =   375
      Left            =   5280
      TabIndex        =   13
      Top             =   3120
      Width           =   1335
   End
   Begin VB.CommandButton commandSave 
      Caption         =   "Save"
      Enabled         =   0   'False
      Height          =   375
      Left            =   3960
      TabIndex        =   12
      Top             =   3120
      Width           =   1335
   End
   Begin StarCEComponents.SelectImages SelectImages1 
      Height          =   495
      Left            =   1800
      TabIndex        =   11
      Top             =   3000
      Visible         =   0   'False
      Width           =   615
      _ExtentX        =   1085
      _ExtentY        =   873
      Appearance      =   1
      BackColor       =   -2147483633
      BackStyle       =   1
      BorderStyle     =   0
      Enabled         =   -1  'True
      ShowLabels      =   0   'False
   End
   Begin StarCEComponents.MultiCopy MultiCopy1 
      Height          =   495
      Left            =   1800
      TabIndex        =   8
      Top             =   2400
      Visible         =   0   'False
      Width           =   735
      _ExtentX        =   1296
      _ExtentY        =   873
      Appearance      =   1
      BackColor       =   -2147483633
      BackStyle       =   1
      BorderStyle     =   0
      Enabled         =   -1  'True
      ShowLabels      =   0   'False
   End
   Begin StarCEComponents.ConfigurationHandler ConfigurationHandler1 
      Left            =   2640
      Top             =   2400
      _ExtentX        =   1931
      _ExtentY        =   873
   End
   Begin VB.ListBox List1 
      Height          =   2985
      ItemData        =   "frmMain.frx":030A
      Left            =   0
      List            =   "frmMain.frx":031A
      TabIndex        =   1
      Top             =   600
      Width           =   1695
   End
   Begin VB.CheckBox chkMultiCopyEnabled 
      BackColor       =   &H00FFFFFF&
      Caption         =   "Multi-copy printing enabled"
      Height          =   375
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   5535
   End
   Begin VB.Label labelCopyEnabled 
      Caption         =   "labelCopyEnabled"
      Height          =   255
      Left            =   3600
      TabIndex        =   10
      Top             =   840
      Width           =   3015
   End
   Begin VB.Label Label4 
      Alignment       =   1  'Right Justify
      Caption         =   "Status:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   -1  'True
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   255
      Left            =   1800
      MouseIcon       =   "frmMain.frx":033E
      MousePointer    =   99  'Custom
      TabIndex        =   9
      Top             =   840
      Width           =   1695
   End
   Begin VB.Label labelMerge 
      Caption         =   "labelMerge"
      Height          =   255
      Left            =   3600
      TabIndex        =   7
      Top             =   2040
      Width           =   3015
   End
   Begin VB.Label labelFooter 
      Caption         =   "labelFooter"
      Height          =   255
      Left            =   3600
      TabIndex        =   6
      Top             =   1680
      Width           =   3015
   End
   Begin VB.Label labelHeader 
      Caption         =   "labelHeader"
      Height          =   255
      Left            =   3600
      TabIndex        =   5
      Top             =   1320
      Width           =   3015
   End
   Begin VB.Label labelChangeMerge 
      Alignment       =   1  'Right Justify
      Caption         =   "Merge Image:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   -1  'True
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   255
      Left            =   1800
      MouseIcon       =   "frmMain.frx":0648
      MousePointer    =   99  'Custom
      TabIndex        =   4
      Top             =   2040
      Width           =   1695
   End
   Begin VB.Label labelChangeFooter 
      Alignment       =   1  'Right Justify
      Caption         =   "Footer Image:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   -1  'True
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   255
      Left            =   1800
      MouseIcon       =   "frmMain.frx":0952
      MousePointer    =   99  'Custom
      TabIndex        =   3
      Top             =   1680
      Width           =   1695
   End
   Begin VB.Label labelChangeHeader 
      Alignment       =   1  'Right Justify
      Caption         =   "Header Image:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   -1  'True
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   255
      Left            =   1800
      MouseIcon       =   "frmMain.frx":0C5C
      MousePointer    =   99  'Custom
      TabIndex        =   2
      Top             =   1320
      Width           =   1695
   End
   Begin VB.Shape Shape1 
      BorderStyle     =   0  'Transparent
      FillColor       =   &H00FFFFFF&
      FillStyle       =   0  'Solid
      Height          =   615
      Left            =   0
      Top             =   0
      Width           =   6735
   End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub chkMultiCopyEnabled_Click()
    Me.MultiCopy1.MultiCopyEnabled = IIf(Me.chkMultiCopyEnabled.Value = vbChecked, True, False)
End Sub

Private Sub commandExit_Click()
    Unload Me
End Sub

Private Sub commandSave_Click()
    Me.ConfigurationHandler1.SaveConfigurationToQueue Globals.PrinterQueueName
    Me.commandSave.Enabled = False
End Sub

Private Sub ConfigurationHandler1_ConfigurationChanged()
    Me.commandSave.Enabled = True
End Sub

Private Sub Form_Load()

    Me.MultiCopy1.SetConfigurationHandler Me.ConfigurationHandler1
    Me.SelectImages1.SetConfigurationHandler Me.ConfigurationHandler1
    Me.ConfigurationHandler1.LoadConfigurationFromQueue Globals.PrinterQueueName

    Me.commandSave.Enabled = False

    DisplaySettings

End Sub

Private Sub DisplaySettings()
    ' Read in, and display the current settings
    
    Dim copy As Integer
    
    ' Multi-copy enabled master switch
    Me.chkMultiCopyEnabled.Value = IIf(Me.MultiCopy1.MultiCopyEnabled, vbChecked, vbUnchecked)
    
    ' If no copy is selected then choose the first
    If Me.List1.ListIndex < 0 Then Me.List1.ListIndex = 0
    
    copy = Me.List1.ListIndex + 1
    
    ' Fill out the info labels
    Me.labelCopyEnabled.Caption = IIf(Me.MultiCopy1.GetCopyEnabled(copy), "Enabled", "Disabled")
    Me.labelHeader.Caption = Me.MultiCopy1.GetHeaderImage(copy)
    Me.labelFooter.Caption = Me.MultiCopy1.GetFooterImage(copy)
    Me.labelMerge.Caption = Me.MultiCopy1.GetMergeImage(copy)

End Sub


Private Sub Label4_Click()
    ' Change the copy enabled/disabled state

    Dim copy As Integer
    
    ' Exit if nothing is selected in the list view
    If Me.List1.ListIndex < 0 Then Exit Sub
    
    copy = Me.List1.ListIndex + 1
    
    Me.MultiCopy1.SetCopyEnabled copy, Not Me.MultiCopy1.GetCopyEnabled(copy)
    
    DisplaySettings
End Sub

Private Sub labelChangeFooter_Click()
    
    Dim copy As Integer
    
    If Me.List1.ListIndex < 0 Then Exit Sub
    
    copy = Me.List1.ListIndex + 1
    Me.MultiCopy1.ChooseFooterImage (copy)
    DisplaySettings

End Sub

Private Sub labelChangeHeader_Click()
    
    Dim copy As Integer
    
    If Me.List1.ListIndex < 0 Then Exit Sub
    
    copy = Me.List1.ListIndex + 1
    Me.MultiCopy1.ChooseHeaderImage (copy)
    DisplaySettings
    
End Sub

Private Sub labelChangeMerge_Click()
    
    Dim copy As Integer
    
    If Me.List1.ListIndex < 0 Then Exit Sub
    
    copy = Me.List1.ListIndex + 1
    Me.MultiCopy1.ChooseMergeImage (copy)
    DisplaySettings
    
End Sub

Private Sub List1_Click()
    DisplaySettings
End Sub
