Private Declare Function Arc Lib "gdi32" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long, ByVal X4 As Long, ByVal Y4 As Long) As Long
' Draw the object in a metafile.
Private Sub TwoDObject_DrawInMetafile(ByVal mf_dc As Long)
SetMetafileDrawingParameters Me, mf_dc
Arc mf_dc, _
X - Radius, Y - Radius, _
X + Radius, Y + Radius, _
X + Radius, Y, _
X + Radius, Y
RestoreMetafileDrawingParameters mf_dc
End Sub
' Return the object's DrawWidth.
Public Property Get TwoDObject_DrawWidth() As Integer
TwoDObject_DrawWidth = m_DrawWidth
End Property
' Set the object's DrawWidth.
Public Property Let TwoDObject_DrawWidth(ByVal new_value As Integer)
m_DrawWidth = new_value
End Property
' Return the object's DrawStyle.
Public Property Get TwoDObject_DrawStyle() As DrawStyleConstants
TwoDObject_DrawStyle = m_DrawStyle
End Property
' Set the object's DrawStyle.
Public Property Let TwoDObject_DrawStyle(ByVal new_value As DrawStyleConstants)
m_DrawStyle = new_value
End Property
' Return the object's ForeColor.
Public Property Get TwoDObject_ForeColor() As OLE_COLOR
TwoDObject_ForeColor = m_ForeColor
End Property
' Set the object's ForeColor.
Public Property Let TwoDObject_ForeColor(ByVal new_value As OLE_COLOR)
m_ForeColor = new_value
End Property
' Return the object's FillColor.
Public Property Get TwoDObject_FillColor() As OLE_COLOR
TwoDObject_FillColor = m_FillColor
End Property
' Set the object's FillColor.
Public Property Let TwoDObject_FillColor(ByVal new_value As OLE_COLOR)
m_FillColor = new_value
End Property
' Return the object's FillStyle.
Public Property Get TwoDObject_FillStyle() As FillStyleConstants
TwoDObject_FillStyle = m_FillStyle
End Property
' Set the object's FillStyle.
Public Property Let TwoDObject_FillStyle(ByVal new_value As FillStyleConstants)
m_FillStyle = new_value
End Property
' Return this object's bounds.
Public Sub TwoDObject_Bound(ByRef xmin As Single, ByRef xmax As Single, ByRef ymin As Single, ByRef ymax As Single)
xmin = X - Radius
xmax = X + Radius
ymin = Y - Radius
ymax = Y + Radius
End Sub
' Draw the object on the canvas.
Public Sub TwoDObject_Draw(ByVal canvas As Object)
SetCanvasDrawingParameters Me, canvas
canvas.Circle (X, Y), Radius
End Sub
' Initialize the object using a serialization string.
' The serialization does not include the
' "TwoDRectangle(...)" part.
Private Property Let TwoDObject_Serialization(ByVal RHS As String)