home *** CD-ROM | disk | FTP | other *** search
/ Dan Appleman's Visual Bas…s Guide to the Win32 API / Dan.Applmans.Visual.Basic.5.0.Programmers.Guide.To.The.Win32.API.1997.Ziff-Davis.Press.CD / VB5PG32.mdf / classlib / desaware / dwpoint.cls < prev    next >
Encoding:
Text File  |  1996-02-18  |  1.9 KB  |  91 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "dwPoint"
  6. Attribute VB_Creatable = True
  7. Attribute VB_Exposed = True
  8. Option Explicit
  9.  
  10. ' Class dwPoint
  11. ' Desaware API Class library
  12. ' Copyright (c) 1996 by Desaware Inc.
  13. ' All rights reserved
  14.  
  15.  
  16. Private InternalPoint As POINTAPI
  17.  
  18. Private Sub Class_Initialize()
  19.     x = 0
  20.     y = 0
  21. End Sub
  22.  
  23. Public Property Get x() As Long
  24.     x = InternalPoint.x
  25. End Property
  26.  
  27. Public Property Let x(vNewValue As Long)
  28.     InternalPoint.x = vNewValue
  29. End Property
  30.  
  31. Public Property Get y() As Long
  32.     y = InternalPoint.y
  33. End Property
  34.  
  35. Public Property Let y(vNewValue As Long)
  36.     InternalPoint.y = vNewValue
  37. End Property
  38.  
  39. ' You can also use this class as a replacement for
  40. ' the SIZE data structure (as it serves the same
  41. ' purpose, has more functionality, and lets you
  42. ' load one less class).
  43. Public Property Get cx()
  44.     cx = InternalPoint.x
  45. End Property
  46.  
  47. Public Property Let cx(vNewValue)
  48.     InternalPoint.x = vNewValue
  49. End Property
  50.  
  51. Public Property Get cy()
  52.     cy = InternalPoint.y
  53. End Property
  54.  
  55. Public Property Let cy(vNewValue)
  56.     InternalPoint.y = vNewValue
  57. End Property
  58.  
  59. Public Sub SetPoint(ByVal x1, ByVal y1)
  60.     InternalPoint.x = x1
  61.     InternalPoint.y = y1
  62. End Sub
  63.  
  64. Public Sub CopyPoint(OtherPoint As dwPoint)
  65.       OtherPoint.x = InternalPoint.x
  66.       OtherPoint.y = InternalPoint.y
  67. End Sub
  68.  
  69. Public Function EqualToPoint(OtherPoint As dwPoint) As Boolean
  70.     If OtherPoint.x = InternalPoint.x Then
  71.         If OtherPoint.y = InternalPoint.y Then
  72.             EqualToPoint = True
  73.         Else
  74.             EqualToPoint = False
  75.         End If
  76.     Else
  77.         EqualToPoint = False
  78.     End If
  79. End Function
  80.  
  81. Public Sub OffsetPoint(ByVal x, ByVal y)
  82.     InternalPoint.x = InternalPoint.x + x
  83.     InternalPoint.y = InternalPoint.y + y
  84. End Sub
  85.  
  86. Public Sub SetPointEmpty()
  87.     InternalPoint.x = 0
  88.     InternalPoint.y = 0
  89. End Sub
  90.  
  91.