VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "ArrowState"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
'Klasa ArrowState
Implements State
Private med As Mediator

Public Sub init(md As Mediator)
  Set med = md
End Sub

Private Sub State_mouseDown(x As Integer, y As Integer)
  Dim drawings As Collection
  Dim i As Integer
  Dim found As Boolean
  Dim d As Drawing
  
  Set drawings = med.getDrawings()
  med.unpick
  i = 1
  found = False
  While i <= drawings.Count And Not found
    Set d = drawings(i)
    If (d.contains(x, y)) Then
      med.setSelected i
      med.rememberPosition
      found = True
    End If
    i = i + 1
  Wend
End Sub

Private Sub State_mouseDrag(x As Integer, y As Integer)
  Dim i As Integer
  Dim drawings As Collection
  Dim d As Drawing
  Set drawings = med.getDrawings
  For i = 1 To drawings.Count
    Set d = drawings(i)
    If d.contains(x, y) Then
      d.move x, y
    End If
  Next i
End Sub

Private Sub State_mouseUp(x As Integer, y As Integer)

End Sub

Private Sub State_selectOne(d As Drawing)

End Sub
