VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "visCircle"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
'Klasa visCircle
Implements Drawing
Private x As Integer, y As Integer, r As Integer, w As Integer, h As Integer
Private xc As Integer, yc As Integer
Private filled As Boolean, fillColor As ColorConstants
Private rect As Rectangle
Private selected As Boolean

Public Sub init(xp As Integer, yp As Integer)
  xc = xp
  yc = yp

  r = 15
  w = 30
  h = 30
  x = xc - r
  y = yc - r
  saveAsRect
  fillColor = vbRed
End Sub

Private Function Drawing_contains(xp As Integer, yp As Integer) As Boolean
  Drawing_contains = rect.contains(xp, yp)
End Function

Private Sub Drawing_draw(Pic As PictureBox)
  Dim i As Integer

  If filled Then
    For i = r To 1 Step -1
      Pic.Circle (xc, yc), i, fillColor
    Next i
    Pic.Line (x + 4, y + 4)-(x + w - 6, y + w - 6), fillColor, BF
  End If
  Pic.Circle (xc, yc), r
  If selected Then
    Pic.Line (x + w / 2, y - 2)- _
              (x + w / 2 + 4, y + 2), , BF
    Pic.Line (x - 2, y + h / 2)- _
              (x + 2, y + h / 2 + 4), , BF
    Pic.Line (x + (w / 2), y + h - 2)- _
              (x + (w / 2) + 4, y + h + 2), , BF
    Pic.Line (x + (w - 2), y + (h / 2))- _
              (x + (w + 2), y + (h / 2) + 4), , BF
  End If
End Sub

Private Sub Drawing_move(xpt As Integer, ypt As Integer)
  xc = xpt
  yc = ypt
  x = xc - r
  y = yc - r

  saveAsRect
End Sub

Private Sub saveAsRect()
  Set rect = New Rectangle
  rect.init x - r, y - r, w, w
End Sub

Private Sub Drawing_setFill(b As Boolean)
  filled = b
End Sub

Private Sub Drawing_setSelected(b As Boolean)
  selected = b
End Sub

Private Property Set Drawing_rects(rc As Rectangle)
  x = rc.x
  y = rc.y
  w = rc.w
  h = rc.h
  saveAsRect
End Property

Private Property Get Drawing_rects() As Rectangle
  Set Drawing_rects = rect
End Property
