home *** CD-ROM | disk | FTP | other *** search
Visual Basic class definition | 1998-11-02 | 1.5 KB | 58 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 = "CCircle"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = True
- Attribute VB_PredeclaredId = False
- Attribute VB_Exposed = False
-
- Private m_x As Integer 'Distance from center of circle to left side of form
- Private m_y As Integer 'Distance from center of circle to top of form
- Private m_r As Single 'Radius of circle
- Public Event PositionChanged(x As Integer, y As Integer, zc As Single) 'Triggered by change in center of circle
-
- Private Sub Class_Initialize()
- 'Set the initial center of the circle to the upper
- 'left corner of the form and set its radius to 500.
- m_x = 0
- m_y = 0
- m_r = 500
- End Sub
-
- Public Property Get Xcoord() As Integer
- Xcoord = m_x
- End Property
-
- Public Property Let Xcoord(ByVal vNewValue As Integer)
- m_x = vNewValue
- End Property
-
- Public Property Get Ycoord() As Integer
- Ycoord = m_y
- End Property
-
- Public Property Let Ycoord(ByVal vNewValue As Integer)
- m_y = vNewValue
- End Property
-
- Public Sub Show()
- 'Display the circle.
- 'See discussion of Circle method in Section 10.4.
- frmCircles.Circle (m_x, m_y), m_r
- End Sub
-
- Public Sub Move(Dist)
- 'Move the center of the circle Dist twips to the right
- 'and Dist twips down.
- m_x = m_x + Dist
- m_y = m_y + Dist
- RaiseEvent PositionChanged(m_x, m_y, m_r)
- Call Show
- End Sub
-