home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 25: Programming / pc_actual_25.iso / Basic / GridOne / setup.EXE / CPRINTER.CLS < prev    next >
Encoding:
Visual Basic class definition  |  2001-09-09  |  2.9 KB  |  128 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4.   Persistable = 0  'NotPersistable
  5.   DataBindingBehavior = 0  'vbNone
  6.   DataSourceBehavior  = 0  'vbNone
  7.   MTSTransactionMode  = 0  'NotAnMTSObject
  8. END
  9. Attribute VB_Name = "CPrinter"
  10. Attribute VB_GlobalNameSpace = False
  11. Attribute VB_Creatable = False
  12. Attribute VB_PredeclaredId = False
  13. Attribute VB_Exposed = False
  14. Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
  15. Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
  16. '-----------------------------------------------------------------------------
  17. ' This is a part of the BeeGrid ActiveX control.
  18. ' Copyright ⌐ 2000 Stinga
  19. ' All rights reserved.
  20. '
  21. ' You have a right to use and distribute the BeeGrid sample files in original
  22. ' form or modified, provided that you agree that Stinga has no warranty,
  23. ' obligations, or liability for any sample application files.
  24. '-----------------------------------------------------------------------------
  25. Option Explicit
  26.  
  27. Implements ISGDevice
  28.  
  29. Private mhDC As Long
  30. Private mPrintBeeGrid As PrintBeeGrid
  31.  
  32. Private Sub Class_Initialize()
  33.    mhDC = Printer.hdc
  34. End Sub
  35.  
  36. Private Sub Class_Terminate()
  37.    Set mPrintBeeGrid = Nothing
  38. End Sub
  39.  
  40. Private Property Set ISGDevice_Destination(ByVal RHS As Object)
  41.  
  42. End Property
  43.  
  44. Private Property Get ISGDevice_Destination() As Object
  45.  
  46. End Property
  47.  
  48.  
  49.  
  50.  
  51.  
  52. Private Property Get ISGDevice_hDC() As Long
  53.    ISGDevice_hDC = mhDC
  54. End Property
  55.  
  56. Private Property Let ISGDevice_hDC(ByVal RHS As Long)
  57.    mhDC = RHS
  58. End Property
  59.  
  60.  
  61. Private Property Set ISGDevice_PrintGrid(ByVal RHS As PrintBeeGrid)
  62.    Set mPrintBeeGrid = RHS
  63. End Property
  64.  
  65. Private Property Get ISGDevice_PrintGrid() As PrintBeeGrid
  66.    Set ISGDevice_PrintGrid = mPrintBeeGrid
  67. End Property
  68.  
  69.  
  70. Private Sub ISGDevice_Paint()
  71.  
  72. End Sub
  73.  
  74. Private Sub ISGDevice_PrintReport()
  75.    Dim i As Long
  76.    Dim pgs As Pages
  77.    Dim lpdi As DOCINFO
  78.  
  79.    On Error GoTo PrintReportError
  80.    
  81.    Screen.MousePointer = 11
  82.    
  83.    lpdi.lpszDocName = "BeeGrid document"
  84.    
  85.    Set pgs = mPrintBeeGrid.Pages
  86.    
  87.    StartDoc mhDC, lpdi
  88.    
  89.    For i = 1 To pgs.Count
  90.       Set mPrintBeeGrid.SelectedPage = pgs.Item(i)
  91.       StartPage mhDC
  92.       mPrintBeeGrid.Printing mhDC
  93.       EndPage mhDC
  94.    Next
  95.    
  96.    EndDoc mhDC
  97.    Screen.MousePointer = 0
  98.    Exit Sub
  99. PrintReportError:
  100.    Screen.MousePointer = 0
  101.    MsgBox VBA.Error, vbExclamation
  102.    Exit Sub
  103. End Sub
  104.  
  105. Private Property Let ISGDevice_ScaleMode(ByVal RHS As Integer)
  106.    Printer.ScaleMode = RHS
  107. End Property
  108.  
  109. Private Property Get ISGDevice_ScaleMode() As Integer
  110.    ISGDevice_ScaleMode = Printer.ScaleMode
  111. End Property
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118. Private Property Get ISGDevice_TwipsPerPixelX() As Single
  119.    ISGDevice_TwipsPerPixelX = Printer.TwipsPerPixelX
  120. End Property
  121.  
  122.  
  123. Private Property Get ISGDevice_TwipsPerPixelY() As Single
  124.    ISGDevice_TwipsPerPixelY = Printer.TwipsPerPixelY
  125. End Property
  126.  
  127.  
  128.