home *** CD-ROM | disk | FTP | other *** search
Visual Basic class definition | 2001-09-09 | 2.9 KB | 128 lines |
- VERSION 1.0 CLASS
- BEGIN
- MultiUse = -1 'True
- Persistable = 0 'NotPersistable
- DataBindingBehavior = 0 'vbNone
- DataSourceBehavior = 0 'vbNone
- MTSTransactionMode = 0 'NotAnMTSObject
- END
- Attribute VB_Name = "CPrinter"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = False
- Attribute VB_Exposed = False
- Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
- Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
- '-----------------------------------------------------------------------------
- ' This is a part of the BeeGrid ActiveX control.
- ' Copyright ⌐ 2000 Stinga
- ' All rights reserved.
- '
- ' You have a right to use and distribute the BeeGrid sample files in original
- ' form or modified, provided that you agree that Stinga has no warranty,
- ' obligations, or liability for any sample application files.
- '-----------------------------------------------------------------------------
- Option Explicit
-
- Implements ISGDevice
-
- Private mhDC As Long
- Private mPrintBeeGrid As PrintBeeGrid
-
- Private Sub Class_Initialize()
- mhDC = Printer.hdc
- End Sub
-
- Private Sub Class_Terminate()
- Set mPrintBeeGrid = Nothing
- End Sub
-
- Private Property Set ISGDevice_Destination(ByVal RHS As Object)
-
- End Property
-
- Private Property Get ISGDevice_Destination() As Object
-
- End Property
-
-
-
-
-
- Private Property Get ISGDevice_hDC() As Long
- ISGDevice_hDC = mhDC
- End Property
-
- Private Property Let ISGDevice_hDC(ByVal RHS As Long)
- mhDC = RHS
- End Property
-
-
- Private Property Set ISGDevice_PrintGrid(ByVal RHS As PrintBeeGrid)
- Set mPrintBeeGrid = RHS
- End Property
-
- Private Property Get ISGDevice_PrintGrid() As PrintBeeGrid
- Set ISGDevice_PrintGrid = mPrintBeeGrid
- End Property
-
-
- Private Sub ISGDevice_Paint()
-
- End Sub
-
- Private Sub ISGDevice_PrintReport()
- Dim i As Long
- Dim pgs As Pages
- Dim lpdi As DOCINFO
-
- On Error GoTo PrintReportError
-
- Screen.MousePointer = 11
-
- lpdi.lpszDocName = "BeeGrid document"
-
- Set pgs = mPrintBeeGrid.Pages
-
- StartDoc mhDC, lpdi
-
- For i = 1 To pgs.Count
- Set mPrintBeeGrid.SelectedPage = pgs.Item(i)
- StartPage mhDC
- mPrintBeeGrid.Printing mhDC
- EndPage mhDC
- Next
-
- EndDoc mhDC
- Screen.MousePointer = 0
- Exit Sub
- PrintReportError:
- Screen.MousePointer = 0
- MsgBox VBA.Error, vbExclamation
- Exit Sub
- End Sub
-
- Private Property Let ISGDevice_ScaleMode(ByVal RHS As Integer)
- Printer.ScaleMode = RHS
- End Property
-
- Private Property Get ISGDevice_ScaleMode() As Integer
- ISGDevice_ScaleMode = Printer.ScaleMode
- End Property
-
-
-
-
-
-
- Private Property Get ISGDevice_TwipsPerPixelX() As Single
- ISGDevice_TwipsPerPixelX = Printer.TwipsPerPixelX
- End Property
-
-
- Private Property Get ISGDevice_TwipsPerPixelY() As Single
- ISGDevice_TwipsPerPixelY = Printer.TwipsPerPixelY
- End Property
-
-
-